Upload image
Source-generated POST /files reference: authentication, fields, responses, errors, and operational safeguards.
On this page
Operation
POST /files
operationId: create_file_v1_files_post
Upload PNG, JPEG, or WebP as multipart field file and receive a reusable public file ID. The service validates actual image bytes and dimensions. No generation starts. An upload is not an idempotent paid create; avoid blindly replaying it after a transport error.
Authentication and side effects
Use a server-side Bearer API key. Required scope: animations:write
This operation does not start paid generation. Other state changes are described above.
Parameters
No path, query, or operation-specific header parameters.
Request body (multipart/form-data)
Body required: true
| Field | Type | Required | Default | Constraints | Meaning |
|---|---|---|---|---|---|
file |
string |
Yes | — | format: binary |
PNG, JPEG, or WebP image bytes; validated before returning a public file ID. |
Full nested schema: Body_create_file_v1_files_post
Responses
| HTTP | Body | Meaning |
|---|---|---|
201 |
FileResponse | Successful public response. Example values are illustrative. |
400 |
APIErrorEnvelope | Invalid input; correct the request before retrying. |
401 |
APIErrorEnvelope | Missing, expired, or revoked API key. |
403 |
APIErrorEnvelope | Account eligibility, account status, or key scope does not allow this operation. |
404 |
APIErrorEnvelope | Resource is unavailable, not owned, or its signature is invalid/expired. |
413 |
APIErrorEnvelope | Request or decoded image exceeds the configured limit. |
415 |
APIErrorEnvelope | Use supported image media types. |
422 |
APIErrorEnvelope | Decoded image dimensions exceed the allowed size. |
429 |
APIErrorEnvelope | Account-wide rate or queue limit; wait for Retry-After. |
500 |
APIErrorEnvelope | Internal failure; preserve the task/key and retry only when marked retryable. |
503 |
APIErrorEnvelope | Service/provider unavailable; retry only when error.retryable is true. |
Response headers
| HTTP | Header | Type | Meaning |
|---|---|---|---|
429 |
Retry-After |
integer |
Suggested wait in seconds; respect the server value and an overall deadline. |
503 |
Retry-After |
integer |
Suggested wait in seconds; respect the server value and an overall deadline. |
Response example
{
"byte_size": 1024,
"created_at": "2026-08-30T00:00:00Z",
"height": 512,
"id": "00000000-0000-4000-8000-000000000001",
"mime_type": "image/png",
"object": "file",
"sha256": "0000000000000000000000000000000000000000000000000000000000000000",
"width": 512
}
Related guides
Was this page helpful?
No search queries, code, or free text are collected. This switch controls documentation interactions only; general site analytics follow the privacy policy. Privacy policy