Image assets

Upload or generate private images for your templates, read prompt history, and check file limits.

Use with your agent

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.

ParameterLocationRequiredRule
idpathYes{"type":"string","pattern":"^asset_[0-9a-f]{32}$"}
StatusMeaningBody
200Read private generated image history.application/json: AiImageHistory
401The one error envelope every backend response uses.application/json: ErrorEnvelope
403The authenticated account is suspended. The code is account_suspended.application/json: ErrorEnvelope
404The one error envelope every backend response uses.application/json: ErrorEnvelope
405The method is not allowed on this route.application/json: ErrorEnvelope
409The one error envelope every backend response uses.application/json: ErrorEnvelope
431The request has more than 64 headers or more than 32 KiB of header names and values.application/json: ErrorEnvelope
500The 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.

ParameterLocationRequiredRule
Idempotency-KeyheaderYes{"type":"string","minLength":1,"maxLength":255,"pattern":"^[ -~]+$"}

Request body: application/json, AiImageCreate.

StatusMeaningBody
202The image request was accepted or replayed.application/json: AiImageGeneration
400The one error envelope every backend response uses.application/json: ErrorEnvelope
401The one error envelope every backend response uses.application/json: ErrorEnvelope
402The one error envelope every backend response uses.application/json: ErrorEnvelope
403The authenticated account is suspended. The code is account_suspended.application/json: ErrorEnvelope
404The one error envelope every backend response uses.application/json: ErrorEnvelope
405The method is not allowed on this route.application/json: ErrorEnvelope
409The one error envelope every backend response uses.application/json: ErrorEnvelope
413The one error envelope every backend response uses.application/json: ErrorEnvelope
422The one error envelope every backend response uses.application/json: ErrorEnvelope
429The one error envelope every backend response uses.application/json: ErrorEnvelope
431The request has more than 64 headers or more than 32 KiB of header names and values.application/json: ErrorEnvelope
500The one error envelope every backend response uses.application/json: ErrorEnvelope
503The 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.

ParameterLocationRequiredRule
idpathYes{"type":"string","pattern":"^aimg_[0-9a-f]{32}$"}
StatusMeaningBody
200The current image state and its saved asset, when ready.application/json: AiImageGeneration
400The one error envelope every backend response uses.application/json: ErrorEnvelope
401The one error envelope every backend response uses.application/json: ErrorEnvelope
402The one error envelope every backend response uses.application/json: ErrorEnvelope
403The authenticated account is suspended. The code is account_suspended.application/json: ErrorEnvelope
404The one error envelope every backend response uses.application/json: ErrorEnvelope
405The method is not allowed on this route.application/json: ErrorEnvelope
409The one error envelope every backend response uses.application/json: ErrorEnvelope
413The one error envelope every backend response uses.application/json: ErrorEnvelope
422The one error envelope every backend response uses.application/json: ErrorEnvelope
429The one error envelope every backend response uses.application/json: ErrorEnvelope
431The request has more than 64 headers or more than 32 KiB of header names and values.application/json: ErrorEnvelope
500The one error envelope every backend response uses.application/json: ErrorEnvelope
503The 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.

ParameterLocationRequiredRule
idpathYes{"type":"string","pattern":"^aimg_[0-9a-f]{32}$"}
StatusMeaningBody
200The current image state and its saved asset, when ready.application/json: AiImageGeneration
400The one error envelope every backend response uses.application/json: ErrorEnvelope
401The one error envelope every backend response uses.application/json: ErrorEnvelope
402The one error envelope every backend response uses.application/json: ErrorEnvelope
403The authenticated account is suspended. The code is account_suspended.application/json: ErrorEnvelope
404The one error envelope every backend response uses.application/json: ErrorEnvelope
405The method is not allowed on this route.application/json: ErrorEnvelope
409The one error envelope every backend response uses.application/json: ErrorEnvelope
413The one error envelope every backend response uses.application/json: ErrorEnvelope
422The one error envelope every backend response uses.application/json: ErrorEnvelope
429The one error envelope every backend response uses.application/json: ErrorEnvelope
431The request has more than 64 headers or more than 32 KiB of header names and values.application/json: ErrorEnvelope
500The one error envelope every backend response uses.application/json: ErrorEnvelope
503The 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}.

StatusMeaningBody
200The 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"}
400The one error envelope every backend response uses.application/json: ErrorEnvelope
401The one error envelope every backend response uses.application/json: ErrorEnvelope
403The one error envelope every backend response uses.application/json: ErrorEnvelope
405The method is not allowed on this route.application/json: ErrorEnvelope
413The one error envelope every backend response uses.application/json: ErrorEnvelope
422The one error envelope every backend response uses.application/json: ErrorEnvelope
429The one error envelope every backend response uses.application/json: ErrorEnvelope
431The request has more than 64 headers or more than 32 KiB of header names and values.application/json: ErrorEnvelope
500The one error envelope every backend response uses.application/json: ErrorEnvelope
503The 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"}.

StatusMeaningBody
201The image is stored.application/json: UploadedImage
400The one error envelope every backend response uses.application/json: ErrorEnvelope
401The one error envelope every backend response uses.application/json: ErrorEnvelope
403The one error envelope every backend response uses.application/json: ErrorEnvelope
404The one error envelope every backend response uses.application/json: ErrorEnvelope
405The method is not allowed on this route.application/json: ErrorEnvelope
413The one error envelope every backend response uses.application/json: ErrorEnvelope
422The one error envelope every backend response uses.application/json: ErrorEnvelope
429The one error envelope every backend response uses.application/json: ErrorEnvelope
431The request has more than 64 headers or more than 32 KiB of header names and values.application/json: ErrorEnvelope
500The one error envelope every backend response uses.application/json: ErrorEnvelope
503The 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.

ParameterLocationRequiredRule
idpathYes{"type":"string","pattern":"^asset_[a-f0-9]{32}$"}
StatusMeaningBody
200The 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"}
400The one error envelope every backend response uses.application/json: ErrorEnvelope
401The one error envelope every backend response uses.application/json: ErrorEnvelope
403The one error envelope every backend response uses.application/json: ErrorEnvelope
404The one error envelope every backend response uses.application/json: ErrorEnvelope
405The method is not allowed on this route.application/json: ErrorEnvelope
413The one error envelope every backend response uses.application/json: ErrorEnvelope
422The one error envelope every backend response uses.application/json: ErrorEnvelope
429The one error envelope every backend response uses.application/json: ErrorEnvelope
431The request has more than 64 headers or more than 32 KiB of header names and values.application/json: ErrorEnvelope
500The one error envelope every backend response uses.application/json: ErrorEnvelope
503The one error envelope every backend response uses.application/json: ErrorEnvelope

Schemas

AiImageVersion

FieldRequiredDescription and type
idYes{"type":"string","pattern":"^aimg_[0-9a-f]{32}$"}
promptYes{"type":"string","maxLength":65536}
aspect_ratioYes{"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"]}
statusYes{"const":"succeeded"}
imageYes{"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_idYes{"type":["string","null"],"pattern":"^aimg_[0-9a-f]{32}$"}
created_atYes{"type":"string","format":"date-time"}

Schema rules: {"type":"object","additionalProperties":false}.

AiImageHistory

FieldRequiredDescription and type
versionsYes{"type":"array","maxItems":100,"items":{"$ref":"#/components/schemas/AiImageVersion"}}. See AiImageVersion

Schema rules: {"type":"object","additionalProperties":false}.

AiImageCreate

FieldRequiredDescription and type
promptYesAt most 65536 UTF-8 bytes. {"type":"string","minLength":1,"maxLength":65536,"pattern":"\\S"}
aspect_ratioYes{"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_idNoAn 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_idNoAn 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

FieldRequiredDescription and type
idYes{"type":"string","pattern":"^aimg_[0-9a-f]{32}$"}
statusYes{"type":"string","enum":["queued","running","succeeded","failed","cancelled"]}
creditsYes{"type":"integer","const":50}
imageYes{"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_codeYes{"type":["string","null"]}
progressYesAiProgress

Schema rules: {"type":"object","additionalProperties":false}.

UploadedImage

FieldRequiredDescription and type
idYes{"type":"string","pattern":"^asset_[a-f0-9]{32}$"}
referenceYesPrivate template reference. This is not a fetchable URL. {"type":"string","pattern":"^asset://asset_[a-f0-9]{32}$"}
media_typeYes{"type":"string","enum":["image/png","image/jpeg","image/webp"]}
byte_sizeYes{"type":"integer","minimum":1,"maximum":10485760}
widthYesDisplay width after image orientation. {"type":"integer","minimum":1,"maximum":7680}
heightYesDisplay 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.

Ready to make your first file?

Start in the playground with a gallery template, or get an API key and send your first request from your own terminal.