Errors & Troubleshooting
Use this page when a request fails or behaves unexpectedly. Endpoint reference pages document per-field validation; this page explains what failed, how to fix it, and how to retry safely.
Error response shape
Most REST errors return JSON:
402 is a wallet problem, 429 is a “not now” problem. An empty credit balance returns 402 with insufficient_quota_error and the message No credits available. Rate limits, model capacity and seat budgets return 429, with four different codes behind it that need different responses — see Rate limits and capacity below. Adding credits clears a 402 immediately; only some 429s clear by waiting.
Some endpoints add their own codes for product-specific rules, for example Document Digitization returns invalid_request_error (400) when a file exceeds the 10-page limit. These are listed in the “Errors” section of each API guide.
Auth failures use HTTP 403, not 401. Treat 403 with invalid_api_key_error as an authentication problem. See Authentication.
HTTP status quick reference
Out of credits (402)
A 402 means the organisation’s credit balance is empty, not that you are being rate limited. The balance is shared by every workspace, API key and product, so a 402 from one service means the whole organisation is out of credits.
To recover:
- Add credits on Settings → Billing. See Billing & payments.
- Turn on Auto-Recharge so a low balance tops up before production traffic stops.
- Retry the failed request once credits land. No key rotation or redeploy is needed.
Do not put 402 in your exponential-backoff retry set. It will not clear on its own, and retrying only burns your own request budget.
Rate limits and capacity (429)
Every 429 says “not now”, but four different codes sit behind it and they need different responses:
Only the first is your own quota. Treating all four as “rate limited, back off” leaves an exhausted seat budget looking like a temporary blip.
SDK handling (Python)
SDK handling (JavaScript)
Retry with exponential backoff
Use retries only for 429, 500, 502 and 503: not for 400, 402, 403 or 422. A 402 needs credits, not another attempt, and a 429 carrying seat_budget_exhausted_error needs a top-up rather than a backoff.
Common pitfalls
Support workflow
- Note timestamp, endpoint, and
error.codefrom the response body. - Reproduce with curl or SDK using the smallest failing request.
- Check API Status for incidents.
- Contact support via Talk to us with request ID if available.