Image assets
Upload or generate private images for your templates, read prompt history, and check file limits.
Give this prompt to your AI agent. The agent does the task for you.
Read https://thirds.ai/docs/api-reference/image-assets and help me choose the right thirds.ai endpoint and write a request. Check the fields and credentials in this reference.
See all API resources or read the PDF generation API guide.
Endpoints
getAiImageHistory
GET /v1/image-assets/{id}/ai-history
Read private generated image history
Read the generated image history for an image asset you own.
Authentication: bearer API key. See authentication.
| Parameter | Location | Required | Rule |
|---|---|---|---|
id | path | Yes | {"type":"string","pattern":"^asset_[0-9a-f]{32}$"} |
| Status | Meaning | Body |
|---|---|---|
| 200 | Read private generated image history. | application/json: AiImageHistory |
| 401 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 403 | The authenticated account is suspended. The code is account_suspended. | application/json: ErrorEnvelope |
| 404 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 405 | The method is not allowed on this route. | application/json: ErrorEnvelope |
| 409 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 431 | The request has more than 64 headers or more than 32 KiB of header names and values. | application/json: ErrorEnvelope |
| 500 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
generateAiImage
POST /v1/ai-images
Generate an AI image
Generate one image with Seedream 5.0 Lite. Each successful image costs 50 credits, including free monthly credits. Failed requests and requests cancelled while queued release the credits. Send only after the customer approves the prompt and cost. Reuse the same Idempotency-Key when retrying an uncertain request. A matching replay returns the same image request; a changed body returns 409. Account AI concurrency, storage, and failed-operation limits apply. The prompt is at most 65536 UTF-8 bytes.
Authentication: bearer API key. See authentication.
| Parameter | Location | Required | Rule |
|---|---|---|---|
Idempotency-Key | header | Yes | {"type":"string","minLength":1,"maxLength":255,"pattern":"^[ -~]+$"} |
Request body: application/json, AiImageCreate.
| Status | Meaning | Body |
|---|---|---|
| 202 | The image request was accepted or replayed. | application/json: AiImageGeneration |
| 400 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 401 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 402 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 403 | The authenticated account is suspended. The code is account_suspended. | application/json: ErrorEnvelope |
| 404 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 405 | The method is not allowed on this route. | application/json: ErrorEnvelope |
| 409 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 413 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 422 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 429 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 431 | The request has more than 64 headers or more than 32 KiB of header names and values. | application/json: ErrorEnvelope |
| 500 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 503 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
getAiImage
GET /v1/ai-images/{id}
Read AI image progress
Read only your account’s request. This does not start generation or spend credits.
Authentication: bearer API key. See authentication.
| Parameter | Location | Required | Rule |
|---|---|---|---|
id | path | Yes | {"type":"string","pattern":"^aimg_[0-9a-f]{32}$"} |
| Status | Meaning | Body |
|---|---|---|
| 200 | The current image state and its saved asset, when ready. | application/json: AiImageGeneration |
| 400 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 401 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 402 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 403 | The authenticated account is suspended. The code is account_suspended. | application/json: ErrorEnvelope |
| 404 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 405 | The method is not allowed on this route. | application/json: ErrorEnvelope |
| 409 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 413 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 422 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 429 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 431 | The request has more than 64 headers or more than 32 KiB of header names and values. | application/json: ErrorEnvelope |
| 500 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 503 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
cancelAiImage
DELETE /v1/ai-images/{id}
Cancel an AI image request
Cancel a queued image and release its credits. A running image has already reached the image service, so it keeps running, costs 50 credits when it succeeds, and returns its current state. A finished request keeps its final state. This action never starts a generation.
Authentication: bearer API key. See authentication.
| Parameter | Location | Required | Rule |
|---|---|---|---|
id | path | Yes | {"type":"string","pattern":"^aimg_[0-9a-f]{32}$"} |
| Status | Meaning | Body |
|---|---|---|
| 200 | The current image state and its saved asset, when ready. | application/json: AiImageGeneration |
| 400 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 401 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 402 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 403 | The authenticated account is suspended. The code is account_suspended. | application/json: ErrorEnvelope |
| 404 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 405 | The method is not allowed on this route. | application/json: ErrorEnvelope |
| 409 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 413 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 422 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 429 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 431 | The request has more than 64 headers or more than 32 KiB of header names and values. | application/json: ErrorEnvelope |
| 500 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 503 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
previewImageUrl
POST /v1/image-assets/preview
Preview a URL image
Read a public HTTP or HTTPS PNG, JPEG, or WebP through the checked asset transport. Credentials, private destinations, unsafe DNS answers, and redirects to them are refused. At most five redirects and 15 seconds total. The same upload decoder checks the 10 MiB, dimension, pixel, and memory limits. Returns verified bytes without storage or a render charge. Browser sessions require CSRF.
Authentication: bearer API key. See authentication.
Request body: application/json, {"type":"object","properties":{"url":{"type":"string","maxLength":4096}},"required":["url"],"additionalProperties":false}.
| Status | Meaning | Body |
|---|---|---|
| 200 | The verified image bytes and dimensions after orientation. | image/png: {"type":"string","format":"binary"}; image/jpeg: {"type":"string","format":"binary"}; image/webp: {"type":"string","format":"binary"} |
| 400 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 401 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 403 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 405 | The method is not allowed on this route. | application/json: ErrorEnvelope |
| 413 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 422 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 429 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 431 | The request has more than 64 headers or more than 32 KiB of header names and values. | application/json: ErrorEnvelope |
| 500 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 503 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
uploadImage
POST /v1/image-assets
Upload an image
Store one private, immutable PNG, JPEG, or WebP image. Send the raw bytes with the matching Content-Type. Maximum 10 MiB, 7680 by 4320 stored pixels, 32 million pixels, and 64 MiB decoded memory. Animated images are refused. Images and brand assets share an account limit of 100 files and 100 MiB. Use the returned reference in an HTML body img src, or in template data for an img src. Render creation checks ownership after template expansion and captures the exact bytes. References are not public URLs. PDF header and footer templates do not support image references. No render credit is charged for an upload.
Authentication: bearer API key. See authentication.
Request body: image/png, {"type":"string","format":"binary"}.
Request body: image/jpeg, {"type":"string","format":"binary"}.
Request body: image/webp, {"type":"string","format":"binary"}.
| Status | Meaning | Body |
|---|---|---|
| 201 | The image is stored. | application/json: UploadedImage |
| 400 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 401 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 403 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 404 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 405 | The method is not allowed on this route. | application/json: ErrorEnvelope |
| 413 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 422 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 429 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 431 | The request has more than 64 headers or more than 32 KiB of header names and values. | application/json: ErrorEnvelope |
| 500 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 503 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
readImageContent
GET /v1/image-assets/{id}/content
Read an owned image
Return verified image or captured brand logo/font bytes to their owner. Missing and foreign assets return the same 404 error. The response uses private, no-store caching and nosniff.
Authentication: bearer API key. See authentication.
| Parameter | Location | Required | Rule |
|---|---|---|---|
id | path | Yes | {"type":"string","pattern":"^asset_[a-f0-9]{32}$"} |
| Status | Meaning | Body |
|---|---|---|
| 200 | The exact image bytes. | font/woff2: {"type":"string","format":"binary"}; image/png: {"type":"string","format":"binary"}; image/jpeg: {"type":"string","format":"binary"}; image/webp: {"type":"string","format":"binary"} |
| 400 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 401 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 403 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 404 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 405 | The method is not allowed on this route. | application/json: ErrorEnvelope |
| 413 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 422 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 429 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 431 | The request has more than 64 headers or more than 32 KiB of header names and values. | application/json: ErrorEnvelope |
| 500 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
| 503 | The one error envelope every backend response uses. | application/json: ErrorEnvelope |
Schemas
AiImageVersion
| Field | Required | Description and type |
|---|---|---|
id | Yes | {"type":"string","pattern":"^aimg_[0-9a-f]{32}$"} |
prompt | Yes | {"type":"string","maxLength":65536} |
aspect_ratio | Yes | {"type":"string","enum":["1:1","1:2","2:1","2:3","3:2","3:4","4:3","4:5","5:4","9:16","16:9","9:19.5","19.5:9","9:20","20:9","9:21","21:9"]} |
status | Yes | {"const":"succeeded"} |
image | Yes | {"type":"object","additionalProperties":false,"required":["reference","width","height"],"properties":{"reference":{"type":"string","pattern":"^asset://asset_[a-f0-9]{32}$"},"width":{"type":"integer","minimum":1,"maximum":7680},"height":{"type":"integer","minimum":1,"maximum":4320}}} |
parent_image_id | Yes | {"type":["string","null"],"pattern":"^aimg_[0-9a-f]{32}$"} |
created_at | Yes | {"type":"string","format":"date-time"} |
Schema rules: {"type":"object","additionalProperties":false}.
AiImageHistory
| Field | Required | Description and type |
|---|---|---|
versions | Yes | {"type":"array","maxItems":100,"items":{"$ref":"#/components/schemas/AiImageVersion"}}. See AiImageVersion |
Schema rules: {"type":"object","additionalProperties":false}.
AiImageCreate
| Field | Required | Description and type |
|---|---|---|
prompt | Yes | At most 65536 UTF-8 bytes. {"type":"string","minLength":1,"maxLength":65536,"pattern":"\\S"} |
aspect_ratio | Yes | {"type":"string","enum":["1:1","1:2","2:1","2:3","3:2","3:4","4:3","4:5","5:4","9:16","16:9","9:19.5","19.5:9","9:20","20:9","9:21","21:9"]} |
proposal_message_id | No | An owned current or applied image suggestion. The customer can edit the suggested prompt and ratio before approval. An existing successful or pending generation is reused only when its prompt and ratio match. {"type":"string","pattern":"^msg_[0-9a-f]{32}$"} |
parent_image_id | No | An owned successful image to regenerate. Cannot be combined with proposal_message_id. {"type":"string","pattern":"^aimg_[0-9a-f]{32}$"} |
Schema rules: {"type":"object","additionalProperties":false,"not":{"required":["parent_image_id","proposal_message_id"]}}.
AiImageGeneration
| Field | Required | Description and type |
|---|---|---|
id | Yes | {"type":"string","pattern":"^aimg_[0-9a-f]{32}$"} |
status | Yes | {"type":"string","enum":["queued","running","succeeded","failed","cancelled"]} |
credits | Yes | {"type":"integer","const":50} |
image | Yes | {"anyOf":[{"type":"object","additionalProperties":false,"required":["reference","width","height"],"properties":{"reference":{"type":"string","pattern":"^asset://asset_[a-f0-9]{32}$"},"width":{"type":"integer","minimum":1,"maximum":7680},"height":{"type":"integer","minimum":1,"maximum":4320}}},{"type":"null"}]} |
failure_code | Yes | {"type":["string","null"]} |
progress | Yes | AiProgress |
Schema rules: {"type":"object","additionalProperties":false}.
UploadedImage
| Field | Required | Description and type |
|---|---|---|
id | Yes | {"type":"string","pattern":"^asset_[a-f0-9]{32}$"} |
reference | Yes | Private template reference. This is not a fetchable URL. {"type":"string","pattern":"^asset://asset_[a-f0-9]{32}$"} |
media_type | Yes | {"type":"string","enum":["image/png","image/jpeg","image/webp"]} |
byte_size | Yes | {"type":"integer","minimum":1,"maximum":10485760} |
width | Yes | Display width after image orientation. {"type":"integer","minimum":1,"maximum":7680} |
height | Yes | Display height after image orientation. {"type":"integer","minimum":1,"maximum":7680} |
Schema rules: {"type":"object","additionalProperties":false}.
Shared errors, headers, and authentication schemes are in shared types and security.