Read the code before retrying
Errors include an English message, stable code, retry information and recovery advice. Validation errors include field paths. HTTP status distinguishes authentication, permissions, invalid input, conflicts, insufficient credits and temporary service failures.
| Status / code | Action |
|---|---|
401 UNAUTHORIZED | Replace an invalid, expired or revoked key |
403 FORBIDDEN | Check your account status and access permissions |
403 INSUFFICIENT_SCOPE | Create a key with the needed scope |
402 INSUFFICIENT_CREDITS | Add credits before an intentional generation |
422 INVALID_PARAMETERS | Fix the indicated fields |
404 INPUT_ASSET_UNAVAILABLE | Check ownership, readiness and upload confirmation |
409 IDEMPOTENCY_CONFLICT | Recover the original body; use a new key only for new work |
409 GENERATION_ALREADY_EXISTS | Query the identified existing task |
| 5xx or lost response | Keep the original request identity and reconcile its task |
Limits
Keys: 30 active, 90-day lifetime. Uploads: PNG/JPEG/WebP up to 20 MiB. Generation limits differ by business and are available in capabilities and the article's parameter table. Batch item counts do not always equal output asset counts.
Protect recovery information
Keep task ID, operation, idempotency key, error code and field errors when diagnosing a failure. Do not place Bearer keys or full private image URLs in public issue reports. A transport error is not proof that generation was never accepted.
