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

# Rate Limiting

> Learn about rate limiting in the Capital Check In API

# Rate Limiting

The Capital Check In API implements rate limiting to ensure fair usage and maintain service quality.

## Rate Limits

| Plan       | Requests per minute | Requests per hour | Requests per day |
| ---------- | ------------------- | ----------------- | ---------------- |
| Free       | 60                  | 1,000             | 10,000           |
| Pro        | 300                 | 5,000             | 50,000           |
| Enterprise | 1,000               | 20,000            | 200,000          |

## Rate Limit Headers

All API responses include rate limit headers:

```
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1640995200
```

| Header                  | Description                                        |
| ----------------------- | -------------------------------------------------- |
| `X-RateLimit-Limit`     | Maximum requests allowed in the time window        |
| `X-RateLimit-Remaining` | Number of requests remaining in the current window |
| `X-RateLimit-Reset`     | Unix timestamp when the rate limit resets          |

## Rate Limit Exceeded

When you exceed the rate limit, you'll receive a `429 Too Many Requests` response:

```json theme={null}
{
  "error": "rate_limit_exceeded",
  "message": "Rate limit exceeded. Try again in 60 seconds.",
  "retry_after": 60
}
```

## Best Practices

* Monitor rate limit headers in your responses
* Implement exponential backoff when hitting rate limits
* Cache responses when possible to reduce API calls
* Use webhooks for real-time updates instead of polling
* Consider upgrading your plan if you consistently hit rate limits

## Handling Rate Limits

```javascript theme={null}
// Example of handling rate limits
if (response.status === 429) {
  const retryAfter = response.headers.get('Retry-After');
  await new Promise(resolve => setTimeout(resolve, retryAfter * 1000));
  // Retry the request
}
```
