Error Response Format
All errors follow a consistent format:HTTP Status Codes
| Code | Error | Description |
|---|---|---|
400 | bad_request | Invalid parameters or missing required fields |
401 | not_authenticated | Missing or invalid Authorization header |
401 | token_expired | Access token has expired — refresh it |
402 | insufficient_tokens | Your token balance is zero |
403 | insufficient_plan | Feature requires a higher subscription |
404 | not_found | Generation ID or model not found |
422 | validation_error | Request body fails schema validation |
429 | rate_limit_exceeded | Too many requests — see rate limits |
500 | provider_error | Upstream AI provider returned an error |
503 | model_unavailable | Model is temporarily down |
Common Errors
401 — Token expired
Access tokens expire after 15 minutes. Refresh automatically:402 — Insufficient tokens
429 — Rate limit exceeded
500 — Provider error
Upstream AI providers occasionally fail. Tokens are never charged on provider errors.Retry Logic
Validation Errors
For422 errors, the response includes field-level details:

