Usage, rate limits & budgets
Every key carries limits that the gateway checks before a call reaches a model, not after:
| Field | Default | Enforced? |
|---|---|---|
requests_per_minute | 120 | Yes, a full bucket returns 429 rate_limit_exceeded |
monthly_token_budget | 5,000,000 (0 = unlimited) | Yes, a project at or over budget returns 429 budget_exceeded |
tokens_per_minute | 200,000 | Stored on the key, not currently wired into admission, treat it as reserved for a future check, not a live throttle |
Both enforced limits are evaluated before the request is sent upstream, so a rejected call never spends a model’s time or a project’s token budget.
Context window
Requests are also checked against a context window before dispatch, by
default 4096 tokens, estimated at roughly 4 characters per token. A prompt
(or, for threads, the system block plus transcript) that would exceed the
window is rejected with 400 context_length_exceeded rather than sent
upstream to fail there. See Errors for the exact message
shapes.
Scoping limits per key
Override any of these when minting a key (see Authentication & API keys):
{
"requests_per_minute": 60,
"monthly_token_budget": 1000000
} Omit a field to fall back to the gateway-wide default above.