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

# Rate Limits

> Per-plan request limits and how to handle 429 responses

The Impulse Labs API enforces a **sliding window rate limit** per user per 60-second period.

## Limits by plan

| Plan       | Requests / 60 seconds |
| ---------- | :-------------------: |
| Pro        |          120          |
| Team       |          300          |
| Enterprise |         1 000         |

<Note>
  Limits apply to **validated inference requests** — each call to `POST /infer` counts as one request against your limit.
</Note>

## Rate limit headers

Every response from `POST /infer` includes these headers:

| Header                  | Type    | Description                                           |
| ----------------------- | ------- | ----------------------------------------------------- |
| `X-RateLimit-Limit`     | integer | Maximum requests allowed in the window                |
| `X-RateLimit-Remaining` | integer | Requests remaining in the current window              |
| `X-RateLimit-Reset`     | integer | Unix timestamp (seconds) when the window resets       |
| `Retry-After`           | integer | Seconds to wait (**only present on `429` responses**) |

### Reading headers

```bash theme={null}
curl -si -X POST "https://inference.impulselabs.ai/infer" \
  -H "Authorization: Bearer $IMPULSE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"deployment_id": "my-model", "inputs": {}}' \
  | grep -i x-ratelimit

# X-RateLimit-Limit: 120
# X-RateLimit-Remaining: 118
# X-RateLimit-Reset: 1708346460
```

## Handling 429 Too Many Requests

When you exceed the limit, the API returns:

```http theme={null}
HTTP/1.1 429 Too Many Requests
Retry-After: 34
X-RateLimit-Limit: 120
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1708346460
```

```json theme={null}
{
  "valid": false,
  "error": "Rate limit exceeded",
  "limit": 120,
  "retry_after_seconds": 34
}
```

### Recommended retry strategy

1. Read the `Retry-After` header and wait that many seconds before retrying.
2. Do not retry immediately in a tight loop — this will keep triggering the limit.
3. For batch workloads, spread requests over time or use exponential backoff.

```python Python — respect Retry-After theme={null}
import time, requests

def safe_infer(session, payload, headers):
    while True:
        resp = session.post(
            "https://inference.impulselabs.ai/infer",
            json=payload,
            headers=headers,
        )
        if resp.status_code == 429:
            wait = int(resp.headers.get("Retry-After", 5))
            print(f"Rate limited. Retrying in {wait}s...")
            time.sleep(wait)
            continue
        resp.raise_for_status()
        return resp.json()
```

## Upgrading your plan

If you consistently hit rate limits, consider upgrading to a higher plan at [app.impulselabs.ai/billing](https://app.impulselabs.ai/billing).

For custom limits or Enterprise pricing, [contact us](mailto:hello@impulselabs.ai).
