Error codes and rate limits
Last updated:
On this page
Error codes
| Code | Description |
|---|---|
| 400 | Invalid request — e.g. prompt + max_tokens exceeds the model's context window |
| 401 | Invalid or missing API key |
| 429 | Token limit exceeded or all slots busy |
| 503 | Model temporarily unavailable |
A 429 response includes details about the window and when quota is reclaimed,
plus a Retry-After header:
json
{
"detail": {
"message": "Daily token limit exceeded",
"window": "daily",
"tokens_used": 250000,
"tokens_limit": 250000,
"retry_after_seconds": 3600,
"reset_at": "2026-08-30T00:00:00+00:00"
}
}Handle 429 and 503 with backoff
Both are transient. Respect the Retry-After header (or
retry_after_seconds) and retry — for 429, quota is continuously reclaimed
(rolling hourly windows) or resets at midnight UTC (daily limits), see
Plans and quotas.
Rate limit headers
Every response includes headers showing your current token usage:
| Header | Description |
|---|---|
| X-RateLimit-Limit-Tokens | Token limit for the period |
| X-RateLimit-Used-Tokens | Tokens used |
| X-RateLimit-Remaining-Tokens | Tokens remaining |
Token warnings
- At 80% of the quota a
warningfield is included in the API response - At 90% a warning email is sent (max one per day)
Track your consumption in real time via GET /v1/usage or in the
dashboard.