Upload flow
1
Create an upload
Call
POST /v1/uploads with purpose, content_type, and the exact size_bytes. The response contains a media_id, a single-use upload_url, and required headers.2
Upload the bytes
Send a
PUT request directly to upload_url using the returned required_headers. The bytes do not pass through the generation API.3
Complete the upload
Call
POST /v1/uploads/{media_id}/complete. We verify the stored object’s content type, size, and hash before it can be used.4
Use the media ID
Pass the ready
media_id in a supported media input field.Limits
Only content types listed by
POST /v1/uploads are accepted.
A media_id can be attached to exactly one job. Reusing it returns 400 invalid_media_input.
An account may hold up to 5 GiB of live inputs. Incomplete uploads count against the quota at the maximum size for their purpose. When the quota is exceeded, POST /v1/uploads returns 413 storage_quota_exceeded.
Uploads that are never attached expire after 24 hours.