Skip to main content

Rate Limits

Zihin API enforces rate limits to ensure fair usage and platform stability.

Limits by Plan

PlanRequests/minRequests/dayMax Tokens/request
Free101004,096
Basic605,0008,192
Pro30050,00032,768
EnterpriseCustomCustomCustom

Rate Limit Headers

Every response includes rate limit information:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1708200000
Retry-After: 30
HeaderDescription
X-RateLimit-LimitMax requests per window
X-RateLimit-RemainingRemaining requests
X-RateLimit-ResetUnix timestamp when limit resets
Retry-AfterSeconds to wait (only on 429)

Handling Rate Limits

When you receive a 429 Too Many Requests:

  1. Read the Retry-After header
  2. Wait the specified duration
  3. Retry the request
async function callWithRetry(payload, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
const res = await fetch(url, { method: 'POST', body: JSON.stringify(payload) });
if (res.status !== 429) return res;
const wait = parseInt(res.headers.get('Retry-After') || '5');
await new Promise(r => setTimeout(r, wait * 1000));
}
throw new Error('Rate limit exceeded after retries');
}