400 | Invalid request - a validation failure (for example a missing prompt, one over 2,000 characters, or a reference image that is not a supported HTTPS or data URL), an unknown parentAssetId, or a malformed Idempotency-Key. | Fix the request. The message array names each failed constraint. |
401 | Missing, invalid, or revoked API key. | Check the Authorization header and the key’s status in the dashboard. |
402 | The workspace cannot be charged: it is out of credits ("Out of credits - add credits from the billing page to continue.") or a payment on it is under dispute (generation is paused until the dispute is resolved). | Add credits in the dashboard billing page, then retry; for a dispute, contact support. |
403 | The model the request names (model), or the one the workspace is set to, is not available to it (code is model_unavailable). Nothing was charged. | For a named model, pick one from GET /v1/models; otherwise do not retry, contact support. |
409 | A request with the same Idempotency-Key is still in progress. | Wait for the original to finish, then retry the same key to receive its stored result. |
422 | The Idempotency-Key was already used with a different request body (code is idempotency_key_reused), or the workspace’s model does not take what was sent: an edit (parentAssetId), more reference images than it takes (some take none), or (on models that need one) no prompt (code is model_input_unsupported). A model’s capabilities in GET /v1/models list what it takes. Nothing was charged. | Send the new request under a new key; for model_input_unsupported, drop what the model does not take. |
429 | Rate limit exceeded - per-key or per-workspace, per minute or (for a workspace with a per-second limit) per second. Or, for a workspace with a concurrency limit, that many generations are already in progress (code is concurrency_limit_exceeded, limit is the number; Retry-After: 1). Nothing was charged. | Wait the number of seconds in the Retry-After header, then retry. For concurrency_limit_exceeded, a place frees as soon as one of the generations in progress ends. |
503 | Not right now: the billing row is busy under a burst of concurrent generations. Nothing was charged. | Wait the seconds in Retry-After, then retry with the same key. |
5xx | Anything else failed on our side. | Retry with backoff, reusing the same Idempotency-Key so a request that did complete is not billed twice. |