Rate limits
nokai.studio uses a token-bucket limiter scoped per API key and per customer.
Defaults
- 60 burst -- a full bucket holds 60 tokens.
- ~1 request/second sustained -- the bucket refills at 1 token/second.
Plan-scoped overrides exist. The response headers always reflect your actual limits.
Response headers
Every response includes:
| Header | Meaning |
|---|---|
X-RateLimit-Limit | Bucket capacity. |
X-RateLimit-Remaining | Tokens left after this request. |
X-RateLimit-Reset | Unix timestamp (seconds) when the bucket refills. |
On 429 Too Many Requests:
| Header | Meaning |
|---|---|
Retry-After | Seconds to wait before retrying. Honor this -- it is exact. |
Check limits without consuming
GET /v1/limits returns current headroom across all buckets without spending a token. See API reference -> Limits.
Backoff pattern
async function callApi(url: string, init: RequestInit): Promise<Response> {
for (let attempt = 0; attempt < 5; attempt++) {
const res = await fetch(url, init);
if (res.status !== 429) return res;
const wait = Number(res.headers.get('Retry-After') ?? 1) * 1000;
await new Promise((r) => setTimeout(r, wait + Math.random() * 250));
}
throw new Error('Rate limited after 5 retries');
}Use Retry-After for 429 -- it is authoritative. Reserve exponential backoff for 5xx.
What counts as one request
One HTTP request = one token, regardless of payload size. Generation service callbacks originate from the platform; they do not count against your limit.
Need a higher limit?
Open a support ticket (POST /v1/support/tickets) or email hello@nokai.studio. Higher limits are available on Pro and custom plans.