Requests, tokens per minute, and requests per day use sliding windows. Your tier rises automatically as you pay; a plan can also grant a tier.
How tokens are counted
A request is admitted with an estimate: its input text (about 4 bytes per token) plus the output it may generate (max_tokens, or the model’s default). When it finishes, the counters are corrected to the actual usage. A request bigger than a whole window’s budget is still admitted into an empty window.
Headers
Every inference response carries OpenAI-style headers:
and IETF headers, such as
RateLimit-Policy: "rpm";q=60;w=60, "tpm";q=1000000;w=60 and RateLimit: "rpm";r=59;t=1. count_tokens sends only the rpm entries. When several scopes apply, the headers report the one closest to its limit.
When you hit a limit
You get429 rate_limited with a Retry-After header in seconds, and a message naming the scope and metric. The SDKs wait and retry for you. Spread bursts out, or move traffic to another key or project if one scope is the bottleneck.
