LLM API Cost Comparison: Why Identical Token Prices Lead to Different Bills
Identical per-token prices do not guarantee identical LLM API bills. This article explains how context caching, batch inference, free credits, subscriptions, and regional pricing affect costs across platforms. It also covers model retirement risks and provides a practical workflow for estimating monthly spending and reducing avoidable costs.
1. Why Comparing Token Prices Is Not Enough
As multicloud deployments become more common, the same open-source or licensed model may be available through several managed cloud services. Teams often compare pricing pages, check the input and output rates per million tokens, and choose whichever platform appears cheapest or most convenient.
That approach stops being useful when the published token rates are identical.
Consider a hypothetical model lineup offered by four platforms:
| Model tier | Input price per million tokens | Cached input price per million tokens | Output price per million tokens |
|---|---|---|---|
| Flagship model | CNY 20 | CNY 2 | CNY 100 |
| Second-tier model | CNY 13 | CNY 1.3 | CNY 68 |
| Code-specialized model | CNY 6.5 | CNY 1.3 | CNY 27 |
These illustrative rates are identical across all four platforms. Based on the table alone, their bills should also be identical. In practice, monthly bills can differ by 30%–50%.
The reason is that per-token pricing is only the headline rate. The final bill depends on the rules surrounding it: caching policies, discounted processing options, free allowances, subscription plans, and regional pricing.
Those rules may appear in pricing footnotes, billing documentation, or service announcements rather than the main pricing table. Understanding them is essential to making a meaningful cost comparison.
2. Five Billing Rules That Can Create Large Cost Differences
2.1 Context Caching: A Hidden Discount for Repeated Inputs
Input tokens typically cost less than output tokens, but long-context applications can repeatedly send large amounts of identical content. Examples include retrieval-augmented generation (RAG), multi-turn conversations, and long-document analysis.
Many platforms offer context caching. Eligible repeated prefixes can be served from cache and billed at a substantially lower input rate—often around 10% of the standard input price.
However, caching comes with three important details:
- Time to live (TTL): Cache entries usually have a defined lifetime, such as five minutes. If the next request arrives after the entry expires, the repeated content becomes a cache miss.
- Cache write charges: Some platforms charge separately for writing content to the cache. Write rates may vary by TTL tier, such as five minutes or one hour. A longer TTL can improve the hit rate but may cost more to establish.
- Prefix matching requirements: Cache hits generally require an exact match with an existing cached prefix. Timestamps, random IDs, or other dynamic values embedded early in a system prompt can sharply reduce the hit rate.
Practical guidance: Put stable content—system instructions, knowledge-base documents, and few-shot examples—at the beginning of the prompt, and place dynamic content afterward. For multi-turn conversations, evaluate whether a longer TTL justifies its write cost. Replay representative traffic before deployment to measure the actual cache hit rate.
2.2 Batch Inference: A Discounted Channel for Non-Real-Time Work
Many platforms offer batch processing, allowing jobs to be submitted asynchronously and completed within several hours to 24 hours. The trade-off is typically a 40%–50% discount, meaning eligible usage is billed at roughly 50%–60% of the standard rate.
The key question is which workloads can tolerate delayed results:
- Suitable for batch processing: Offline data labeling, dataset cleaning, benchmark evaluations, report generation, and retrospective content moderation.
- Usually require real-time processing: Interactive chat, agent tool-calling loops, and streaming interactions.
A common mistake is routing every workload through the real-time API by default.
If a team moves 60% of its total usage—representing offline work—to a batch API, a 50% batch discount can reduce the overall bill by about 30%, despite unchanged headline token prices.
Some platforms offer batch discounts for both flagship and second-tier models. Confirm that the specific model you intend to use is eligible rather than assuming the discount applies to the entire catalog.
2.3 Free Credits: Useful for Testing, Not a Long-Term Cost Model
When a new model launches, some platforms offer new users free tokens—for example, one million tokens—or temporary discounts.
These offers can be valuable for a proof of concept (POC) or small-scale trial. Their effect on sustained production spending is usually limited.
The right approach is to use free allowances for technical validation, but calculate long-term costs using the applicable full rates. Treating a temporary promotion as a recurring benefit is a common budgeting mistake.
2.4 Subscriptions and Off-Peak Discounts: A Different Cost Structure
Beyond pay-as-you-go billing, some platforms provide monthly token plans or discounted access during low-demand periods.
Subscriptions are best suited to workloads with stable, predictable consumption. Off-peak pricing can suit offline tasks that can be scheduled overnight, such as daily summaries or scheduled quality checks.
The most important subscription detail is which models the plan covers. A plan that excludes your primary model may provide little value.
Off-peak offers also have defined time windows and may involve queueing. Evaluate whether the workload can genuinely tolerate the resulting delay.
2.5 Regional Pricing: An Often-Overlooked Cross-Border Premium
The same model can have different prices in different service regions.
For example, some providers may charge 5%–10% more in an international region such as Singapore than in their mainland China regions. Differences in compute, bandwidth, and compliance costs can contribute to that premium.
For services supporting users across borders, the options may include:
- Run inference near users: Accept a higher regional price in exchange for lower latency and support for applicable data-localization requirements.
- Use a lower-priced region: Route inference there only when cross-border data transfers are permitted and the latency is acceptable.
- Use a hybrid architecture: Keep interactive sessions near users while placing eligible offline batch workloads in a lower-priced region.
Region selection is therefore both a cost decision and a latency and compliance decision—not simply a search for the lowest token rate.
3. Model Lifecycle Risk: Retirement and Migration Costs
Token charges are not the only cost to consider. Model retirement can create substantial engineering and operational expense.
Older models may first stop accepting new users and then be fully retired by a specified deadline. If an application is tightly coupled to a retiring model, migration can require:
- Retuning prompts because instruction-following behavior differs between models.
- Adapting output parsing logic.
- Running regression tests and quality evaluations.
- Paying for parallel calls during a staged rollout, potentially doubling inference spending for the duplicated workload.
Practical guidance: Introduce a model-routing abstraction through a unified inference gateway. Application code should use a consistent request and response contract, while the underlying model remains configurable.
This can help reduce migrations from month-long projects to changes measured in days, although prompt tuning and evaluation still need to be completed.
4. A Practical Method for Estimating Monthly Costs
Use the following workflow to move from headline pricing to a realistic monthly estimate:
- Break down traffic: Measure token usage by real-time versus batch processing, cache hits versus misses, model, and region.
- Apply the relevant rates: Bill cached inputs at the cache-hit rate, eligible batch usage at the batch rate, and standard real-time usage at the full rate.
- Include cache writes: Calculate write charges from the tokens written, the applicable TTL-tier rate, and the number of refreshes.
- Account for subscriptions: Apply eligible subscription allowances, then calculate pay-as-you-go charges for the remaining usage.
- Reserve a 10%–15% budget buffer: Allow for traffic fluctuations, retries, and evaluation workloads.
For cache writes, a useful calculation is:
Cache write cost = tokens per write × write rate × number of writes or refreshes
If your usage records already contain the total number of tokens written across all refreshes, do not multiply by the refresh count again.
The following pseudocode summarizes the core calculation:
def monthly_cost(usage):cost = 0# Real-time traffic: separate cache hits from missescost += usage.realtime.input_cache_hit * price.input_hitcost += usage.realtime.input_cache_miss * price.input_stdcost += usage.realtime.output * price.output# Cache write cost, based on the TTL tiercost += usage.cache_write * price.cache_write[ttl]# Batch traffic: apply the discounted ratecost += usage.batch.total * price.std * batch_discount# Apply the subscription allowance before pay-as-you-go settlementreturn max(cost - usage.subscribed_quota, 0)
This is a simplified billing sketch. Token quantities and rates must use consistent units: rates quoted per million tokens require corresponding normalization. Input and output usage must also be priced separately when their rates differ. Likewise, the final subtraction assumes the subscription allowance is represented as an eligible monetary credit; a token allowance must be applied to the covered usage instead.
5. Platform Selection: What Matters Most
Why can four platforms with identical token prices produce bills that differ by as much as half?
Identical unit prices are only the starting point. Actual costs depend on caching behavior, batch utilization, subscription fit, temporary allowances, and region selection.
Three priorities can make comparisons more useful:
- Read the billing documentation, not just the pricing page. Pay particular attention to cache TTLs, batch-discount eligibility, and regional price differences.
- Optimize traffic before focusing solely on platform choice. Moving offline work to batch processing and improving prefix cache hit rates can often reduce bills by 20%–40%, depending on the workload and applicable billing rules.
- Decouple applications from individual models through a routing gateway. This reduces the cost of model retirement and platform migration.
For LLM cost management, disciplined engineering and accurate usage accounting often matter more than which provider has the most attractive headline price.
