Rate limits
Requests are limited to 60 a minute per API key.
How the limit works
- The limit is 60 a minute, counted over a sliding window, so room comes back gradually.
- Each API key has its own window, while the monthly limit is shared across your account.
- Every
/v1request with a valid key counts, including polls and usage checks. - A request rejected with
invalid_api_keydoesn't count. Neither does fetching the published API spec, which needs no key.
The headers
Responses to a request with a valid key carry these headers:
| Header | Meaning |
|---|---|
RateLimit-Limit | The requests allowed in the window. |
RateLimit-Remaining | The requests left in the window. |
RateLimit-Reset | Seconds until the window resets. |
Retry-After | Seconds to wait. Only present on a 429 with rate_limited. |
When you go over
A request over the limit runs nothing, doesn't use your monthly limit, and gets a 429 with the code rate_limited:
JSON
{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded",
"request_id": "REQUEST_ID",
"doc_url": "DOC_URL"
}
}- Wait the number of seconds in
Retry-After, then try again. If you get another429, wait again. - Watch
RateLimit-Remainingto slow down before you reach the limit. - Leave a few seconds between polls, or use Webhooks to be told when a job finishes.
POST /v1/batch can also return rate_limited when your account has too much queued work. See Batch.