Rate Limits

Per-IP and per-key rate limits, how tiers are picked, what 429 vs 403 mean, and how to retry in your client.

AnyRouter limits request rate per IP (anonymous traffic) and per API key (authenticated traffic), over a sliding 60-second window using Cloudflare rate-limiting bindings. There is no daily quota. Your plan sets the tier (Pricing & Plans).

Tiers

CallerTierLimit
Anonymous (no API key)per-IP300 req / 60s
Go from a donated key, free-tier model (anyrouter/free or *:free)free-go-donation60 req / 60s per account
Go, free-tier modelfree-go150 req / 60s per account
Pro, Pro+ or Max, free-tier modelfree-pro400 req / 60s per account
Plan go, paid modelgo600 req / 60s
Plan free or payg, paid modelpaid-model600 req / 60s
Plan pro, paid modelpro1200 req / 60s
Plan pro_plus or max, paid modelpower1800 req / 60s
Plan enterprise, any modelenterprise2400 req / 60s
POST /api/v1/decisions, any model, any plandecision60 req / 60s
  • Free-tier models need Go or higher and have no daily cap. The limit counts per account across all your keys. A Free-plan request to a free model returns 403 free_tier_requires_subscription. See Free Tier.
  • Paid-model limits are a separate counter, so upgrading never lowers a limit.
  • X-RateLimit-Tier is pro for Pro and power for Pro+ and Max (legacy identifiers).
  • Over a free-model limit the API returns 429 rate_limit_exceeded with Retry-After: 60; the message names your plan, the limit and the plan to upgrade to.

Decisions: free, no plan quota, fair-use burst cap

Decision models through anyrouter/decision are free on Go and higher, with no credits, BYOK key or plan quota needed. Free gets a 5-request trial shared with free models.

Every request to POST /api/v1/decisions (or /api/v1/systemone) has its own per-key fair-use burst cap of 60 requests per minute on every plan, so one runaway script cannot flood the shared models. It is a separate counter: decision traffic does not use your chat limit. A tripped cap returns 429 rate_limit_exceeded with Retry-After: 60 and X-RateLimit-Tier: decision.

Response headers

Every API response, including errors and GET /api/v1/health, /models and /credits, carries:

HeaderMeaning
X-RateLimit-LimitPer-window request cap for the tier you hit
X-RateLimit-WindowWindow length in seconds (always 60)
X-RateLimit-TierOne of ip, free-go-donation, free-go, free-pro, free-model (enterprise), paid-model, go, pro, power, enterprise, decision, starter-window
RateLimit-LimitIETF draft header, same number as X-RateLimit-Limit
RateLimit-PolicyIETF draft policy, e.g. 300;w=60 (cap ; window seconds)

X-RateLimit-Remaining and X-RateLimit-Reset are not emitted; the edge limiter does not expose the counter.

A limit hit returns HTTP 429 with Retry-After: 60 and {"error": {"code": "rate_limit_exceeded", "message": "Rate limit exceeded for your API key — …"}}.

429 vs other errors

Statuserror.codeSourceMeaning and fix
429rate_limit_exceededAnyRouterPer-key limit hit. Back off Retry-After seconds.
429ip_rate_limit_exceededAnyRouterAnonymous IP hit 300/min. Send an API key.
403upstream_403UpstreamProvider denied the call (geo block, policy). Not fixed by backoff.
401upstream_401UpstreamBYOK credential rejected. Check your key.
401invalid_api_keyAnyRouterYour AnyRouter key is wrong or revoked.
402insufficient_balanceAnyRouterBalance empty. Top up at Credits.
502upstream_5xxUpstreamTransient provider failure. Retry with jitter.

error.metadata.upstream_backend names the provider for upstream_* errors.

Retry in your client

Do not treat a 429 as a permanent credential failure: the same key works again after the window.

ts
async function callWithBackoff(body: object): Promise<Response> {
  for (let attempt = 0; attempt < 5; attempt++) {
    const res = await fetch("https://anyrouter.dev/api/v1/chat/completions", {
      method: "POST",
      headers: {
        "Authorization": `Bearer ${ANYROUTER_KEY}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify(body),
    })
    if (res.status !== 429) return res

    const wait = Number(res.headers.get("Retry-After") ?? 60)
    const jitter = Math.random() * 1000
    await new Promise((r) => setTimeout(r, wait * 1000 + jitter))
  }
  throw new Error("Rate-limit retries exhausted")
}

Agent loops count every call: the main completion, one per tool round-trip, and auxiliary calls such as title generation or compaction. A 5-tool task is about 8 requests, so 600/min sustains about 75 such tasks per minute and 150/min about 18. If your loop exceeds its tier, call paid models (600/min), upgrade (Pro gives 400/min on free models; enterprise 2400/min), and cap parallelism with jitter. For more headroom, describe your workload (sustained req/min, burst pattern) at /contact; enterprise tiers are negotiated.

AnyRouter routes requests to third-party models. Models and outputs are provided as is, with no warranty; you use them at your own risk. Disclaimer