Zum Inhalt springen

Rate Limiting

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

The Acme API enforces rate limits to ensure fair usage and system stability.

Plan Requests/Minute Requests/Day
Free 60 1,000
Pro 600 50,000
Enterprise 6,000 Unlimited

Every response includes rate limit information:

X-RateLimit-Limit: 600
X-RateLimit-Remaining: 595
X-RateLimit-Reset: 1705312800
Header Description
X-RateLimit-Limit Maximum requests per minute
X-RateLimit-Remaining Remaining requests in current window
X-RateLimit-Reset Unix timestamp when the limit resets

When you exceed the limit, you’ll receive a 429 response:

{
"error": {
"code": "rate_limit",
"message": "Rate limit exceeded",
"retry_after": 45
}
}

The Retry-After header indicates seconds to wait:

HTTP/1.1 429 Too Many Requests
Retry-After: 45
  1. Monitor rate limit headers to track remaining requests proactively.
  2. Implement exponential backoff for retries.
  3. Queue requests to spread them over time.
  4. Cache responses to reduce unnecessary API calls.
  5. Use webhooks to subscribe to events instead of polling.
async function fetchWithRetry(url, options, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
const response = await fetch(url, options);
if (response.status === 429) {
const retryAfter = response.headers.get('Retry-After') || 60;
await sleep(retryAfter * 1000);
continue;
}
return response;
}
throw new Error('Max retries exceeded');
}