> ## Documentation Index
> Fetch the complete documentation index at: https://docs.saasybill.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Rate limits

> Each API key can make 120 requests a minute

Each API key can make **120 requests in any 60 seconds**. The limit exists to stop a runaway integration, not to meter a busy one.

***

## How the limit works

* The limit is per key, not per organisation. Two keys each get 120 a minute.
* It is a sliding window. A request stops counting exactly 60 seconds after it was made.
* Every authenticated request counts, whether it succeeds, fails or is refused with `429`. Retrying straight away while limited keeps you limited.
* A burst of requests sent at the same moment can overshoot the limit slightly.

***

## Rate limit headers

Every response reports where you stand.

| Header | Description |
| - | - |
| `RateLimit-Limit` | The limit: `120`. |
| `RateLimit-Remaining` | Requests you can still make in the current window. |
| `RateLimit-Reset` | Seconds until the oldest counted request stops counting. |

```text theme={null}
RateLimit-Limit: 120
RateLimit-Remaining: 117
RateLimit-Reset: 41
```

***

## When you are limited

The API answers `429` with a `Retry-After` header in seconds.

```json theme={null}
{
  "error": {
    "type": "rate_limit_error",
    "code": "rate_limited",
    "message": "Too many requests. Try again in 12 seconds.",
    "request_id": "req_4f1a9c2e7b8d3a605e1c9f02"
  }
}
```

Wait for `Retry-After` seconds, then send the request again. A rate-limited request is refused before anything happens, so it's safe to retry.

***

## Stay under the limit

<CardGroup cols={2}>
  <Card title="Cache the catalogue" icon="database">
    Plans and charges change rarely. Read them once and refresh on a schedule.
  </Card>

  <Card title="Use webhooks, not polling" icon="bell">
    Don't poll invoices to see if they were paid. [Webhooks](/api-reference/webhooks/overview) tell you.
  </Card>

  <Card title="Filter your lists" icon="filter">
    Use `customer_code`, `status` and `subscription` filters instead of paging through everything.
  </Card>

  <Card title="Page in 100s" icon="list">
    Set `limit=100` on large lists to use fewer requests.
  </Card>
</CardGroup>
