Rate Limits
Rate Limits
Section titled “Rate Limits”Rate limits are configured per API key by your administrator. There are two independent limits:
- Per-minute limit — the number of requests allowed in any rolling 60-second window
- Per-day limit — the total number of requests allowed in a calendar day
Both limits are enforced independently. Exceeding either one will result in a 429 response.
Response Headers
Section titled “Response Headers”Every API response includes headers showing your current usage:
| Header | Description |
|---|---|
X-RateLimit-Limit | Your per-minute request limit |
X-RateLimit-Remaining | Requests remaining this minute |
X-RateLimit-Daily-Limit | Your per-day request limit |
X-RateLimit-Daily-Remaining | Requests remaining today |
Example:
X-RateLimit-Limit: 60X-RateLimit-Remaining: 42X-RateLimit-Daily-Limit: 10000X-RateLimit-Daily-Remaining: 8763When You’re Rate Limited
Section titled “When You’re Rate Limited”When a limit is exceeded, you receive a 429 Too Many Requests response:
{ "error": "Too many requests. Please wait and try again."}Or for daily limits:
{ "error": "Daily request limit reached. Please try again tomorrow."}The response always includes a Retry-After header:
Retry-After: 30This is the number of seconds to wait before retrying.
Best Practices
Section titled “Best Practices”Check headers proactively — Don’t wait for a 429. Monitor X-RateLimit-Remaining and slow down before hitting the limit.
Implement retry logic — For 429 responses, wait for the Retry-After duration before retrying.
Batch when possible — If your workflow allows it, space out requests rather than sending them all at once.
Example: proactive rate limit check
async function callAPI(inputs) { const response = await fetch(`${BASE_URL}/api/${PRODUCT_SLUG}`, { method: 'POST', headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ inputs }), })
const remaining = parseInt(response.headers.get('X-RateLimit-Remaining') || '0') if (remaining < 5) { console.warn(`Rate limit low: only ${remaining} requests remaining this minute`) }
if (response.status === 429) { const retryAfter = parseInt(response.headers.get('Retry-After') || '60') console.log(`Rate limited. Waiting ${retryAfter} seconds...`) await new Promise(resolve => setTimeout(resolve, retryAfter * 1000)) return callAPI(inputs) // retry once }
return response.json()}Adjusting Your Limits
Section titled “Adjusting Your Limits”Rate limits are set per key by your administrator. If your current limits are too restrictive for your use case, contact your administrator to have them increased.