Rate limit
Definition
A provider's cap on requests or tokens per minute or per day; requests over the cap are rejected with an error until the window resets.
In more detail
Providers usually limit requests per minute and tokens per minute, sometimes separately for input and output, and raise the limits as an account spends more. Exceeding them returns an HTTP 429 error, often with a header saying when to retry.
Handle limits in code with retries, exponential backoff and jitter, and smooth out bursts with a queue. A gateway can spread load across keys, regions or providers. Work that does not need an immediate answer is better sent to a batch API, which has separate, higher limits.
Related terms
AI gateway
A proxy between apps and model providers that gives one API for many models and adds keys, logging, budgets, caching and fallbacks.
Batch API
A provider endpoint that takes many requests at once and returns results later, typically within 24 hours, at a lower price than live requests.
Latency
The time from sending a request to a model to getting the response, often split into time to first token and total generation time.
Read more about Rate limit
- AI gateway
A proxy between apps and model providers that gives one API for many models and adds keys, logging, budgets, caching and fallbacks.
- Agent reliability
Making agents finish tasks predictably with guardrails, retries and approvals.
- LiteLLM
Open-source SDK and AI gateway that calls 100+ providers through one OpenAI-style API.