API Rate Limits

Understanding and managing API request limits for optimal performance.

Overview

To ensure fair usage and maintain service quality, CX Tools implements rate limiting on API requests. Rate limits vary by endpoint and subscription tier.

Rate Limit Headers

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1640995200

Rate Limits by Plan

Plan Requests/Min Daily Limit Burst Limit
Free 60 1,000 100
Pro 300 10,000 500
Enterprise Custom Custom Custom

Handling Rate Limits

Rate Limit Response

HTTP/1.1 429 Too Many Requests
{
    "error": "Rate limit exceeded",
    "reset_at": "2024-01-22T10:00:00Z"
}

Best Practices

  • Implement exponential backoff
  • Cache responses when possible
  • Monitor rate limit headers
  • Batch requests when appropriate

Example Implementation

async function makeRequest() {
  try {
    const response = await fetch('/api/endpoint', {
      headers: { 'Authorization': 'Bearer API_KEY' }
    });
    
    // Check remaining rate limit
    const remaining = response.headers.get('X-RateLimit-Remaining');
    if (remaining < 10) {
      // Consider implementing backoff
    }
    
    return await response.json();
  } catch (error) {
    if (error.status === 429) {
      // Handle rate limit
      const resetTime = error.headers.get('X-RateLimit-Reset');
      await sleep(calculateBackoff(resetTime));
      return makeRequest();
    }
    throw error;
  }
}

Next Steps

Now that you understand our rate limits, explore our API endpoints or upgrade your plan for higher limits.