Loading
Loading
Each key can be limited by spend, expiration and model list, so a leaked or test key can’t drain your balance.
In the , set a key’s spend limit for the calendar month. The counter resets on the 1st at 00:00 UTC. Once the key’s spend reaches the limit, its requests get 402 key_limit_reached; the account’s other keys keep working.
A date after which the key stops working: requests get 403 api_key_disabled. Handy for temporary and test keys.
A key can be limited to a set of models. Any other id returns 403 model_not_allowed, and GET /v1/models lists only the allowed ones. Fallbacks respect the list too: models outside it are never substituted.
A key can be disabled and enabled again, or revoked for good. Both return 403 api_key_disabled. Changes in the dashboard apply immediately.
By default, 600 requests per minute per key. Above the limit you get 429 rate_limited with a Retry-After header: the seconds until the current minute ends. The limit protects your balance if a key leaks; if you need more, contact .
Keys start with sk-max-. A key is shown only once when created: we store only its hash and can’t recover it. Replace a lost key with a new one. Create separate keys for different services and environments — they’re easier to limit and revoke.
{ "error": { "message": "This API key has reached its monthly spending limit.", "type": "billing_error", "code": "key_limit_reached", "param": null }}