Rate Limits
Requests are rate-limited per API key. Limits vary by plan.
Limits by Plan
| Plan | Limit | Window |
|---|---|---|
| Free | 1,000 requests | per hour |
| Starter | 5,000 requests | per hour |
| Growth | 20,000 requests | per hour |
| Scale | 50,000 requests | per hour |
Response Headers
Every response includes rate limit headers so you can track your usage:
| Header | Description |
|---|---|
X-RateLimit-Limit | Your total allowed requests per window |
X-RateLimit-Remaining | Requests remaining in the current window |
X-RateLimit-Reset | Unix timestamp when the window resets |
Retry-After | Seconds to wait (only present on 429 responses) |
Handling 429 Responses
When rate limited, implement exponential backoff with the Retry-After header:
async function fetchWithRetry(url, options, maxRetries = 3) {
for (let attempt = 0; attempt < maxRetries; attempt++) {
const res = await fetch(url, options);
if (res.status === 429) {
const retryAfter = parseInt(res.headers.get('Retry-After') || '1', 10);
const backoff = retryAfter * Math.pow(2, attempt);
console.log(`Rate limited. Retrying in ${backoff}s...`);
await new Promise(r => setTimeout(r, backoff * 1000));
continue;
}
return res;
}
throw new Error('Max retries exceeded');
}AI