Overview
Most multimodal models on ModelRunner accept files (images, audio clips, videos) as URLs in their input. ModelRunner provides two upload patterns:- Single-part upload — one presigned
PUTto S3, suitable for files up to ~5 GB. - Multipart upload — three-step flow with per-part presigned URLs, required for very large files or when you want resumability.
media.modelrunner.ai URL that you can pass directly to any model input field that accepts a file.
The SDKs wrap the single-part flow as
storage.upload() (JS) and upload_file() (Python). Use the raw HTTP flow below when you need multipart or when calling the API directly.Single-part upload
A two-step flow: initiate → PUT bytes to the returned presigned URL.1
Initiate the upload
POST /storage/upload/initiate returns a presigned upload_url and the canonical file_url to use as model input.cURL
2
PUT the bytes to the presigned URL
Send the raw file body to On success,
upload_url with the same Content-Type. Do not add the Authorization header — the presigned URL carries its own credentials.cURL
file_url is immediately usable. Pass it to any model input that accepts a URL:Setting an expiration
Uploads are kept until you delete them. To have one expire automatically, send the object-lifecycle header on the initiate call — the same header used for generated media:complete call instead, since that is where the file is recorded.
In the JavaScript SDK this is the lifecycle option:
Using the SDKs
Multipart upload (large files)
For multi-gigabyte videos or when you want resumability, use the three-step multipart flow.1
Initiate the multipart upload
POST /storage/upload/initiate-multipart returns an uploadId, uploadKey, and the canonical fileUrl.2
Upload each part
Split the file into parts (S3 requires each part except the last to be ≥ 5 MiB). For each part number starting at
1, request a presigned URL and PUT the part to it.3
Complete the upload
POST /storage/upload/complete finalizes the multipart upload and creates the file row.fileUrl is now usable as a model input.Reference
All endpoints require the standard
Authorization: Key <your_key> header. See API keys.
