Errors & Rate Limits
Error Codes
| HTTP | Meaning | Fix |
|---|---|---|
| 400 | Bad request | Check body, model ID |
| 401 | Auth failed | Check key |
| 402 | Insufficient balance | Top up in the Console; service resumes at once |
| 403 | Forbidden or account suspended | Check the key and the account status |
| 404 | Not found | Check URL suffix, model ID |
| 429 | Rate limited | Wait per X-RateLimit-Reset-Requests |
| 500 | Server error | Retry with backoff |
Common 400s
STREAMING_UNPROVEN: drop stream: true or switch model.
Model not found: copy exact ID from catalog.
Missing max_tokens (Anthropic): add "max_tokens": 256.
Retry
Retryable: 429 (wait), 500 (backoff 1s→2s→4s), network drops. Non-retryable: 400, 401, 404.
Rate limits
| Header | Meaning |
|---|---|
X-RateLimit-Limit-Requests | Maximum requests per minute |
X-RateLimit-Remaining-Requests | Requests left in this window |
X-RateLimit-Reset-Requests | Time until reset, formatted like 850ms or 1s |
RateLimit-Limit, RateLimit-Remaining | The same limit in the IETF standard headers |
RateLimit-Reset | Seconds until reset, as an integer |
Next steps
- Guides: Pick a call style by task: streaming, tools, structured output.
- Model catalog: Limits vary by model; check a model’s context and output caps.
- Quotas and rate limits: Account-level quotas and limits.