Media upload
Upload a video, audio clip or image and get back a public URL that does not expire. Use it to host reference media for other tools, such as a reference video for a video model. To edit an image, use upload_image_for_editing instead.
- The original file extension is kept: an
.mp4in gives an.mp4URL out. - Bytes are stored as-is. Nothing is transcoded or resized.
- Maximum size is 200 MB.
Supported formats
| Kind | Extensions |
|---|---|
| Video | mp4, mov, webm |
| Audio | mp3, wav, m4a, aac |
| Image | png, jpg, jpeg, webp, gif |
From an AI client: upload_media
| Parameter | Description |
|---|---|
file_path | A file on your machine. Works only through the STDIO proxy (gobananas-mcp), which reads the file and uploads it |
media_url | An HTTP or HTTPS URL that points straight at the media file |
file_name | Optional original filename, used to keep the extension |
mime_type | Optional; inferred from the extension when left out |
Set file_path or media_url. A remote connection (https://mcp.gobananasai.com) cannot read files on your machine, so use media_url, the STDIO proxy, or the REST endpoint below. See upload_media.
Over REST: POST /api/media/upload
Send the file as multipart form data in a file field:
curl -X POST "https://gobananasai.com/api/media/upload" \
-H "X-API-Key: sk_live_your_key_here" \
-F "file=@/path/to/clip.mp4"Or send JSON with a media_url, and Go Bananas fetches the file:
curl -X POST "https://gobananasai.com/api/media/upload" \
-H "X-API-Key: sk_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "media_url": "https://example.com/clip.mp4" }'Both modes also accept optional file_name and mime_type fields.
Response
{
"media_id": 77,
"url": "https://gobananasai.com/public/media/<workspace-id>/<date>/clip-<hash>.mp4",
"thumbnail_url": null,
"mime_type": "video/mp4",
"media_kind": "video",
"format": "mp4",
"size_bytes": 2097152
}duration_seconds, width and height are included when they can be read from the file.
Errors
| Status | error | Meaning |
|---|---|---|
| 400 | unsupported_media_format | The file type is not in the list above |
| 400 | empty_media | The file has no content |
| 413 | media_too_large | The file is over 200 MB |
A missing file field or media_url also returns 400, with a message saying what to send.