Skip to content
NLEN
Illustration: Rate limit simulator for LLM APIs's

Rate limit simulator for LLM APIs

By Ivo Donker - 3 August 2026

When building applications on top of Large Language Models (LLMs), rate limits from API providers are one of the most significant infrastructure hurdles. This simulator helps you calculate whether your expected traffic pattern fits within the configured limits, which limit hits first, and what the expected percentage of HTTP 429 errors (Too Many Requests) will be.

Simulator Input

Simulation Results

Analysis & Recommendation

Calculating...

RPM Status (Average / Peak)
-
-
TPM Status (Average / Peak)
-
-
First Bottleneck
-

-

Max Allowed RPM (based on TPM)
-

Maximum API capacity

Estimated Share of 429 Errors (At Peak)
-

Percentage of rejected requests

Queue Status
-

-

Scenario comparison

Metric Average Load Peak Load Peak + Concurrency
Requests / min - - -
Tokens / min - - -
RPM Utilization - - -
TPM Utilization - - -
Expected Status - - -

How LLM provider rate limits work

Rate limiting is a fundamental mechanism API providers use to protect the stability and availability of their infrastructure. With traditional REST APIs, the focus is almost exclusively on the number of network requests per time unit. With generative AI and Large Language Models this is more complex, because the compute power and memory usage (VRAM) per request vary enormously based on the amount of text processed and generated. If you want to learn more about how input is converted into these compute units, read the guide on tokenization explained.

Providers typically use three to four different dimensions for rate limits:

When an application exceeds one of these limits, the provider's API responds with an HTTP status code 429 Too Many Requests. Understanding the exact relationship between these limits is essential for a stable architecture, as also described on the page about rate limits and costs.

Why TPM usually becomes the bottleneck before RPM

A common pitfall for software architects is assuming that the RPM limit is the main bottleneck. In practice, however, the TPM limit is almost always reached first. This is due to the relatively high number of tokens per request in modern LLM applications.

Take, for example, a scenario where a provider sets a limit of 500 RPM and 90.000 TPM. If your application sends an average of 800 input tokens and receives 400 output tokens back, each request consumes exactly 1.200 tokens. To reach the TPM limit of 90.000, only 75 requests per minute are needed ($90.000 / 1.200 = 75$). At that point you're only using 15% of your allowed RPM ($75 / 500$). In this case, the TPM limit therefore becomes a bottleneck at just a fraction of the maximum request frequency.

Moreover, output tokens are much more expensive to generate server-side than input tokens (due to the auto-regressive nature of LLMs), although API providers count the sum of both toward the TPM limit. If a prompt grows to 4.000 tokens per request due to a large context or extensive RAG documents, a single parallel batch of requests can exhaust the TPM limit within seconds.

Correctly handling HTTP 429 errors

When a 429 error occurs, it's crucial that the client application handles it in a controlled way. Immediately and endlessly repeating the request (brute-force retries) leads to a so-called retry storm, where the network becomes completely clogged and the API provider may start rejecting requests at the IP level.

The industry standard for handling rate limits includes the following elements:

Strategies: batching, spreading, and routing

If the simulator shows that your expected peak load exceeds the available limits, several architectural measures can help prevent outages:

1. Batch processing for asynchronous tasks

Tasks that don't need to run in real time (such as processing documents, newsletters, or data analysis) are better off being batched together. Many providers offer dedicated batch processing endpoints at a lower rate and with a separate, higher rate limit. You can find more details on the page about batch processing for LLM APIs.

2. Dynamic rate limiting at the client level

By incorporating a local token-bucket or leaky-bucket algorithm into your own backend, you can smooth out outgoing traffic (traffic shaping). Instead of firing requests directly at the external API, they are captured in an internal queue that releases requests at a controlled pace based on measured token usage.

3. Multi-provider and model routing

When a single provider key doesn't offer enough capacity, a routing layer can help. This dynamically distributes requests across multiple API keys, multiple accounts, or even different LLM providers. See the article on model routing for strategies on smartly distributing requests when limits are looming.

Measuring actual limits instead of estimating them

While a simulator like this provides excellent theoretical insight, practice sometimes differs from the static calculations. Two important factors cause these deviations:

  1. Variable response lengths: LLMs don't generate a fixed number of tokens. A question might be answered in 50 tokens one time and 800 tokens the next.
  2. Sliding windows: Providers rarely reset the TPM limit at a fixed minute boundary. Instead, they often use a rolling window of, say, 60 seconds, or a leaky-bucket algorithm at the millisecond level.

To map out exact limits and actual usage, it's necessary to set up telemetry in your software pipeline. Both the number of tokens used per request and the latency and any 429 errors need to be monitored. For a deeper dive into setting up active monitoring, we refer you to the guide on observability and logging.

Assumptions and limitations

This simulator uses a simplified mathematical model to visualize traffic flows and rate limits. When interpreting the results, keep the following assumptions in mind:

Further reading