Skip to main content

Rate Limiting

The Kula API allows 1,000 requests per hour per account. All API tokens on the same account share this limit.

Response Headers

Every response includes rate limit information:

HeaderDescription
X-RateLimit-LimitMaximum requests per hour
X-RateLimit-RemainingRequests remaining
X-RateLimit-ResetUnix timestamp when limit resets

Rate Limit Exceeded

When you exceed the limit, the API returns 429 Too Many Requests:

{
"error": {
"code": "ERR_RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Please try again later."
},
"meta": {
"retry_after": 300
}
}

Wait for retry_after seconds before retrying.

Handling Rate Limits

Check the response status and implement retry logic:

async function makeRequest(url, token) {
const response = await fetch(url, {
headers: { 'Authorization': `Bearer ${token}` }
});

if (response.status === 429) {
const retryAfter = response.headers.get('retry-after') || 60;
await new Promise(r => setTimeout(r, retryAfter * 1000));
return makeRequest(url, token);
}

return response.json();
}

Best Practices

DoDon't
Cache responsesPoll frequently
Use webhooks for updatesFetch all pages unnecessarily
Monitor remaining requestsIgnore rate limit headers
Request only needed dataMake redundant requests

Increasing Limits

Enterprise plans include higher limits. Contact api-support@kula.ai for details.