LLM API Pricing: How Billing Rules Determine Your Monthly Cost
Teams often compare LLM API costs by looking only at per-million-token input and output prices, yet identical unit prices can produce very different monthly bills. This article breaks down the billing rules behind the unit price—context caching, batch and off-peak discounts, free quotas and tier thresholds, subscription plans, regional pricing, and model retirement—and provides a practical checklist for estimating effective cost with real traffic patterns.
In model service procurement and technical selection, many teams start by opening each provider’s pricing page, comparing the “per-million-token input/output price,” and choosing the provider that looks cheapest. In real engineering practice, however, we often see a counterintuitive result: the metered unit prices for the same model on several platforms are nearly identical, but the month-end bills can differ by half or more. The reason is not mysterious—the unit price is only the most superficial variable in a billing system. What really determines cost is the full set of billing rules around that unit price. This article breaks those rules down.
1. Metered Unit Price: Only the Starting Point for Cost Estimation
Metered billing for LLM APIs usually consists of three numbers:
- Input price: the prompt portion is billed by token count.
- Cache hit price: prefixes that hit the context cache are billed at a unit price far below the standard input price, commonly around one-tenth of the input price.
- Output price: the model-generated portion is billed, usually several times the input price.
Take a common industry pricing structure as an example. A flagship model from a given generation might be priced at CNY 20 for input, CNY 2 for cache hits, and CNY 100 for output (CNY per million tokens). A lightweight or previous-generation model might use a combination such as 13 / 1.3 / 68. If you only perform a static comparison, these three sets of numbers are often the same across several platforms—because the model provider’s guide price is usually aligned across distribution channels.
This means the information gained from “looking only at unit price” during selection is close to zero. The real differences are hidden in the following types of rules.
2. Rule 1: Billing Details of Context Caching
Context Caching is the most important cost-reduction mechanism for long conversations, RAG, and multi-turn agent scenarios. If requests with the same prefix hit the cache, only the cache price is paid for the input portion. But two easily overlooked points matter:
- Cache writes may be billed separately. Some platforms charge storage fees for cache writes based on TTL (for example, 5 minutes or 1 hour), and only charge the hit price after a cache hit. If your traffic pattern is “many writes, few hits,” caching can actually increase cost.
- Whether caching is automatically enabled or explicitly enabled. Some platforms automatically enable caching for repeated prefixes and bill according to a default TTL, without developers even being aware of it. This requires you to distinguish between two cost models during load testing: “with cache” and “without cache.”
A simple estimation function:
def cost(input_tokens, cached_tokens, output_tokens,p_in, p_cache, p_out):uncached = input_tokens - cached_tokensreturn (uncached * p_in + cached_tokens * p_cache+ output_tokens * p_out) / 1_000_000# Example: cost difference when 80% of input hits cacheprint(cost(1e6, 0, 2e5, 20, 2, 100)) # CNY 60print(cost(1e6, 8e5, 2e5, 20, 2, 100)) # CNY 28
For the same business traffic, raising the cache hit rate from 0 to 80% can cut the bill by more than half—and this variable is completely invisible on the pricing page.
3. Rule 2: Batch Processing and Off-Peak Discounts
Many platforms offer discounts for non-real-time scenarios, typically in two forms:
- Batch API: allows asynchronous submission and promises to return results within a few hours, with the unit price reduced to around 60% of the standard price. It is suitable for offline data labeling, batch summarization, evaluation scoring, and similar scenarios.
- Off-peak rules: in subscription plans, calls during low-traffic periods are settled according to more favorable logic.
If half of your business traffic can be made asynchronous and sent entirely through the batch channel, the effective unit price drops directly to about 60% of the standard price—this has nothing to do with the metered unit price, yet it directly determines the monthly bill. Developers should map out the traffic structure as early as possible: which requests users wait for in real time, and which can tolerate minute-level latency. The latter should be migrated to discount channels whenever possible.
4. Rule 3: Free Quotas and Tier Thresholds
In the early stage of a new model launch, some platforms provide one-time free quotas (for example, a trial quota of several million tokens) or monthly resource packs. These quotas do not appear in the unit price, but for PoC stages and small teams they may cover a significant proportion of the bill. When evaluating them, pay attention to the validity period, applicable model scope, and whether they can be combined with discounts.
5. Rule 4: Subscription and Package Models
In addition to metered billing, some channels offer subscription-style token packages: pay monthly in exchange for a certain token quota or discount rate. The advantage of subscriptions is that costs are predictable and can be capped. The disadvantage is that the unit price for overage may be higher than the metered price, and when utilization is low, a subscription can actually be more expensive. Choosing between subscription and metered billing should be based on a break-even calculation using the real usage distribution over the past 1–3 months:
Monthly usage Q (million tokens), metered unit price p, subscription fee S (includes quota Q0, overage unit price p')If Q <= Q0: subscription is better (S < Q*p)If Q > Q0: compare S + (Q-Q0)*p' with Q*p
6. Rule 5: Regional and Deployment Area Price Differences
The same cloud provider may have different prices in different regions. Regions serving overseas users (such as Singapore) may have unit prices nearly 10% higher than domestic regions due to infrastructure and compliance costs. If the business does not have strict requirements for low latency overseas, choosing a more cost-effective region for the inference endpoint is a pure bill optimization. Conversely, cross-border calls also require comprehensive consideration of network latency, data compliance, and egress bandwidth costs.
7. Rule 6: Retirement Pace of Old Models
Model version iteration affects long-term cost planning. A common situation is that an old series is closed to new users and planned for full shutdown within a few months, with official guidance to migrate to a newer generation. Migration decisions cannot rely only on the unit prices of the old and new models; they must also evaluate quality gaps, cache strategy compatibility, and prompt rework costs. Building a model abstraction layer in advance (a unified gateway and routing configuration) can make this kind of switch controllable in cost.
8. Implementation Suggestions: A Selection Checklist
Based on the analysis above, when making model API procurement decisions, check each item below rather than looking only at the first three columns of a pricing page:
- Confirm the complete values of the three prices: input, cache hit, and output. Ask the channel about any missing columns.
- Confirm cache rules: whether caching is automatically enabled, TTL tiers, and whether writes are billed separately.
- Confirm discount channels: whether batch processing is supported, the discount ratio, and the return-latency commitment.
- Confirm free quotas and subscription options: applicable scope, stacking rules, and overage unit price.
- Confirm regional pricing: the full price list for the regions where your target users are located.
- Estimate with your own real traffic: measure the cache hit rate and the ratio of real-time to offline traffic, apply the cost function above to calculate the effective unit price, and then compare providers side by side.
Conclusion
Cost differences among LLM APIs are never determined by the “unit price table.” They are determined jointly by cache strategy, traffic structure, discount channels, package forms, and regional choices. Treat billing rules as part of system design—optimizing token flow the way you would optimize a database query plan—is the right way for engineering teams to control AI costs. A pricing page can tell you “how much per million tokens,” but only your own call logs can tell you what your month-end bill will really look like.
