Errors
The error shape and what to do about each.
Every error has one shape:
{"error": {"type": "invalid_request", "message": "seed is a whole number from 0 to 2147483647.", "field": "seed", "retry_after_s": null}}field names the field at fault. When retry_after_s is set, a Retry-After header carries it too. Each endpoint's page in the API reference lists the statuses it can answer.
| Status | Type | Meaning | What to do |
|---|---|---|---|
| 400 | invalid_request | A field, header or parameter is missing, out of range or not taken. | Fix the request. field names it. |
| 400 | invalid_request | steps: send steps or mode, not both. (field: steps): the request sent steps with a mode other than auto. | Send only one: steps to set the count yourself, or mode. |
| 400 | invalid_request | A mode the model or shape can't take (field: mode): detail on text to image, detail on an edit that isn't 16:9 or 9:16 at 1K, or a mode the model doesn't list. | Pick a mode from the model's modes in GET /v1/models, or change the shape. |
| 401 | unauthenticated | No key, or it is wrong, disabled, expired or revoked. | Check the key on API keys. |
| 402 | insufficient_credit | Your credit doesn't cover the image, or (Live Avatar) you have less than a minute of credit for a shared session, or less than 30 minutes ($0.53) for a machine of your own. | Add credit on Billing, then retry. |
| 402 | spend_limit_reached | This month's spend (UTC) reached your monthly spend limit: your tier's cap or the lower cap you set. See Rate limits and tiers. | Raise your own cap or request an increase on Limits, then retry. |
| 403 | forbidden | An upload or file link that is altered or expired. | Start a new upload, or get the generation again. |
| 403 | not_available | Live Avatar is off for now in both modes, and not in the API. | None until it is open. |
| 404 | not_found | No such generation, upload, file or live session for your account. An upload is deleted when the run that uses it ends. | Check the id. Upload the image again for each edit. |
| 405 | method_not_allowed | The endpoint does not take that method. | Use the method in the reference. |
| 409 | idempotency_conflict | The Idempotency-Key was used for a different body. | Use a new key for a new image. |
| 409 | already_uploaded | The upload already has its file. | Start a new upload. |
| 409 | live_session_active | Your account already has a provisioning, queued, ready or live Live Avatar session. | End it or let it finish first. |
| 410 | file_expired | The image behind an image_url was deleted: after its first download, or 10 minutes after the run if nobody downloaded it. The generation still shows its details, with result.expired: true. | Download each image when its run is done. Run it again for a new image. |
| 413 | file_too_large | The file is over 7 MiB, or an edit's images together are. | Send a smaller image. |
| 415 | unsupported_file | Not a JPEG, PNG or WebP image, whether from a link, a data URL or an upload. | Send another format. |
| 422 | image_unreachable | The image at a link could not be read (the message names the HTTP status). An earlier generation's image_url answers 403 once its link has expired, and 410 once its image is deleted. | Check the link is public https, or send the image as a data URL. |
| 422 | asset_not_ready | The upload's file hasn't arrived. | PUT the file to upload_url first. |
| 429 | queue_full | The line for Live Avatar's shared machines is full. | Retry after retry_after_s. |
| 429 | rate_limited | Too many requests: more runs at once than your tier allows (retry_after_s 5), more new images in the last 60 seconds than your tier allows (retry_after_s is the seconds until the oldest leaves that minute), or 20 failed sign-ins or wrong keys a minute from one address. See Rate limits and tiers. | Retry after retry_after_s, for an image with the same Idempotency-Key. |
| 500 | internal_error | Something went wrong on our side. | Retry. |
| 503 | unavailable | A run couldn't be handed to a GPU worker, Live Avatar couldn't start, or no Live Avatar machine of your own could be started. | Retry after retry_after_s (for an image, with the same Idempotency-Key). Nothing is charged. |
Failed generations
A generation that starts but can't finish ends with status: "failed" and an error object (type, message). It costs nothing. Run it again (for real_person, change the prompt first).
| Type | Meaning |
|---|---|
model_error | The model couldn't make the image. |
timed_out | The run didn't finish in time, or it waited 20 minutes for a GPU worker. |
node_lost | The GPU running it stopped answering partway. |
expired | The run's result expired before it was read. |
background_removal_failed | An edit with transparent_background was made, but its background couldn't be removed. |
bad_output | The model's files couldn't be stored (more than 8 files, or over 40 MiB together), or the GPU that took a camera angle or inpaint run couldn't run that model yet. |
real_person | The prompt asks for an image of a real, identifiable person. TensorFactory doesn't make those. The request is accepted with 202, then the run fails within a few seconds, and no image is given out. Describe a fictional person instead. |
A 503 unavailable on POST /v1/generations means no run was started. While every worker is busy or still starting, runs are accepted and wait instead. Retry with the same Idempotency-Key, so a request that did get through is not made twice.
Download an image GET
The finished image behind `result.image_url`. You never build this link yourself: take it from the generation. It is signed and needs no key. Download it when the run is done: it is deleted after the first download, or 10 minutes after the run if nobody downloads it. A HEAD request or a download cut short doesn't count.
Limits
Sizes, lengths, steps and how runs wait for a GPU.