Daily limits
Every metered key has two independent daily caps, reset at midnight UTC:| Limit | Default | Behavior when hit |
|---|---|---|
| Requests per day | 10,000 | 429 with code: "daily_request_limit" |
| Spend per day | $50.00 | 429 with code: "daily_spend_limit" |
max_tokens may not exceed the model’s context length.
Error envelope
Errors follow the OpenAI format, so existing SDK error handling works:limit object appears only on 429 responses — cap is the configured cap (requests, or spend in micro-USD).
Status codes
| Status | Type | When |
|---|---|---|
400 | invalid_request_error | Malformed JSON, unknown model, invalid parameters |
401 | authentication_error / invalid_api_key | Missing, invalid, or revoked key |
402 | payment required | No key and no valid x402 payment — response carries the payment challenge |
429 | rate_limit_error | Daily request or spend cap reached (see above) |
5xx | server_error / upstream | Upstream model failure or gateway error — any reserved hold is released, nothing is billed |
Handling failures
- Retries:
5xxresponses are safe to retry — failed calls are never charged. Use exponential backoff; don’t retry400/401. 429: back off until midnight UTC or switch to a cheaper model; thelimitobject tells you which cap you hit.- Support: every response includes an
X-Request-Idheader. Include it in any report — we can trace the exact request.