Skip to content

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 .mp4 in gives an .mp4 URL out.
  • Bytes are stored as-is. Nothing is transcoded or resized.
  • Maximum size is 200 MB.

Supported formats ​

KindExtensions
Videomp4, mov, webm
Audiomp3, wav, m4a, aac
Imagepng, jpg, jpeg, webp, gif

From an AI client: upload_media ​

ParameterDescription
file_pathA file on your machine. Works only through the STDIO proxy (gobananas-mcp), which reads the file and uploads it
media_urlAn HTTP or HTTPS URL that points straight at the media file
file_nameOptional original filename, used to keep the extension
mime_typeOptional; 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:

bash
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:

bash
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 ​

json
{
  "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 ​

StatuserrorMeaning
400unsupported_media_formatThe file type is not in the list above
400empty_mediaThe file has no content
413media_too_largeThe file is over 200 MB

A missing file field or media_url also returns 400, with a message saying what to send.