Rate Limits
Understand our rate limiting policies to ensure optimal API usage.
Rate Limits by Plan
| Plan | Requests/min | Tokens/min |
|---|---|---|
| Free | 20 | 10,000 |
| Starter | 60 | 60,000 |
| Pro | 300 | 300,000 |
| Enterprise | Custom | Custom |
Rate Limit Headers
Every API response includes headers showing your current rate limit status:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1640995200Handling Rate Limits
When you exceed the rate limit, you will receive a 429 error. Here is how to handle it:
// JavaScript Example: Retry with exponential backoff
async function fetchWithRetry(url, options, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
try {
const response = await fetch(url, options);
if (response.status === 429) {
const retryAfter = response.headers.get('Retry-After') || Math.pow(2, i);
await new Promise(r => setTimeout(r, retryAfter * 1000));
continue;
}
return response;
} catch (error) {
if (i === maxRetries - 1) throw error;
}
}
}Best Practices
- Implement exponential backoff for retries
- Cache responses when appropriate
- Use streaming for long responses
- Batch requests when possible
- Monitor your usage in the Dashboard
- Contact us for higher rate limits if needed