Why LLM API Bills Can Differ by 2x at the Same Token Price
When per-token prices look identical across cloud platforms, monthly LLM API bills can still vary by nearly double. The difference comes from billing model structure rather than unit price. This article breaks down the core cost formula, explains how input/output ratios, cache hit rates, and deferrable traffic shape your bill, and outlines four billing rules—pay-as-you-go, caching, batch processing, and subscriptions with off-peak scheduling. It also provides a four-step decision path, commonly overlooked details, and a cost governance checklist to turn model spending into a measurable engineering metric.
1. The Problem: Same Unit Price, Different Bills
A common pattern in real model integration projects is this: you take the same call volume to the price lists of different cloud platforms, and the pay-as-you-go unit prices are almost identical, yet the end-of-month bills can differ by nearly 2x. The reason is not the “unit price” but structural differences in billing models. The pay-as-you-go price is only a two-dimensional parameter (input price, output price, plus a discounted price for cache hits), while a bill is three- or even four-dimensional: call structure (the ratio of input/output/cache hits), time distribution (peak vs. off-peak), task type (real-time synchronous vs. deferrable batch), and whether prepaid resource packages are used.
So when choosing a platform, what you really need to compare is not “how much per million tokens” but “which billing rule does my traffic pattern fall under.” Below, we break the bill into calculable parts.
2. The Basic Bill Formula and Cost Profile
The cost of any single call can be abstracted as:
cost_per_call = input_tokens/1e6 * P_in+ cached_tokens/1e6 * P_cache+ output_tokens/1e6 * P_out+ cache_write_tokens/1e6 * P_write (if the platform bills cache writes separately)monthly_bill = Σ cost_per_call * (1 - batch_discount) - free_tier - resource_package_credits
From this, the bill is highly sensitive to three ratios:
- Input/output ratio. The output price is usually several times the input price, so long-text generation workloads are dominated by output-side costs; whereas code completion and document summarization have input far exceeding output, concentrating costs on the input side.
- Cache hit rate. Cached portions are billed at a discounted rate, so raising the hit rate from 0 to 50% can roughly halve input-side costs.
- Deferrable ratio. The share of calls that can be scheduled to off-peak or batch channels directly determines whether discounts apply.
The recommendation is for teams to first build a “cost profile”: collect one week of real traffic, compute the three ratios above, and only then discuss optimization. Optimization without a profile is guesswork.
3. Applicability Boundaries of the Four Billing Rules
3.1 Pay-as-you-go: The Baseline
The advantage is zero prepayment and no idle waste, making it suitable for volatile traffic or newly launched services. The downside is that there are no discounts at all, so it represents the upper bound of the bill.
3.2 Cache Billing: Best for Repeated Prefixes
The mainstream approach automatically caches repeated prefixes and sets a relatively short default time-to-live (commonly on the order of minutes). Two things need attention: first, cache writes may be billed separately, priced at shorter or longer TTL tiers; second, hits only apply to fully identical prefixes. In engineering terms, stable content such as system prompts, tool definitions, and long documents should be placed at the front and kept byte-for-byte unchanged, avoiding the insertion of timestamps or random IDs in the middle that would invalidate the prefix.
# Bad example: volatile content placed first, so the cache never hitsprompt = f"current time {now()} you are an assistant...{system}{doc}"# Good example: stable prefix first, volatile content afterprompt = f"{system}{doc}\ncurrent time {now()} user question {q}"
3.3 Batch and Async Channels: The Source of Discounts for Offline Tasks
Submitting non-real-time tasks to an asynchronous batch channel usually earns a significant discount (commonly around half price in the industry). Applicable scenarios include log labeling, offline summarization, batch translation, data cleaning, and evaluation runs. The cost is that latency shifts from seconds to minutes or hours, so it must be paired with a task queue and a result write-back mechanism.
3.4 Subscriptions and Off-Peak Scheduling: Peak-Shaving for Stable Traffic
Prepaid resource packages or subscription plans lower unit costs through “monthly quota + pay-as-you-go overage.” Their core benefits come from two points: first, locking predictable baseline traffic within a discounted price; second, scheduling movable calls into low-demand periods. If a business can shift a substantial share of calls to nighttime off-peak hours, the overall cost reduction will clearly exceed the gains from simply switching platforms.
4. Decision Path: Four Steps to the Lowest-Cost Option
- Determine whether the task is deferrable. Send the deferrable portion to batch; for the non-deferrable portion, look at time distribution next.
- Determine prefix repetition. High repetition calls for cache refactoring first—this is the step with the highest return on investment.
- Determine traffic predictability. If the baseline is stable and high-volume, consider a subscription plus overage; if spikes are pronounced, keep pay-as-you-go as a fallback.
- Determine deployment location. If the business already runs on a given cloud, connecting to the model service on the same cloud nearby avoids cross-network transfer and compliance review costs, and when fees match the original vendor’s, there is no reason to take a detour.
It is worth emphasizing that when multiple platforms have identical pay-as-you-go unit prices, the comparison should shift entirely to the rule layer rather than continuing to negotiate the unit price.
5. Three Easily Overlooked Details
- The cache “hit price” is not “free”—the write side can still incur charges, and short vs. long TTL should be chosen according to the business’s repetition cycle.
- The retirement pace of older-generation models. Vendors usually announce that a generation stops opening to new users and is gradually taken offline, with official guidance to migrate to the new generation. Architecturally, the model identifier should be a configuration item rather than scattered across the code.
- Regional differences. Overseas regions generally have higher unit prices than domestic ones, and some platforms may not publicly list cache prices, so cost accounting should be based on the actual bill with a margin reserved for uncertainty.
# Model identifiers and routing made configurable, so they can switch as prices and availability changeROUTES = {"chat": {"model": "pro-tier", "endpoint": "cn-north", "batch": True},"code": {"model": "code-tier", "endpoint": "cn-north", "batch": False},"offline":{"model": "pro-tier", "endpoint": "cn-north", "batch": True, "offpeak": True},}
6. Cost Governance Checklist
- Build a daily token and cost dashboard with at least three columns: input, output, and cache hits.
- Set a per-request cost ceiling for each workload, with alerts on breach rather than after-the-fact review.
- Version-control prompts, and evaluate cache hit rate changes for any modification.
- Physically isolate batch and real-time pipelines to prevent offline tasks from crowding out real-time quota.
- Review price and rule changes once per quarter, folding “unit price unchanged, rules changed” into routine review.
7. Conclusion
Identical unit prices but a 2x bill difference is essentially a matching problem between traffic patterns and billing rules. The executable order is: first build a cost profile, then use cache refactoring to lower the input side, use batch processing and off-peak scheduling to lower the deferrable portion, use subscriptions to lock in a stable baseline, and finally connect nearby according to deployment location. Solidifying these four steps into a process turns the model bill from an uncontrollable expense into an accountable, optimizable engineering metric.
