Rate Limits

Understand our rate limiting policies to ensure optimal API usage.

Rate Limits by Plan

PlanRequests/minTokens/min
Free2010,000
Starter6060,000
Pro300300,000
EnterpriseCustomCustom

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: 1640995200

Handling 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