Rate Limits
API rate limiting and quotas
The API enforces rate limits to ensure fair usage and service stability.
Limits
All limits are per user (not per token):
| Window | Limit |
|---|---|
| Per hour | 100 requests |
| Per month | 1,000 requests |
Rate Limit Headers
Every response includes headers showing your current usage:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 97
X-RateLimit-Reset: 1706234400| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests per window |
X-RateLimit-Remaining | Requests remaining in current window |
X-RateLimit-Reset | Unix timestamp when the window resets |
429 Too Many Requests
When you exceed the rate limit:
{
"error": {
"code": "RATE_LIMITED",
"message": "Rate limit exceeded. Try again in 45 seconds."
}
}The Retry-After header tells you when to retry:
HTTP/1.1 429 Too Many Requests
Retry-After: 45Best Practices
- Cache responses - Don't fetch the same data repeatedly
- Use pagination - Fetch only what you need with
limitparameter - Batch operations - Combine multiple updates when possible
- Handle 429s gracefully - Implement exponential backoff
Exponential Backoff Example
async function fetchWithRetry(url, options, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
const response = await fetch(url, options);
if (response.status === 429) {
const retryAfter = response.headers.get('Retry-After') || 60;
await new Promise(r => setTimeout(r, retryAfter * 1000));
continue;
}
return response;
}
throw new Error('Max retries exceeded');
}