Documentation/Rate Limits

Rate Limits

Rate Limits

Rate limits are applied per API key and vary by plan. All responses include rate limit headers.

Rate Limit Headers

HeaderDescription
X-RateLimit-LimitMaximum requests per minute
X-RateLimit-RemainingRemaining requests this minute
X-RateLimit-ResetUnix timestamp when limit resets
X-RateLimit-Tokens-LimitDaily token limit
X-RateLimit-Tokens-RemainingRemaining tokens today
X-Request-IdUnique request ID for support

Best Practices

  • Implement exponential backoff: When rate limited, wait and retry with increasing delays.
  • Cache responses: Reduce redundant API calls by caching.
  • Use streaming: For long responses, streaming can improve perceived performance.
  • Monitor your usage: Use the /usage/dashboard endpoint to track consumption.
  • Set up alerts: Configure webhook alerts for quota thresholds.

Exponential Backoff Example

Code Examples

Rate Limit Headers json
HTTP/1.1 200 OK
Content-Type: application/json
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1698765432
Retry-After: 30  (only when rate limited)