Rate limits
Per key, and the same for each account across its keys.
- 120
- 2M
- 8
Defaults, over sliding one-minute windows. Yours are under Settings. A key can have its own limits; a key with higher limits raises its account’s to match.
How tokens are counted#
An admitted request counts its estimated prompt plus full max_tokens until it finishes.
Example: a 2,000-token prompt with the default max_tokens counts 10,192 tokens. 2M tokens a minute fit 196 of them, so the limit of 120 requests a minute applies first.
On finish the count is corrected to tokens used. A request refused with 402 or 403 after admission still counts its estimated prompt. A tight max_tokens lets more through.
Default max_tokens: 8,192. Image requests use a slot in flight and count as requests, not tokens.
When you hit a limit#
- 429 rate_limited with
Retry-After: seconds until enough of the window has passed, or 1 for the in-flight limit. - A refused request counts and costs nothing.
- Retry after those seconds; back off if it repeats.
Models and balance#
GET /v1/models and /v1/credits have their own per-key limit: 60 a minute, 4 in flight. Not counted above.
Other 429s#
- Requests in progress. Capped per address, and request bodies at once per key, account and address (large ones far fewer): 429 with
Retry-After: 1. - Content check time. More text per minute than the check can read: 429 until the minute ends.
- All capacity in use. The request waits briefly for a slot, then gets 429 with
Retry-After: 5. - Invalid keys. After 60 unknown-key requests from one address in a minute, further unseen keys from it get 429 until the minute passes. Valid keys in use keep working.