Rate limits
The buckets, their limits and the headers.
Requests are counted in buckets. Authenticated buckets are counted per project and environment, so a load test in test mode never slows your live checkout, and one project can't use up another's allowance.
| Bucket | Covers | Counted per | Requests per minute |
|---|---|---|---|
ip | Every request to the API host, before the key is checked | client IP address | 600 |
api | Every authenticated request | project and environment | 120 |
charges | POST /v1/payments and POST /v1/payment-instruments/{id}/charges | project and environment | 30 |
A request counts against every bucket that covers it: a charge counts in ip, api and
charges.
How the limit refills
Each bucket is a token bucket: you may burst up to the limit at once, and capacity comes back steadily. With 120 a minute, a client that sent 120 requests in a few seconds may send the next one about half a second later.
Headers
Every answer on an authenticated route carries the state of its most specific bucket:
| Header | Meaning |
|---|---|
RateLimit-Limit | Requests per minute in the bucket |
RateLimit-Remaining | Requests you may send right now |
RateLimit-Reset | Seconds until the bucket is full again |
Over the limit, the answer is 429 with type rate_limit_error, code rate_limited,
Retry-After (seconds to wait before the next request is allowed) and the three headers
above, with RateLimit-Remaining: 0.
Handling a 429
Wait Retry-After seconds and retry. Nothing ran: a 429 never charges and never uses up an
Idempotency-Key, so retry with the same key.