# Rate limits (/developers/rate-limits)

> Each API key can make 600 requests per minute; response headers tell you how much of the budget is left.

> **Preview:** this feature is in preview. The contract is stable enough to build against, but details may change before general availability.

The Luso8 API limits how many requests each API key can make so that one integration cannot slow down a workspace. Limits are counted **per key**, not per workspace or IP address.

## The limit [#the-limit]

| Limit | Window |
| --- | --- |
| 600 requests | per minute, per API key |

Every request counts, including requests that fail validation.

## Rate limit headers [#rate-limit-headers]

Every response includes headers that describe the current window:

| Header | Description |
| --- | --- |
| `X-RateLimit-Limit` | The number of requests allowed in the window (`600`). |
| `X-RateLimit-Remaining` | Requests left in the current window. |
| `X-RateLimit-Reset` | When the window resets, as a Unix timestamp in seconds. |

```http
HTTP/1.1 200 OK
Content-Type: application/json
X-RateLimit-Limit: 600
X-RateLimit-Remaining: 587
X-RateLimit-Reset: 1795361460
```

## When you exceed the limit [#when-you-exceed-the-limit]

Requests over the limit are rejected with `429 Too Many Requests` and a `Retry-After` header with the number of seconds to wait:

```http
HTTP/1.1 429 Too Many Requests
Content-Type: application/json
Retry-After: 12

{ "detail": "Rate limit exceeded" }
```

## Handling 429 responses [#handling-429-responses]

Wait for `Retry-After` seconds, then retry. If the header is missing, back off exponentially with jitter. Cap the number of attempts so a stuck job fails loudly instead of looping.

```js tab="JavaScript"
async function luso8Fetch(url, init = {}, maxAttempts = 5) {
  for (let attempt = 1; ; attempt++) {
    const res = await fetch(url, {
      ...init,
      headers: { Authorization: `Bearer ${process.env.LUSO8_API_KEY}`, ...init.headers },
    });
    if (res.status !== 429 || attempt === maxAttempts) return res;

    const retryAfter = Number(res.headers.get('Retry-After'));
    const delayMs = Number.isFinite(retryAfter) && retryAfter > 0
      ? retryAfter * 1000
      : Math.min(30_000, 500 * 2 ** attempt) + Math.random() * 250;
    await new Promise((resolve) => setTimeout(resolve, delayMs));
  }
}
```

```python tab="Python"
import os
import random
import time

import requests

session = requests.Session()
session.headers["Authorization"] = f"Bearer {os.environ['LUSO8_API_KEY']}"

def luso8_request(method: str, url: str, max_attempts: int = 5, **kwargs) -> requests.Response:
    for attempt in range(1, max_attempts + 1):
        res = session.request(method, url, timeout=30, **kwargs)
        if res.status_code != 429 or attempt == max_attempts:
            return res
        retry_after = res.headers.get("Retry-After")
        delay = float(retry_after) if retry_after else min(30, 0.5 * 2**attempt) + random.random() / 4
        time.sleep(delay)
    return res
```

## Staying under the limit [#staying-under-the-limit]

- **Use bulk endpoints.** `POST /api/v1/contacts/bulk` and `POST /api/v1/companies/bulk` create many records in one request.
- **Page with large `limit` values** instead of many small pages.
- **Pace background jobs** using `X-RateLimit-Remaining` rather than sending bursts.
- **Cache reads** that change rarely, such as lists, ticket categories and agents.
- **Split unrelated integrations across keys**, so a backfill does not starve a real-time sync.

Need a higher limit for a large migration? Email [hello@rexplore.ai](mailto:hello@rexplore.ai) with your workspace name and expected volume.