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

# Rate limits and 429

> The API's request limit and how to avoid a block.

The API accepts up to **5 requests per second per installation**. Go over it and the installation is **blocked for 10 minutes**.

## How it works

* **The limit is per installation, not per key.** All keys of an installation share one budget. Creating more keys doesn't raise the limit.
* **The sixth request within the same second** answers `429` and starts the block.
* **The block affects every key of the installation** for 10 minutes, on every endpoint.
* **During the block**, every request answers `429`. Those requests don't count and don't extend the block.

### Which requests count

| Response | Counts? |
| - | - |
| Successful responses | Yes |
| `403` for a missing scope | Yes |
| `404` for a path that doesn't exist | Yes |
| `401` for an invalid key | No |
| `403` for an inactive installation | No |

## The 429 response

The response carries a `Retry-After` header with the seconds left until the block ends. The same value is in `details.retry_after`:

```http theme={null}
HTTP/1.1 429 Too Many Requests
Retry-After: 600
Content-Type: application/json

{
  "error": {
    "code": "too_many_requests",
    "message": "Rate limit exceeded. Retry after 600 seconds.",
    "request_id": "7f3c1d2e-4b5a-4c6d-8e9f-0a1b2c3d4e5f",
    "details": {
      "retry_after": 600
    }
  }
}
```

When you get a `429`, stop every request for the installation and wait the `Retry-After` seconds before trying again. Retrying earlier doesn't help: the API answers `429` until the block ends.

## Avoid the block

* **Pace requests on the client.** Stay under 5 requests per second, for example with a queue that sends at most 4.
* **Coordinate your integrations.** If several systems use keys of the same installation, they share the budget. Split the pace between them.
* **Don't retry errors in a loop.** A `403` or `404` won't fix itself on retry, and it still uses budget.
* **Honor `Retry-After`.** Only `429` sends it.

```python theme={null}
import time
import requests

def get(url, api_key):
    while True:
        response = requests.get(url, headers={"Authorization": f"Bearer {api_key}"})
        if response.status_code != 429:
            return response
        time.sleep(int(response.headers["Retry-After"]))
```

## If you got blocked

The block ends on its own after 10 minutes. If you need it lifted sooner, contact Federal Access support and include the `request_id` from the `429` response.


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