Limits
How many requests an account can send, and how big they can be.
The limits count all of an account's keys together. They are the same for every account.
| Limit | Value | Past it |
|---|---|---|
| Requests running at once | 50 | 429, code too_many_running_requests |
| Requests running at once, balance under $25 | One per $0.5 of balance, at least 2 | 429, code low_balance_running_limit |
| Requests started per minute | 300 | 429 |
| Requests answered per minute | 120 | 429 |
| Size of one request | 32 MB | 413, code request_too_large |
| Request data of all running requests | 64 MB | 429, code too_much_request_data |
| Compressed requests (Content-Encoding) | Not accepted | 415 |
After a 429, wait a couple of seconds and try again: a slot frees as soon as a running request finishes. The official SDKs retry by themselves.
A request runs to its end even if you disconnect, streamed or not, and is billed in full. It keeps its slot until it has finished.
Errors from a model's provider
When a model's provider fails, the API answers 502 with the code provider_error, or 429 with provider_rate_limited when it is overloaded. Neither is charged. Try again shortly; the official SDKs do so by themselves.
Not supported
WebSocket connections answer 400 with the code websocket_not_supported: ask for a streamed answer over HTTP instead. GPT models take OpenAI's formats only (/v1/responses and /v1/chat/completions); in Gemini's format they answer 404.
Balance
A request is refused with 403 and the code insufficient_user_quota when the balance can't cover it; the message says where to top up. The cost of a request's input is set aside before it runs, so a nearly empty balance can refuse a large request while small ones still pass. When the balance runs low the console warns you, and you get an email, or a message from our bot if you signed in with Telegram.
Limits of your own
Each key can have a spending limit, a list of allowed models, allowed IP addresses and an expiry date: set them when you create the key in Console → API keys. The models and addresses can be changed later. A key that has used up its spending limit answers 403 with the code key_limit_reached.