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

# Rate Limits

> How rate limiting works on the Bodha API.

# Rate Limits

The API enforces per-key rate limits to ensure fair usage. The default limit is
**60 requests per minute** per API key.

## Response headers

Every response includes rate limit headers:

| Header | Description |
| - | - |
| `X-RateLimit-Limit` | Your key's requests-per-minute limit |
| `X-RateLimit-Remaining` | Requests remaining in the current window |
| `X-RateLimit-Reset` | Unix timestamp when the window resets |

## When you're rate limited

If you exceed the limit, the API returns `429 Too Many Requests`:

```json theme={null}
{
  "error": "rate_limit_exceeded",
  "message": "Rate limit of 60 requests per minute exceeded.",
  "retryAfter": 60
}
```

## Best practices

> **Cache where possible**
>
> Route data doesn't change between optimisations. Cache responses and only
> re-fetch when you receive a webhook event.

> **Use webhooks instead of polling**
>
> Rather than polling for status changes, set up webhooks to get notified
> in real time when routes are dispatched or stops are completed.

> **Respect the Retry-After**
>
> When you receive a 429, wait for the time indicated in the `retryAfter`
> field before retrying.


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