Docs/Reference

Rate Limits

Requests are rate-limited per API key. Limits vary by plan.

Limits by Plan

PlanLimitWindow
Free1,000 requestsper hour
Starter5,000 requestsper hour
Growth20,000 requestsper hour
Scale50,000 requestsper hour

Response Headers

Every response includes rate limit headers so you can track your usage:

HeaderDescription
X-RateLimit-LimitYour total allowed requests per window
X-RateLimit-RemainingRequests remaining in the current window
X-RateLimit-ResetUnix timestamp when the window resets
Retry-AfterSeconds 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