Skip to content
Docs menu

File Upload

Upload a file

On this page

POST /api/v1/files/upload

Send the file as multipart/form-data (field name file), or as JSON with a base64 payload. Returns the hosted URL to use as an input.

bash
# multipart
curl -X POST https://you.bot/api/v1/files/upload \
  -H "Authorization: Bearer $YOUBOT_API_KEY" \
  -F "[email protected]"

# or base64 JSON
curl -X POST https://you.bot/api/v1/files/upload \
  -H "Authorization: Bearer $YOUBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "base64Data": "<base64 or data: URL>", "mime": "image/png" }'
json
{
  "fileId": "1be3…ce.png",
  "fileUrl": "https://you.bot/api/v1/files/1be3…ce.png",
  "mime": "image/png",
  "size": 20480
}

Then pass fileUrl into a model input:

json
{ "modelId": "nano-banana-pro", "input": { "prompt": "make it snow", "imageUrl": "https://you.bot/api/v1/files/1be3…ce.png" } }