Skip to main content

Rate Limiting

The Kula API meters requests so one integration can't crowd out another. Every API token gets 200 requests per minute. Unused allowance banks for up to an hour, so a token that has been idle that long can send 12,000 requests in one go before it starts getting 429s.

Accounts on a raised limit see proportionally larger figures. Read the limit from the response headers rather than hard-coding it.

How the limit works​

Your allowance refills continuously rather than resetting on a clock. Think of it as a budget that tops up at 200 requests per minute, up to a ceiling of one hour's worth.

  • Stay under 200 requests per minute and you never hit the limit.
  • Go idle, and unused allowance banks up to 12,000 requests.
  • Spend that burst, and you're admitted at 200 requests per minute while the budget refills.

There's no fixed window, so there's no moment when everyone's quota resets at once.

Each token has its own budget​

The limit applies per API token, not per account. An account with three API tokens gets three independent budgets, so a bulk sync on one token won't throttle your webhook handler on another.

The exception is personal access tokens: all personal tokens belonging to the same user share one budget, including the hosted Kula MCP connector.

Read the rate limit headers​

Every metered response carries your current position, whether it succeeded or not:

curl -i https://api.kula.ai/v1/jobs \
-H "Authorization: Bearer $KULA_API_TOKEN"
HTTP/2 200
X-RateLimit-Limit: 12000
X-RateLimit-Remaining: 11999
X-RateLimit-Reset: 1736937001

The request above was sent at 1736937000, so X-RateLimit-Reset is one second out — the time for that single request's allowance to return.

HeaderMeaning
X-RateLimit-LimitYour burst capacity, in requests — not a per-minute figure
X-RateLimit-RemainingHow much of that burst is left
X-RateLimit-ResetUnix timestamp when your budget would be fully topped up

X-RateLimit-Reset tells you when the budget is completely restored. You can send another request long before then, so don't sleep until that timestamp.

Handle a 429 response​

When the burst is spent, the API returns 429 Too Many Requests with a Retry-After header:

HTTP/2 429
Retry-After: 1
X-RateLimit-Limit: 12000
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1736940600
{
"error": {
"code": "ERR_RATE_LIMIT_EXCEEDED",
"message": "You have exceeded your API rate limit"
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "req_abc123"
}
}

Wait for Retry-After, not X-RateLimit-Reset. In the response above Retry-After is 1 second, while X-RateLimit-Reset is a full hour later — the difference between "you can send one more request" and "your whole burst is back". A client that sleeps until X-RateLimit-Reset after a single 429 stalls for an hour it didn't need to.

Add exponential backoff with jitter if the 429s persist:

async function requestWithBackoff(url, token, attempts = 5) {
for (let attempt = 0; attempt < attempts; attempt++) {
const response = await fetch(url, {
headers: { Authorization: `Bearer ${token}` },
});

if (response.status !== 429) {
return response;
}

const retryAfter = Number(response.headers.get('retry-after')) || 1;
const jitter = Math.random() * 500;
await new Promise((r) => setTimeout(r, retryAfter * 1000 * 2 ** attempt + jitter));
}

throw new Error('Rate limited after all retry attempts');
}

Stay under the limit​

DoDon't
Subscribe to webhooks for changesPoll endpoints on a short interval
Watch X-RateLimit-Remaining and slow down as it fallsWait for a 429 to find out you're too fast
Request only the fields and pages you needWalk every page on every run
Spread bulk syncs over timeFire a backfill as fast as your client allows

Request a higher limit​

Limits are set per account, so raising yours doesn't need a code change on your side or a new token. Email api-support@kula.ai with your account subdomain, the integration involved, and the sustained rate you need.

Bulk syncs and migrations are the usual reasons, and a temporary raise for a one-off backfill is fine to ask for.