Limits
The router checks request size and structure before it calls the model. A request that is too large returns 413; a request with an invalid structure returns 422 with the code validation_error.
Request size
Section titled “Request size”| Limit | Value | Code when exceeded |
|---|---|---|
| Whole request body | 100 MB | payload_too_large |
| One inline file (image, PDF), original size before base64 | 50 MB | file_too_large |
All text in the request: messages, system prompt, tool descriptions, input on /v1/embeddings, state and questions on /v1/systemone | 15 MB | text_content_too_large |
The model also limits context size: see context_length and max_completion_tokens in the catalog. Input that does not fit in the model’s context window returns 400 with the code provider_context_length_exceeded.
Request structure
Section titled “Request structure”| Limit | Value |
|---|---|
| Model ID length | 200 characters |
Messages per request (input items on /v1/responses) | up to 100,000 |
Tools (tools) per request | up to 10,000 |
input items on /v1/embeddings | up to 2048 |
Nesting depth of state, instructions, and option descriptions on /v1/systemone | up to 64 levels |
How many tools a specific model accepts is up to its provider, and that number may be lower. When the provider rejects the request, the router returns its own code, such as provider_bad_request; the reason may be given in message.
Response time
Section titled “Response time”A non-streaming response must arrive within 5 minutes. For long generations, use "stream": true. Web search has a budget of 240 seconds. Without streaming, running out of it returns 408 provider_timeout; in a stream, the budget is checked between steps and may end the response as incomplete.
Request rate
Section titled “Request rate”There is no fixed requests-per-second limit per key. The two 429 codes call for different handling:
| Code | What happened | What to do |
|---|---|---|
provider_rate_limited | The model limited the request rate | Retry with a delay. Under sustained load, spread it across several models |
api_key_limit_exceeded | The key’s spending limit for the period is used up. extra.reset_at holds the time the counter resets (UTC, ISO 8601) | Wait for the reset, raise the key’s limit, or use another key |
Under peak load, the router responds with 503, the code service_unavailable, and a Retry-After header.
Retries
Section titled “Retries”- Retry only transient failures:
408,429,500,502,503. Other4xxcodes are request errors, and a retry returns the same response. Withapi_key_limit_exceeded, retrying beforeextra.reset_atis pointless too. - Use exponential backoff with jitter. When every client retries at the same moment, they create a second wave of load; random jitter added to the delay spreads it out.
- Respect
Retry-After. If the header is present, wait at least that long before retrying. - Cap the number of attempts, for example at three. After that, return the error to your own client.
- A dropped connection does not cancel generation. An interrupted stream is billed in full; see Tokens and usage. A retry after the drop is billed again.
For the full list of codes and error formats, see Errors.