Beta docs: the shipped API is POST /api/v1/generate for gemini and sarvam. Some pages below describe planned features. See the shipped quick start.

Guides

Rate Limits

Per-key request and token limits, and how to respond when you hit one.

Rate limits protect the gateway for everyone, and they apply per key. Exceeding a limit returns 429 with a Retry-After header telling you how long to wait.

Default limits

PlanRequests/minTokens/minConcurrent streams
Free6040k4
Pro600400k16
EnterpriseCustomCustomCustom

Placeholders

Exact numbers change as the beta benchmarks settle — these are the current defaults, not a commitment.

Seeing your limits

Every response carries rate limit headers. No extra call needed:

HeaderMeaning
x-ratelimit-limitRequests allowed per window
x-ratelimit-remainingRequests left in this window
x-ratelimit-resetSeconds until the window resets
retry-afterOn 429, seconds to wait

Handling a 429

backoff.ts
async function callWithBackoff(fn) {
  for (let i = 0; ; i++) {
    try {
      return await fn();
    } catch (err) {
      if (err.status !== 429) throw err;
      const retryAfter = Number(err.headers.get("retry-after")) ?? 2 ** i;
      await sleep(retryAfter * 1000);
    }
  }
}

What communities share

  • Token limits are shared across streaming and non-streaming calls.
  • Streaming consumes tokens as they are generated.
  • 429s are retryable — the Retries guide shows the pattern.