Operations

Rate limiting

The API can enforce a per-minute request budget. Read the rate-limit headers on every response and honor Retry-After when you are throttled.

Budgets

When usage rate limiting is enabled, default budgets are:

Separately, authentication attempts are limited to 10 per minute per IP to slow credential guessing (error 5209).

Headers

HeaderMeaning
X-RateLimit-LimitYour budget for the window
X-RateLimit-RemainingRequests left in the window
X-RateLimit-ResetWhen the window resets
Retry-AfterOn 429: seconds to wait before retrying

Handling 429

Tip
When you get a 429, wait for the number of seconds in Retry-After before retrying, and add jitter if you run many workers. Watch X-RateLimit-Remaining to slow down before you hit the limit.
async function call(url, opts) {
  const res = await fetch(url, opts);
  if (res.status === 429) {
    const wait = Number(res.headers.get("Retry-After") || 1);
    await new Promise(r => setTimeout(r, wait * 1000));
    return call(url, opts);
  }
  return res.json();
}