Requests per minute
Each API key has a limit on requests per minute. Non-streaming responses to requests that pass the key check include headers with the current status (streaming responses do not):
| Header | Meaning |
|---|---|
x-ratelimit-limit-requests |
Maximum requests per minute for the key |
x-ratelimit-remaining-requests |
Requests left in the current minute |
x-ratelimit-reset-requests |
Time until the counter resets (e.g. 12s) |
Going over the limit returns 429 with Retry-After (seconds to wait). If you need a higher limit, contact support.
Balance and holds
Before calling a model, we hold an estimated amount (never less than the minimum charge per request), based on:
- input tokens (estimated on the high side from the request size);
- and maximum output tokens: the
max_tokens(ormax_completion_tokens) you send, capped at the model's maximum. If you send neither, a default is used.
When the request finishes, we charge the actual usage and release the rest of the hold.
- Your balance must be above 0. The hold may exceed your balance slightly (so long answers are not cut off), so your balance can go slightly negative after a request. Beyond that margin you get a
402error "Your balance is too low for this request…". - Tip: when your balance is low, set
max_tokensto what you actually need so the hold is smaller. - The Request history page in the dashboard shows the cost of each request as it happens.
Other limits
- Request body: up to 20 MB.
- Each request runs for up to 15 minutes.
GET /v1/modelsandPOST /v1/messages/count_tokensare free.