Files

Start an upload of a local file, so it can be passed to a generation endpoint by URL instead of inline as base64. Declare the file's MIME type and exact size in bytes (up to 15MB, the same limit the generation endpoints apply); the response carries an upload_url and a file_url. Send the file's bytes in a single PUT to upload_url (no Authorization header; the content type and size are fixed by this call, and a body of any other size is refused). Once the PUT succeeds, pass file_url in any image, audio, video or model field that accepts a URL. The file is public to anyone holding file_url and is deleted 7 days after upload. upload_url is single-use. Free (no credits). Requires an API key (user scope). Not exposed as an MCP tool.

post/assets/uploads

Request body

mime_type'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif' | 'audio/mpeg' | 'audio/wav' | 'audio/x-wav' | 'audio/ogg' | 'audio/flac' | 'audio/mp4' | 'audio/aac' | 'audio/webm' | 'video/mp4' | 'video/webm' | 'video/quicktime' | 'model/gltf-binary' required

MIME type of the file. Fixed for the upload; the stored file is served with it.

sizeinteger required

Exact size of the file in bytes (at most 15MB). The PUT to upload_url must send exactly this many bytes.

Response

Success

upload_urlstring required

Single-use URL to PUT the file's bytes to, with no Authorization header.

file_urlstring required

Public URL of the file once the PUT succeeds. Pass it to any field that accepts a URL. Deleted 7 days after upload.

mime_typestring required

The MIME type the file is stored and served with.

sizeinteger required

The exact number of bytes the PUT must send.

Changes

Changed in 1 of the 17 revisions of this API.1