API reference

Image packs

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-packs and help me choose the right thirds.ai endpoint and write a request. Check the fields and credentials in this reference.

Render one saved template version at several sizes, poll each size, retry failed sizes, and download a ZIP of the files that succeeded.

See all API resources or read API keys and requests.

Endpoints

createImagePack

POST /v1/image-packs

Create an image pack

Render one saved template version at every requested size: original for the version's own canvas, a saved size id, a preset slug, or a WxH custom size adapted from the version's original. Creates one normal image job per size. A size that cannot be adapted fails immediately with resize_source_unsupported; the other sizes still run. The ledger reserves one credit per job, settles it on success, and releases it on failure.

Authentication: bearer API key. See authentication.

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

Request body: application/json, ImagePackCreate.

StatusMeaningBody
201The pack was created, or an earlier request with the same idempotency key and body is replayed.application/json: ImagePack
400The one error envelope every backend response uses.application/json: ErrorEnvelope
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
413The one error envelope every backend response uses.application/json: ErrorEnvelope
415The 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

getImagePack

GET /v1/image-packs/{id}

Get an image pack's status

Returns the pack with each member's own state and, once any member has succeeded, a signed archive_url for the ZIP of every succeeded file.

Authentication: bearer API key. See authentication.

ParameterLocationRequiredRule
idpathYes{"type":"string","pattern":"^pack_[0-9a-f]{32}$"}
StatusMeaningBody
200The pack's current status.application/json: ImagePack
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
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

retryImagePack

POST /v1/image-packs/{id}/retry

Retry an image pack's failed members

Creates one new job for every member whose last attempt failed or that never reached a job. A queued, running, or already succeeded member is left untouched.

Authentication: bearer API key. See authentication.

ParameterLocationRequiredRule
idpathYes{"type":"string","pattern":"^pack_[0-9a-f]{32}$"}
StatusMeaningBody
200The pack after retry, with a new job for each member that was retried.application/json: ImagePackRetry
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
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

getImagePackArchive

GET /v1/image-packs/archive/{token}

Download an image pack's ZIP archive

Stream a ZIP of one pack's succeeded members, in requested order with numbered filenames, plus manifest.json recording that order and any failed sizes. The link carries its own authority, so no other credential is read.

Authentication: no credential required.

ParameterLocationRequiredRule
tokenpathYesThe signed archive link. {"type":"string"}
StatusMeaningBody
200The ZIP archive of succeeded members plus manifest.json.application/zip: {"type":"string","format":"binary"}
403The link is genuine but its time is over.application/json: ErrorEnvelope
404The link is not valid, or the pack has no succeeded member to archive.application/json: ErrorEnvelope
405The method is not allowed on this route.application/json: ErrorEnvelope
431The request has more than 64 headers or more than 32 KiB of header names and values.application/json: ErrorEnvelope
500An internal error occurred.application/json: ErrorEnvelope

Schemas

ImagePackCreate

FieldRequiredDescription and type
template_idYesTemplateId
versionNoOmitted to use the template's latest version at creation time. {"type":"integer","minimum":1}
dataNoTemplate data. Each size's own saved data overrides apply over this data. Omitted to use an empty object. {"type":"object"}
formatYes{"type":"string","enum":["png","jpeg","webp"]}
sizesYes1 to 20 different entries: original for the version's own canvas, a saved size id, a preset slug, or a WxH custom size. {"type":"array","items":{"type":"string"},"minItems":1,"maxItems":20}

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

ImagePackMember

FieldRequiredDescription and type
positionYes{"type":"integer","minimum":0}
size_idYes{"type":"string"}
nameYes{"type":"string"}
widthYes{"type":"integer","minimum":1}
heightYes{"type":"integer","minimum":1}
stateYes{"type":"string","enum":["queued","running","succeeded","failed"]}
errorYes{"type":["object","null"],"properties":{"code":{"type":"string"}},"required":["code"],"additionalProperties":false}
download_urlYes{"type":["string","null"]}

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

ImagePack

FieldRequiredDescription and type
idYes{"type":"string","pattern":"^pack_[0-9a-f]{32}$"}
template_idYesTemplateId
versionYes{"type":"integer","minimum":1}
formatYes{"type":"string","enum":["png","jpeg","webp"]}
created_atYes{"type":"string","format":"date-time"}
stateYes{"type":"string","enum":["queued","running","complete","partial","failed"]}
membersYes{"type":"array","items":{"$ref":"#/components/schemas/ImagePackMember"}}ImagePackMember
archive_urlYesA signed ZIP download link, present once any member has succeeded. {"type":["string","null"]}

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

ImagePackRetry

Schema rules: ImagePack.

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.