Reference
Rate limits
Requests are rate limited to keep the API fast and fair for everyone.
Limits
The default limit is 60 requests per minute, applied per API key (or per client IP when no key is present). Exceeding it returns 429 with a message in the detail.error field.
Handling 429
Back off and retry after a short pause. Exponential backoff works well for bursty workloads.
retry.ts
// Simple retry with backoff on 429
async function withRetry(fn, retries = 3) {
for (let i = 0; i <= retries; i++) {
try {
return await fn();
} catch (err) {
if (err.status === 429 && i < retries) {
await new Promise((r) => setTimeout(r, 2 ** i * 1000));
continue;
}
throw err;
}
}
}