LLM Subscription Tiered Quotas and Rate Limiting Design
This article explains the technical design behind tiered LLM subscription plans. It covers quota multipliers, token-based metering, reserve-and-settle accounting, idempotent quota management, distributed consistency, multi-level rate limiting, reset policies, alerts, cost control, capacity planning, observability, fair use, and user-facing usage transparency.
1. The Logic Behind LLM Subscription Tiers
LLM subscription services often label plans as “expanded usage” or “maximum usage.” A common structure is to use a standard tier as the baseline, with an advanced tier at about 5× and a premium tier at about 20×, billed monthly. For users, the plan name is mainly a purchase entry point. For platform engineers, each tier represents a complete system covering metering, rate limiting, accounting, and billing. Understanding what the multiplier actually scales is necessary to evaluate a usage system or make design trade-offs.
1.1 Elastic Compute Costs Make Tiered Pricing Necessary
Traditional software has low marginal cost after release. LLM inference is different: each request consumes GPU compute and memory, and a single conversation turn or code-generation task may differ in resource usage by tens of times. Total cost is highly correlated with actual usage.
If a single unlimited monthly plan is offered, heavy users may consume far beyond the cost covered by their subscription. If quotas are kept uniformly low, light users may feel they cannot use what they paid for. Tiered subscriptions align willingness to pay with consumption scale, protect user experience, and keep costs within bounds.
1.2 What the Multiplier Actually Scales
The high tiers are described as “expanded usage” and “maximum usage,” with usage or rate limits at 5× and 20× the standard tier. Two points must be clarified during design.
First, the multiplier scales quota, not model capability. Users across tiers access the same model; quality does not vary by tier. Differences are limited to available usage and speed, so upgrade expectations match actual benefits.
Second, periodic quota and instantaneous rate are independent constraints:
- Periodic quota: cumulative usage allowed within a statistical period, such as total tokens per day or per month. After it is exhausted, the user waits for reset.
- Instantaneous rate: requests or tokens allowed per unit time, protecting backend inference clusters from sudden bursts.
Both must be enforced. Quota-only controls cannot absorb burst traffic; rate-only controls cannot limit long-period accumulation. Therefore, “expanded” and “maximum” tiers raise both the periodic quota and instantaneous rate by the corresponding multipliers.
1.3 A Practical Example
Assume the standard tier has a daily quota of 1 million tokens and a peak rate of 40,000 tokens per minute. Under the multiplier model, the expanded tier is approximately 5 million tokens per day and 200,000 tokens per minute, while the maximum tier is approximately 20 million tokens per day and 800,000 tokens per minute. All values are illustrative.
| Tier | Periodic quota (tokens/day) | Instantaneous rate (tokens/minute) | Typical usage |
|---|---|---|---|
| Standard (baseline) | 1,000,000 | 40,000 | Daily Q&A and light code assistance |
| Expanded (~5×) | 5,000,000 | 200,000 | Frequent long conversations and complete module generation |
| Maximum (~20×) | 20,000,000 | 800,000 | All-day continuous use and parallel tasks |
This example shows that a maximum-tier user could theoretically exhaust a full day’s quota in about 25 minutes. The system must accept burst traffic while clearly signaling when quota is exhausted. These are two core questions for a tiered quota system.
2. Usage Metering: Quantifying Consumption
All quota management starts with metering. If the measurement basis is inaccurate, limits, billing, and reporting lose their foundation.
2.1 Tokens as the Unified Metering Unit
LLMs process text in tokens. English text is roughly split into words or subwords, while Chinese text is usually split into characters or common words. Token counts may vary across tokenizers, so metering should follow the tokenizer used by the actual inference service, and documentation should explain estimation methods.
Counting characters or requests is not precise enough. A short long-form summary of a few hundred characters and a code completion task of thousands of lines can differ greatly in resource consumption.
The basic formula is:
Tokens per request = input tokens (system prompt + conversation history + user message + tool results)+ output tokens (model-generated text, code, structured results, etc.)
2.2 Commonly Overlooked Hidden Consumption
In multi-turn conversations, document parsing, and coding scenarios, the following costs are easily missed:
- Conversation history: each turn resends all previous messages, which may consume several times the user’s actual input.
- System prompts: fixed instructions and templates accompany every request and can be significant in high-frequency short requests.
- Tool calls and function execution results: returned data becomes new input and creates multi-turn consumption.
- Retries and timeouts: automatic retries create extra usage; the policy must specify whether they count against user quota.
- Multimodal input: images and audio are usually counted as converted token counts.
3. Quota Management: Reserve and Settle
3.1 Why Reserve First?
The exact output length is unknown before a request completes. If quota is deducted only at the end, a user can launch concurrent requests and exhaust backend compute before the system detects overage. A common pattern is to reserve an estimate before inference, then settle using actual usage and refund the unused reservation.
# Example: per-user remaining-token counterReserve phase:estimated = count_tokens(all_input) + MAX_OUTPUT_TOKENSremaining = atomic_subtract(user_quota_key, estimated)if remaining < 0:atomic_add(user_quota_key, estimated) # roll back and rejectreturn error("Insufficient quota")return estimated # record reserved amount for settlementSettle phase (after the request ends, whether successful, failed, or cancelled):actual = count_tokens(all_input) + count_tokens(generated_output)refund = estimated - actualif refund > 0:atomic_add(user_quota_key, refund) # refund over-reservationif refund < 0:# actual output exceeded the estimated cap; deduct the difference# the counter may temporarily go negative and be reconciled lateratomic_subtract(user_quota_key, -refund)
3.2 Idempotency and Consistency
Reserve and settlement must be exactly-once. In streaming output, network jitter, or service restarts, settlement may be triggered repeatedly. A robust approach is to assign a unique request identifier and track lifecycle in a state table.
| Field | Purpose |
|---|---|
| Request ID | Globally unique idempotency key |
| User and tier | Used for attribution and applying the correct multiplier |
| Reserved tokens | Amount locked or deducted during reservation |
| Actual tokens | Backfilled during settlement |
| Status | Processing, settled, or rolled back |
| Timestamp | Helps detect zombie requests that are never settled |
Before settlement, atomically change the state from “processing” to “settled.” Duplicate requests can return immediately if the state has already changed. For requests that remain unsettled for too long, a scheduled job should roll them back to prevent permanent quota occupation.
3.3 Consistency in Distributed Environments
With multiple instances, all limit checks and deductions should be atomically executed in centralized storage. A common approach is to use an in-memory key-value store that supports atomic increment and decrement, with key expiration for periodic reset.
As user volume grows, fully centralized counters can become hotspots. Possible optimizations include:
- Sharded counters: split one user’s counter into shards and aggregate on read.
- Local token prefetch: each node fetches a batch of tokens based on estimated traffic and reconciles with the central counter periodically. This trades slight precision for higher throughput.
- Layered rate limiting: coarse request-count limits at the edge and fine-grained token limits at the inference layer.
4. Rate Limiting: Multi-Level and Multi-Dimensional Control
4.1 Algorithm Boundaries
- Fixed-window counting: simple, but can allow a double burst at window boundaries. With a limit of 60 requests per minute, a user sending 60 at 00:59 and 60 at 01:00 can make 120 requests within two minutes.
- Sliding window: uses ordered sets of timestamps for precise counting, but memory grows with request volume.
- Token bucket: refills tokens at a fixed rate; bucket capacity defines burst tolerance. It naturally supports short bursts and fits interactive Q&A patterns of “think briefly, then ask in batches.”
- Leaky bucket: processes requests at a constant rate, smoothing output and protecting downstream inference, but may reduce user experience.
4.2 Two-Dimensional Rate Limiting
Whether limits are based on request count or token count, both request frequency and token throughput should be constrained. A recommended approach is to use tokens as the unified currency: each request acquires tokens based on “input tokens + estimated output tokens,” while request-frequency limits prevent extremely short requests from being abused.
# Two-dimensional rate limiting exampleRequests per minute cap:requests_per_minute = base_rpm * multiplierTokens per minute cap:tokens_per_minute = base_tpm * multiplierAdmission check:cost = count_tokens(input) + estimated_output_tokensif not token_bucket.try_acquire(cost, tokens_per_minute):return reject("Token rate limit exceeded")if not sliding_window.allow(key = user_id, limit = requests_per_minute, window = 60):return reject("Request rate limit exceeded")proceed_to_inference()
4.3 Multi-Level Limits and User-Group Isolation
A single user-level limit is insufficient. A complete system usually includes multiple layers:
- API-level: capacity limits per endpoint to prevent an expensive feature from degrading the whole system.
- User-level: limits corresponding to subscription multipliers.
- Organization-level: shared pools for team or enterprise workspaces, with administrator-assigned member quotas.
- Global-level: platform-wide capacity thresholds for burst protection.
When load approaches a threshold, degradation can be applied differently across tiers. For example, standard-tier burst rates may be limited first to protect service commitments for higher tiers.
4.4 Rejection Responses Should Be Understandable and Actionable
When a request is throttled, the response should explain why the limit was hit, when it will recover, and what the user can do. Useful fields include exception type, current limit, reset time or recommended wait seconds, and remaining quota after recovery. These values should match the numbers shown in the usage dashboard. Clients should also use exponential backoff with jitter to avoid simultaneous retries causing a secondary burst.
5. Period Reset and Quota Alerts
5.1 Choosing a Reset Boundary
- Natural day/month reset: easy for users to understand, but can create a “month-start peak.”
- Rolling window (such as the last 24 hours or last 30 days): smoother traffic, but users may find recovery harder to predict.
- Account-aligned cycles: anchored to registration or renewal dates, making billing clearer, but requiring per-user cycle state.
5.2 Instantaneous Pressure at Reset
If all users regain quota at the same moment, previously rejected requests can rush in, creating a thundering-herd effect. Common mitigations include:
- Tiered restoration: divide the daily quota into time slots. For example, restoring 1/12 of the daily quota each hour lets users consume the full amount smoothly over a day.
- Randomized reset times: assign slightly different reset points within a cycle to spread peaks.
With tiered restoration, “1 million tokens per day” effectively means an average pace of about 42,000 tokens per hour. This should be explained in product documentation so users do not assume they can consume the full quota instantly.
5.3 Threshold Alerts and Over-Quota Policies
Alerts are recommended at 80% and 95% of quota usage, delivered through in-product messages, email, or other channels. The over-quota strategy should be defined during design.
| Strategy | Behavior | Advantage | Risk |
|---|---|---|---|
| Hard rejection | Return quota-exhausted response and wait for reset | Clear cost boundary | Interrupts user workflow |
| Temporary buffer | Allow limited overage and deduct it first in the next cycle | Smoother experience | Requires preventing accumulated debt |
| Automatic downgrade | Switch to a lighter or cheaper model and continue service | Maintains availability | Must be disclosed to avoid quality expectation gaps |
| Add-on purchase | User buys a one-time or monthly usage pack | Balances experience and revenue | Depends on mature billing and payment capabilities |
Regardless of strategy, quota decisions should be centralized in an independent quota service rather than scattered across business endpoints. This reduces maintenance cost and makes policy changes easier.
6. Cost Control and Capacity Planning
6.1 Aligning Quotas with Unit Economics
Subscription multipliers are commercial commitments. Engineering teams must answer whether the marginal cost of high-tier users remains below subscription revenue. A practical approach is to build a cost model for each tier:
Daily cost ceiling per tier ≈ daily quota (tokens) × unit token inference cost × safety factor
The safety factor covers retries, invalid outputs, and uneven peak usage. If the theoretical ceiling cost exceeds acceptable limits, the design can be adjusted by lowering multipliers, adding output-length caps, routing simple tasks to cheaper models, or offering dedicated deployment for heavy users.
6.2 Reducing Unit Cost Through Architecture
Cost control should not rely only on restricting users; inference efficiency should also improve:
- Semantic caching: reuse results for identical or highly similar requests. Cache invalidation and isolation must be carefully designed to avoid reusing content across users or permission scopes.
- Model tiering and routing: route simple tasks to lighter models and complex tasks to higher-performance models.
- Context compression: summarize conversation history or retrieve only relevant snippets to reduce repeated input tokens.
- Batching and asynchronous queues: use batch APIs or message queues for non-real-time tasks to smooth peaks and improve cluster utilization.
- Quantization and inference acceleration: apply model quantization, dynamic batching, and other general optimizations when quality remains acceptable.
6.3 Capacity Planning and Elastic Scaling
Capacity planning can start from two directions:
- Estimate peaks from user behavior: if users in a tier work 8 hours per day and active time is half of that, average demand per minute is roughly daily quota divided by 480. Because interactive traffic is bursty, a peak factor of 2–4 is commonly used.
- Derive sellable capacity from cost: using single-card throughput and unit cost, determine the maximum number of users each tier can support under current resources.
Cloud platforms commonly provide containers, autoscaling, load balancers, and message queues. These can be used to build inference gateways and asynchronous task chains while maintaining stability and reducing idle cost. When deploying on self-managed or partner platforms, general-purpose products such as containers, object storage, message queues, logging, and monitoring/alerting from platforms like Baidu AI Cloud can also be used to build these pipelines.
7. Observability, Security, and Fair Use
7.1 Key Metrics
- Business metrics: active users per tier, average token consumption per user, quota utilization distribution, rate-limit rejection rate, and share of over-quota users.
- Technical metrics: inference latency, especially time-to-first-token and P95/P99 throughput, GPU utilization, and queue backlog.
- Billing metrics: reserve-settlement differences, rollback counts, and negative-counter occurrences.
Quota utilization distribution deserves special attention. If many users stay above 80% for long periods, the tier design may be too tight. If most users stay below 10% for long periods, the tiers may be too loose, weakening traffic shaping and creating capacity-planning uncertainty.
7.2 Exception Handling
| Scenario | Handling |
|---|---|
| User cancellation or connection drop | Settle generated content and refund unused reserved quota promptly |
| Server error | Distinguish retryable from non-retryable errors; retry automatically and count usage for the former; fully refund the latter |
| Lost settlement message | Repair through timeout scans and reconciliation jobs |
| Counter drift | Periodically calibrate balances using detailed usage records |
All metering events should be written to a logging service and retained as raw records for audit and appeals, ensuring every deduction is traceable.
7.3 Security Boundaries and Fair Use
- Prevent quota reselling: quotas are for individual use. Account sharing, bulk script registration, and proxy forwarding should be prohibited and detected through device fingerprints, call-pattern analysis, and other general risk controls.
- Prevent cost-avoidance abuse: some users may split tasks into many extremely short requests to bypass token-based limits. Request-frequency limits are a supplementary defense for this pattern.
- Fair queues: under high load, assign priority queues by tier so high-tier users experience relatively stable waiting times.
- Intra-organization fairness: team workspace quotas should not be exhausted by a few members. Member-level sub-quotas and alerts can help.
8. User-Facing Usage Transparency
Quota systems must be visible to users. A good usage experience includes at least four parts:
- Real-time usage dashboard: show used and remaining quota for the current cycle, consumption trends by day or hour, and the current tier and multiplier.
- Clear status messages: warn users before they approach the limit, and explain the reason and recovery method when quota is exhausted.
- Smooth upgrade paths: when users frequently hit limits, provide tier comparisons and an upgrade entry so upgrading feels natural rather than forced.
- Change transparency: announce changes to multipliers, metering rules, or rate-limit policies in advance, including effective dates, to maintain trust.
From an engineering perspective, usage state can be encapsulated as a unified query capability shared by the frontend dashboard, API response headers, and alert notifications, preventing inconsistent numbers across surfaces.
9. Summary
Plans such as “expanded usage” and “maximum usage” are engineering implementations of a simple goal: let users with different usage intensities get what they need while keeping platform cost controllable and service stable. A mature tiered quota system should answer the following questions in order:
- Is the metering unit unified and does it cover all hidden consumption?
- Are reservation and settlement idempotent, rollback-capable, and reconcilable?
- Do rate limits operate across multiple levels and dimensions at the same time?
- Are period resets smooth, and are over-quota policies clear?
- Can the cost model support the commercial promise behind each multiplier?
- Can metrics, logs, and alerts detect anomalies in time?
- Can users see their usage and status at any time?
Addressing these questions in design and code turns tiered subscriptions from a price table into a sustainable technical foundation.
