What is a token rate limit?
A token rate limit is an upper bound on the total tokens a user, application or department can send to and receive from an AI service within a period, such as per minute.
Unlike a request count limit, which counts only how many requests are sent and treats a short question like a long document, a token rate limit also accounts for request size, since GPU load scales with token count. The two are often applied together.
- Topic
- Inference and performance
- Also known as
- TPM limit, tokens per minute limit
How a token rate limit works
- An allowed token amount per period is set for each user, application or department.
- An AI gateway or inference server counts each request's input and output tokens.
- When the limit is exceeded, new requests are temporarily rejected or queued; the client is told when it can retry.
- Limits are tracked through usage reports and adjusted to departments' real needs.
In more detail
Pre-request reservation and post-request reconciliation
Because output length is unknown before generation finishes, production gateways typically reserve `input_tokens + max_tokens` from the token bucket at admission and refund unused capacity after completion. Without pre-flight reservation, a burst of concurrent long-output requests can temporarily overshoot the TPM limit.
Weighting input and output tokens and the effect of prefix caching
Generating output tokens is far more memory-bandwidth intensive and slower than processing input tokens, so many providers and enterprise gateways enforce separate Input TPM (ITPM) and Output TPM (OTPM) limits or weight output tokens higher. Similarly, input tokens served from a prefix/prompt cache often receive discounted weights or exemptions.
HTTP 429, Retry-After and jittered exponential backoff
When a token rate limit is exceeded, servers typically return HTTP `429 Too Many Requests` along with `Retry-After` or rate-limit reset headers. Clients should apply exponential backoff with random jitter so multiple throttled applications do not retry simultaneously and create a thundering herd.
Commonly confused terms
| Term | How it differs |
|---|---|
| Token quota and budget | A token rate limit governs short-window throughput (e.g., tokens per minute or second) to protect real-time capacity; a token quota or budget usually denotes a cumulative allowance over a billing cycle such as a day or month. |
| Concurrency limit | A concurrency limit restricts how many requests are in flight simultaneously on the GPU scheduler (protecting KV cache memory), whereas a token rate limit restricts cumulative token volume over a sliding or fixed time window. |
Why a token rate limit matters for on-premises AI
On a shared in-house GPU cluster, a token rate limit stops one application or user consuming all capacity and stalling others, ensuring fair sharing in multi-tenant use. It matters for security too: exhausting resources through excessive or malicious use is a threat defined as unbounded consumption, with rate limits among its basic countermeasures. Limits also underpin measuring use by department and allocating cost.
In an in-house AI service shared by group companies, a holding sets per-minute token limits for each company; when one company's batch document job exceeds its limit it is queued, while the others' chat assistants keep running without slowing.
Common questions
How does a token rate limit differ from a request limit?
A request limit counts only requests. A token rate limit also counts their size, protecting capacity more accurately since GPU load scales with tokens.
What happens when a token rate limit is exceeded?
New requests are temporarily rejected or queued. The client is often told when it can retry.
Related terms
Sources
In the glossary: Glossary, R to Z