API reference · API
Store a file
POST/v1/studio/assetsAPI key
The bytes are the body, its Content-Type one of image/png, image/jpeg, image/webp, audio/mpeg, audio/wav, audio/ogg, audio/webm, audio/mp4, audio/aac, video/mp4, video/quicktime, video/webm; the bytes must start the way that type does (415 content_mismatch otherwise), any other type is 415 unsupported_media_type, past the size cap or the account's bytes 413 asset_too_large, past its count of files 409 too_many_assets. 402 storage_unpaid while the account's newest storage day is short. With job_id the file is that studio job's take (the account's own job, 404 otherwise; a file not of the job's kind is 400): it fills the copy the account was making from the provider, and a take kept already answers 200 with its stored file and keeps nothing more, so one take is one stored file. A 404 with code storage_off while stored media is switched off (ANTIMATTER_STUDIO_STORAGE). An API key with the chat scope (a write or a spend). Rate limited per key at the key's own requests a minute, in a window of its own. An agent's key is refused (403 policy_violation). Every /v1/studio door is a 404 while video and sound jobs are switched off.
Parameters
| Field | Type | What it is |
|---|---|---|
| name (query) | string | |
| project_id (query) | string | |
| doc_asset_id (query) | string | |
| job_id (query) | string |
Request body
image/png, required
The document names no fields for this body.
Answer 201
The stored file.
| Field | Type | What it is |
|---|---|---|
| id | string | |
| object | string | One of "studio.asset". |
| kind | string | One of "picture", "audio", "clip". |
| source | string | One of "upload", "job". |
| status | string | One of "ready", "awaiting", "failed". |
| project_id | string or null | |
| job_id | string or null | |
| doc_asset_id | string or null | The editor Asset this file stands for. |
| name | string or null | |
| content_type | string or null | |
| bytes | integer | |
| sha256 | string or null | |
| error | string or null | |
| created_at | integer | |
| updated_at | integer |
Errors
- 400OpenAI shaped error.
- 401OpenAI shaped error.
- 402OpenAI shaped error.
- 403OpenAI shaped error.
- 404OpenAI shaped error.
- 409OpenAI shaped error.
- 413OpenAI shaped error.
- 415OpenAI shaped error.
- 429OpenAI shaped error.
Every error answers in one shape, with its type, code and the field it names. The whole list is in the docs' Errors section.