Overview
The Uploads API accepts base64-encoded file payloads from clients, stores them on the server, and returns a fetchable URL. The agent-chat bridge forwards the returned URL to the runtime as afile message part. Uploads are commonly used by the Allternit mobile composer to stage photos or documents before sending.
Base URL
Authorization header. See Authentication for details.
Endpoints
Upload file
- Maximum decoded payload: 20 MB.
- Upload IDs are alphanumeric and extensionless; the sidecar stores the original filename and media type.
Download upload
Content-Type. If the sidecar is missing, application/octet-stream is used. Range requests are supported.
Every upload is served with these headers, whoever made it (a client, run_code, or the sandbox files output):
So an HTML or SVG upload downloads and never runs as a page on the API’s origin. To show one in an app, fetch the bytes and display them in a sandboxed frame, for example
<iframe sandbox srcdoc=…> or a blob URL in a frame with the sandbox attribute. fetch() and <img> are not affected by these headers.
Upload IDs are random. run_code and sandbox output files get the same kind of ID as client uploads.