Errors & Rate Limits
Errors & Rate Limits
The error envelope
Every gateway error uses the same shape:
type is always the literal invalid_request_error — it does not vary by error. Branch on code, not type.
Upstream provider errors — 4xx or 5xx responses from the model provider itself, rather than from admission — are passed through verbatim and may not match this envelope.
Error codes
Retry guidance
- Retryable: 409, 429, 502, 503, 504. For 429, wait the number of seconds named in the message before retrying. For the others, use exponential backoff.
- Not retryable: 400, 401, 402, 404. Retrying without changing the request just reproduces the same error — fix the request (or, for 402, add credit) first.
Rate limits
Rate limiting is per API key, over a fixed 60-second window. During beta the default is 60 requests per minute per key. This value is operator-adjustable at runtime and can change without notice or a deploy.
A rate-limited request returns 429 with a body like this:
There’s no retry-after header on gateway-generated 429s — the wait time is only in the message string. Parse it from there.
Need more throughput than the default allows? Email support@singularityapi.dev.