Guides
Rate limits
How many requests a key may make, and what to do when the answer is 429.
Two different limits#
Do not confuse these. One is about how fast you ask; the other is about how much you send.
| Request rate limit | Monthly sending allowance | |
|---|---|---|
| What it counts | API requests a minute | Emails sent in the calendar month (UTC) |
| Where it is set | On each key, up to 600 a minute | By your plan |
| When you pass it | The request is refused with 429 rate_limited | Recipients are cancelled with the reason quota_exceeded |
| What to do | Wait Retry-After seconds, then repeat | Watch GET /v1/usage |
Request rate#
Each API key has its own limit, counted per minute. The default and the maximum is 600 requests a minute. A key can be created with a lower limit, which suits a key for a batch job that should never starve your main application; the dashboard's create-key form does not offer that yet, so every key you make there has the maximum. A limit per address also applies to all requests from one IP address.
When you pass a limit the answer is 429 Too Many Requests, with the code rate_limited. Nothing was done: the request is refused before it runs, so repeating it is always safe, even a send without an idempotency key.
HTTP/1.1 429 Too Many Requests
Retry-After: 12
RateLimit-Limit: 600
RateLimit-Remaining: 0
Content-Type: application/json
{"error": {"code": "rate_limited", "message": "Too many requests. Please wait a moment and try again.", "request_id": "4f1c2b8e9a3d47e0b6c5a1d2e3f40718"}}| Header | Meaning |
|---|---|
Retry-After | Whole seconds to wait before trying again. |
RateLimit-Limit | How many requests the limit that stopped this one allows. |
RateLimit-Remaining | How many are left. 0 on a 429. |
Stay under the limit#
- Batch your sends.
POST /v1/emails/batchcarries up to 100 messages in one request, so one request does the work of a hundred. See Sending email. - Use webhooks, not polling. Asking for each email's status in a loop spends your limit. A webhook tells you when something happens.
- Respect Retry-After. Retrying at once only makes the wait longer. The libraries wait for you, and give up and raise the error if the wait is more than 60 seconds.
- Give each app its own key, so one busy app does not use up another's limit.
Monthly allowance#
GET /v1/usage (scope email:read) shows this month's sending against your allowance: the emails submitted and sent so far, the monthly_quota your plan includes, what remaining to send (the included emails left, then prepaid credits; never negative) and your credit_balance. The month is a calendar month in UTC; period_start and period_end say exactly which. Test keys use none of it.
curl https://api.cirrusmail.example/v1/usage \
-H "Authorization: Bearer $CIRRUS_API_KEY"When the allowance runs out, recipients are not sent: they are cancelled with the reason quota_exceeded, which you see on the email and in its events. The usage reference lists every field.
If you cannot stay under#
- Check that you are not polling, and that sends are batched.
- Spread bursts out: a queue in front of the API smooths a spike.
- Give the job that needs it its own key, so it has a full limit to itself.