Understanding Rate Limits for LLM APIs: TPM, RPM, and RPD Explained

    Boldly understand Alibaba Cloud Qwen and Qwen3 - model APIs must be used with the rate limit 429 experience, for the adjustments in your team this guide explains how model APIs limits work, covering the three core quota dimensions (TPM, RPM, RPD), how usage tiers affect limits, practical engineering patterns for handling throttling, and capacity planning and monitoring practices before production launch.

    Large language model APIs are not “connect once, call forever.” Whether you are working in a trial environment or a production project with billing enabled, providers enforce rate limits to protect inference clusters, control costs, and ensure fairness across tenants. For developers, these limits are not occasional errors—they are boundary conditions for capacity design. How you smooth out peaks, implement retries, and monitor daily usage should all be decided before launch.

    What Rate Limits Are Designed to Solve

    The cost of inference services comes primarily from compute and context length. A short classification call and a generation request with a long document consume very different amounts of resources. If providers only limited “call counts,” long requests could still saturate a cluster; if they only limited “tokens,” a burst of short requests could crowd out the scheduling queue. That is why the industry commonly constrains both throughput and frequency, and sets different caps depending on the project’s usage stage.

    Quotas are typically tied to a project, not to a particular piece of example code. A single account can have multiple projects, each with its own tier, keys, and billing cycle. When troubleshooting “why my requests are suddenly being rejected,” first confirm which project and which key the request actually hit, then check that project’s current tier—don’t rely only on your local retry logs.

    The Three Most Common Quota Dimensions

    When discussing LLM API limits, three abbreviations appear most often. They measure different resources over different time windows and cannot replace one another.

    Tokens Per Minute (TPM)

    The measurement window is typically one minute, and the count usually includes both input and output tokens. Long prompts, repeatedly concatenated system instructions, or multi-turn conversations that resend full history all burn through TPM quickly. Setting an output max_tokens value too high can also exhaust your per-minute budget while streaming responses are still in progress. When TPM is exhausted, you’ll see consecutive failures over a short period that recover after a minute—unlike permanent errors such as “invalid API key.”

    Requests Per Minute (RPM)

    This limits the number of calls, regardless of how long each request body is. Health checks, per-item embedding calls, or splitting large batch jobs into very fine-grained requests can hit RPM first. In these cases, even when user content is short, the gateway still rejects the call. Consolidating requests and eliminating meaningless polling is often more effective than simply increasing timeouts.

    Requests Per Day (RPD)

    This counts calls cumulatively over a calendar or billing day, and is mainly used to constrain trial usage and prevent abuse. Sporadic debugging during the day may feel unconstrained, but if batch processing or regression tests all run on the same day, you can hit sudden failures at the end of the day. Once RPD is exhausted, waiting for the next daily reset is usually more sensible than retrying within the same minute.

    These three dimensions are combined with “AND” logic: if any one is exceeded, requests may be rejected. When planning capacity, base your design on whichever limit is easiest to hit—not on the most generous number.

    How Usage Tiers Typically Evolve

    Many platforms divide projects into usage tiers. Free projects or those without billing enabled have the lowest limits, meant for experimentation and functional validation. After billing is enabled, limits increase; as cumulative spend reaches certain thresholds and passes an observation period, tiers may rise again. Tier upgrades are rarely instant—after payment or reaching spend milestones, it can take several days for changes to take effect, preventing brand-new accounts from instantly gaining very high quotas.

    Do not treat sample numbers from one provider’s public page as a universal standard across all platforms and models. TPM, RPM, and RPD can differ completely across model sizes, regions, and account types, and they change as policies are adjusted. The safe approach: treat tiers as “a combination of eligibility and caps,” rely only on your current project’s console or official Quota documentation for actual numbers, and record a “last checked” date in your docs so stale screenshots don’t end up in your runbooks.

    If your team uses model services on Baidu AI Cloud alongside other general-purpose APIs, maintain separate accounts per project—don’t infer project A’s tier onto project B. Console pages like “Usage & Quotas” or “Rate Limits” typically list your current tier and all three limits. If one of them isn’t visible, first check whether that model has its own separate quota, rather than assuming all three are always displayed together.

    Verifying Limits in the Console

    Follow a fixed order when checking, to avoid unnecessary back-and-forth:

    1. Confirm your login identity matches the target project, ruling out mixing of personal and team workspaces.
    2. Open the Usage or Rate Limits page in the developer console, and record the model name, tier, TPM, RPM, and RPD.
    3. Compare actual usage over the last 24 hours and last 60 seconds to determine whether you are “approaching the limit” or “already exhausted.”
    4. If the page breaks down quotas by model, don’t use a general-purpose chat model’s quota to explain failures in an embedding or long-context model.
    5. Save screenshots or exported numbers into your change log, aligned with release and load-test timings.

    Rate limit responses received by the client typically carry retryable semantics, and some include a suggested wait time in seconds. Your application logs should at minimum capture: timestamp, project identifier (redacted), model, estimated input/output tokens, HTTP status, error code, and whether a retry occurred. Without these fields, you can’t determine whether you hit TPM, RPM, or RPD.

    Building Resilient Clients

    Rate limiting is expected behavior—treat it as backpressure, not an exception to crash on.

    Estimate before sending. Before calling the API, estimate input tokens using a tokenization approach close to the server’s, and reserve a budget for output. Underestimating leads to sudden mid-generation exhaustion; overestimating makes you overly conservative and reduces throughput. Log your estimates and periodically compare them against actual token counts on your billing statement to correct the coefficient.

    Queues and concurrency caps. Keep worker thread counts within what your RPM can sustain. Use bounded queues for batch jobs, with queue length mapped to acceptable latency. When the success rate or token count in the last minute approaches a threshold proportion (e.g., 70–80%, tuned to your business tolerance), proactively slow down the producer rather than waiting to be rejected and retrying.

    Distinguish error types. Parameter errors, content moderation rejections, and insufficient balance should not enter rate-limit retry logic. Only clear rate limiting or transient overload warrants exponential backoff with random jitter, along with a maximum retry count and total wait time. Here’s illustrative logic, not a provider-specific interface:

    1. delay = base
    2. for attempt in 1..max_attempts:
    3. resp = call_model(request)
    4. if resp.ok:
    5. return resp
    6. if resp.error not in {rate_limited, overloaded}:
    7. raise resp.error
    8. sleep(min(delay, max_delay) + random_jitter)
    9. delay = delay * 2
    10. raise last_error

    Smooth the peaks rather than powering through. Cacheable system prompts, retrieval results, and repeated questions should not be recomputed from scratch on every call. Move offline jobs to off-peak hours; for online paths, keep only necessary context rather than resending full conversation history. When you need a higher daily request volume, evaluate whether to upgrade your usage tier or split projects—don’t rely on unbounded retries in your application.

    Multiple keys are not a magic accelerator. If several keys belong to the same project and tier, the total is usually still constrained by the project’s quota. Circumventing quotas, sharing others’ keys, or fabricating usage is neither stable nor compliant. Production environments should use proper key management and permission isolation within their own project.

    Capacity Planning and Monitoring

    Before launch, work backward from your target peak to all three metrics. Suppose you have N calls per minute at peak, with average input tokens Tin and output tokens Tout. Your per-minute token demand is roughly N × (Tin + Tout), plus headroom for retries and prompt expansion. If that exceeds your current TPM, either lower concurrency, shorten context, or request a higher tier—don’t try to “wait out” failures with longer timeouts.

    For monitoring, set up at least four alert types: a drop in one-minute success rate, a rising proportion of rate-limit errors, abnormal growth in token consumption, and a warning threshold when daily request volume approaches RPD. Alerts should point directly to the project and model so on-call engineers can open the quota page immediately, rather than hunting through business code.

    Load testing requires separate quota isolation. Sharing a project with production means test traffic can drain RPD early, or saturate RPM and cause production jitter. Safer practice: use a dedicated project and dedicated keys, then verify usage returns to normal after testing ends.

    Common Symptoms and Troubleshooting Order

    A burst of 429s (or equivalent rate-limit errors) that recovers after about a minute: suspect TPM or RPM first. Failures that begin later in the day and recover the next day: suspect RPD. Persistent failures unrelated to time: check your API key, model name, region, and account status instead of continuing to back off.

    When a tier “should have been upgraded but the limit is still low,” verify that cumulative spend meets the threshold and that any waiting period has elapsed, and confirm you’re looking at the project actually making the calls. A mismatch between the model shown in the console and the model in your code is another common pitfall: quotas are tracked per model or model family, and a wrong identifier yields completely different caps.

    In team documentation, maintain a single “Quota Notes” page: project, model, tier, the three caps, how the statistics window resets, where to check, the last verification date, and the degradation strategy (queue, reject, or defer to async) when limits are hit. When numbers change, update only this page—avoid relying on word of mouth.

    Summary

    TPM governs token throughput within a minute, RPM governs call counts within a minute, and RPD governs total requests within a day. Usage tiers determine the ceiling on all three and evolve with your billing and spend stage—but actual numbers must always be confirmed against the current console. Treat rate limits as capacity boundaries and design proactively across estimation, queuing, backoff, caching, and monitoring; this is far more reliable than unbounded retries during an incident. When integrating with Baidu AI Cloud or any other cloud-hosted model service, verify project tiers and real-time usage first, then decide whether to request higher quotas or adjust your calling pattern.