> ## Documentation Index
> Fetch the complete documentation index at: https://relay-demo.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Rate limits

> How many requests you can send, and what to do when you hit the limit.

Relay limits requests per API key with a token bucket. Each key has a bucket that refills at a steady rate; each request takes one token. A full bucket lets you send a short burst above the steady rate.

| Endpoint | Steady rate | Burst |
| - | - | - |
| `POST /v1/events` | 100 requests per second | 200 |
| `POST /v1/events/batch` (up to 100 events each) | 10 requests per second | 20 |
| Everything else | 25 requests per second | 50 |

Test keys have a tenth of these limits.

![Token bucket for one API key on POST /v1/events: 300 requests arrive at once against a full 200-token bucket; 200 are accepted with 202 and 100 are rejected with 429 Too Many Requests and Retry-After: 1, with nothing stored. One second later the bucket has refilled 100 tokens and the same 100 requests are resent with the same Idempotency-Keys and accepted. Every response carries RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset.](https://mintcdn.com/relay-demo/EZNTzLZZIWlaFK8l/images/rate-limit-bucket.png?fit=max\&auto=format\&n=EZNTzLZZIWlaFK8l\&q=85\&s=540ecf2a4287c1aad7272262499d816b)

A full bucket takes a burst of 200 events. The rest get 429 and go through a second later, once the bucket has refilled.

## Headers

Every response says where you are:

| Header | Meaning |
| - | - |
| `RateLimit-Limit` | The steady rate for this endpoint, per second. |
| `RateLimit-Remaining` | Tokens left in the bucket. |
| `RateLimit-Reset` | Seconds until the bucket is full again. |

## When you hit the limit

An empty bucket answers `429 Too Many Requests` with a `Retry-After` header in seconds. Nothing is stored. Wait that long, then send the request again with the same `Idempotency-Key`. The SDK does this for you, up to three times.

If you regularly send more than 100 events per second, use `POST /v1/events/batch`: one request carries up to 100 events and takes one token.

## Delivery to your endpoints

Rate limits apply to requests you send Relay. Deliveries to your endpoints are limited separately: by default, Relay keeps at most 10 requests in flight to each endpoint. Change it per endpoint in the dashboard if your server can take more, or less.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.