API Reference

Rate Limits

Understand how rate limiting works in the Aryxion API and how to handle rate limit errors gracefully.

5 min readAll Levels

Rate Limit Tiers

Free
100

per minute

Burst: 20 requests
Pro
1,000

per minute

Burst: 100 requests
Enterprise
10,000

per minute

Burst: 500 requests

Rate Limit Headers

Every API response includes headers to help you track your rate limit status:

X-RateLimit-LimitThe maximum number of requests allowed per time window
X-RateLimit-RemainingThe number of requests remaining in the current time window
X-RateLimit-ResetUnix timestamp when the rate limit window resets
Retry-AfterSeconds to wait before retrying (only on 429 responses)

Handling Rate Limits

429 Too Many Requests

When you exceed the rate limit, you'll receive a 429 status code.

// Example: Handling rate limits with exponential backoff
async function makeRequest(url, options, retries = 3) {
  for (let i = 0; i < retries; i++) {
    const response = await fetch(url, options);
    
    if (response.status === 429) {
      const retryAfter = response.headers.get('Retry-After') || 60;
      const delay = Math.min(1000 * Math.pow(2, i), retryAfter * 1000);
      
      console.log(`Rate limited. Retrying in ${delay}ms...`);
      await new Promise(resolve => setTimeout(resolve, delay));
      continue;
    }
    
    return response;
  }
  
  throw new Error('Max retries exceeded');
}

Best Practices

Monitor Your Usage

Check the rate limit headers in responses to track your usage.

Implement Backoff

Use exponential backoff when retrying failed requests.

Cache Responses

Cache API responses to reduce the number of requests.

Batch Requests

Combine multiple operations into single batch requests when possible.