Skip to content

rate_limit_exceeded

HTTP/1.1 429 Too Many Requests
Retry-After: 32
x-ratelimit-limit: 600
x-ratelimit-remaining: 0
x-ratelimit-reset: 1715292000
{
"error": {
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "Rate limit of 600 requests/minute exceeded for this API key.",
"docs_url": "https://docs.patomic.dev/errors/rate-limit-exceeded",
"request_id": "…",
"suggestion": "Wait until the timestamp in the `Retry-After` header (or the `x-ratelimit-reset` epoch) before retrying. Increase your per-key quota by upgrading your plan or by minting an additional key."
}
}

This API key has issued more requests in the current minute window than its rate_limit_rpm allows.

  1. Honour Retry-After. It’s the seconds until the current window resets. Fixed-interval retries (every 1s, every 5s) are a footgun and may starve other callers.
  2. Use exponential backoff with jitter for repeated 429s. Five back-to-back 429s usually mean a configuration mismatch, not transient load — investigate.
  3. If the limit is too low, raise it: PATCH /v1/keys/{id} with {"rate_limit_rpm": 6000}. There’s no upsell wall — limits exist to protect Patomic, not extract revenue.
  4. For sustained high throughput, mint multiple keys and round-robin between them. Each has its own counter.
async function withRetry(fn: () => Promise<Response>): Promise<Response> {
for (let i = 0; i < 5; i++) {
const res = await fn();
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() * 200));
}
throw new Error("rate-limited 5x — review key throughput plan");
}