The Real Cost of LLM API Calls: A Practical Guide to Cache Pricing and Subscription Plans
Comparing LLM pricing by a single headline number—such as a cache-read rate or an off-peak input discount—often leads to misleading conclusions. This guide walks through how to calculate true token costs: clarifying cache hit-rate denominators, building auditable cost formulas, running sensitivity analysis, finding break-even points between pricing structures, weighting time-of-use pricing by actual usage, evaluating subscription plans by effective utilization, and tracking cost per successful task. All figures are illustrative assumptions, not quotes from any specific provider.
Why a Low Unit Price Doesn’t Mean Low Cost
The most common mistake when evaluating LLM pricing is comparing a single eye-catching number—for example, the cache-read price or a promotional input rate during certain hours. In practice, your bill is made up of several components at once: cache-hit input, uncached input, output, and any other applicable fees.
In coding assistants, long-document analysis, and multi-turn conversations, large chunks of context repeat frequently, so caching can indeed reduce costs significantly. But “cheap caching” and “cheap overall” are not the same thing: if uncached input or output prices are high, a small number of cache misses or a few long responses can wipe out the savings.
Subscription plans have the same problem. A fixed monthly fee doesn’t guarantee a fixed monthly token allowance, nor identical throughput at all hours. Only by putting prices, workload, quota rules, and usage windows into a single consistent calculation framework do comparisons become meaningful.
This article does not refer to any specific product. All numbers below are assumptions designed to illustrate the formulas—they are not actual quotes, service terms, or performance guarantees.
First, Align the Definitions: What Does the Cache Hit Rate Divide By?
Before calculating anything, define the scope of token counting. Tokens are the unit models use to process text; they should not be treated as equivalent to character or word counts.
For a given billing period, define:
- H: cache-hit input tokens
- U: uncached input tokens
- O: output tokens
- T: total billed tokens
Considering only these three billing categories:
T = H + U + O
There are two easily confused “cache ratios.”
1. Input-side cache hit rate
This ratio is computed within input only:
h = H ÷ (H + U)
It answers: what fraction of all input hit the cache?
2. Cache share of total tokens
r = H ÷ T
It answers: of all billed tokens—including output—what fraction came from cache-hit input?
These two numbers are not interchangeable. Suppose a batch of tasks has cache-hit input at 98% of total tokens, uncached input at 1.5%, and output at 0.5%. The input-side hit rate is then:
98% ÷ (98% + 1.5%) ≈ 98.49%
So a claim like “98% cache hit rate” is insufficient for precise calculation unless the denominator is stated.
Similarly, if the cache share of total tokens changes from 98% to 95% without specifying how uncached input and output are split, the new cost cannot be uniquely determined. A rigorous estimate must specify the full token structure or state its allocation assumptions explicitly.
A Baseline Formula You Can Reconcile Against Bills
Let the unit prices be:
- Cache-hit input: Pc
- Uncached input: Pu
- Output: Po
with prices uniformly expressed per million tokens. The base cost is:
C = (H × Pc + U × Pu + O × Po) ÷ 1,000,000
If you know the total T and each category’s share of the total (rc, ru, ro), then:
C = T ÷ 1,000,000 × (rc × Pc + ru × Pu + ro × Po)
where:
rc + ru + ro = 1
This formula works well for monthly rollups, budget estimates, and bill spot-checks. One caveat: the three prices must cover all relevant charges for your scenario.
If the provider charges separate cache-write fees, storage fees, or other costs, add them explicitly; if there are no such charges, don’t invent them. The cost model must follow the actual contract and billing definitions—not the other way around.
A Worked Example
Suppose a workload generates 100 million tokens with this structure:
- Cache-hit input: 98%
- Uncached input: 1.5%
- Output: 0.5%
Assume unit prices of 0.10, 1.00, and 2.00 per million tokens respectively:
C = 100 × (0.98 × 0.10 + 0.015 × 1.00 + 0.005 × 2.00)
which gives:
C = 12.30
Breaking it down: cache-hit input costs 9.80, uncached input 1.50, and output 1.00.
The lesson: the highest-volume category is not necessarily the best optimization target. Even though output is only 0.5% of tokens, its higher price means it still accounts for a meaningful share of cost.
Sensitivity Analysis: Understanding the Value of Caching
Cache hit rates in production are not constant. System prompt updates, changes in context ordering, shifts in task types, and intervals between repeated requests all affect actual hit rates.
So instead of estimating a single “ideal hit rate,” observe how cost changes as the hit rate varies.
To avoid confusion, use the input-side hit rate h, and define the output-to-input ratio:
q = O ÷ (H + U)
The cost per million input tokens (including their corresponding output) is then:
K = h × Pc + (1 − h) × Pu + q × Po
Assume Pc = 0.10, Pu = 1.00, Po = 2.00, and a fixed output-to-input ratio q = 0.02:
| Input-side cache hit rate | Cost per million input tokens (incl. corresponding output) |
|---|---|
| 98% | 0.158 |
| 95% | 0.185 |
| 90% | 0.230 |
| 80% | 0.320 |
Note what is held fixed here: the input volume and the output-to-input ratio—not the total billed token count. Only with this clarified can the table be interpreted correctly.
From the formula, each percentage-point improvement in hit rate saves, per million input tokens:
0.01 × (Pu − Pc)
In other words, the economic value of cache optimization depends on the price gap between uncached and cached input—not simply on how cheap cached input is.
Finding the Break-Even Point Between Two Pricing Structures
When comparing vendors or budgeting, abstract different quotes into pricing structure A and structure B rather than comparing any single price line.
Holding input volume, input-side hit rate h, and output-to-input ratio q constant, the unit costs are:
K_A = h × Pc_A + (1 − h) × Pu_A + q × Po_A
K_B = h × Pc_B + (1 − h) × Pu_B + q × Po_B
Let:
ΔPc = Pc_A − Pc_B
ΔPu = Pu_A − Pu_B
ΔPo = Po_A − Po_B
Setting the two costs equal:
h × ΔPc + (1 − h) × ΔPu + q × ΔPo = 0
If the denominator is non-zero, the break-even hit rate is:
h* = (ΔPu + q × ΔPo) ÷ (ΔPu − ΔPc)
Three cautions when using this result:
First, if h* falls outside [0, 1], there is no crossover point within the feasible hit-rate range under the current output-ratio assumption.
Second, which structure is cheaper on which side of the break-even point cannot be determined from the formula’s shape alone—plug in a concrete hit rate to verify.
Third, the output ratio changes the break-even point. Short Q&A, long-form generation, and complex coding tasks should not share a single conclusion.
Price calculation only answers “how much does this structure cost for the same token mix.” It cannot prove that different models complete the same business task with equal quality and equal token usage.
Time-of-Use Pricing Must Be Weighted by Actual Usage
If prices vary by time window, the lowest price does not represent your average cost. The correct approach is to tally usage per time window and sum:
Total period cost = sum of costs across time windows
Only when request structure is similar across windows can you simplify to:
Average unit cost = (share of usage in high-price window × high-price unit cost) + (share of usage in low-price window × low-price unit cost)
Critically, use the share of usage, not the share of clock time. Even if the high-price window covers only a few hours a day, it may carry most of your interactive traffic.
Technical teams can classify tasks into:
- Interactive tasks that must respond immediately;
- Batch tasks that can be deferred;
- Background tasks that can be interrupted and resumed.
Only the latter two typically offer meaningful scheduling flexibility. When scheduling, also consider deadlines, concurrency limits, data freshness, and the cost of compensating for failures—never sacrifice availability purely to chase a lower price.
Evaluate Subscription Plans by Effective Utilization
The core question for a subscription plan is not “how large is the advertised quota” but “how much valuable quota can you actually consume.”
First, verify the quota’s unit. Request counts, task counts, weighted usage, and token counts are not inherently equivalent. If the provider offers no stable conversion rule, you cannot translate the quota into a fixed token amount.
Let the monthly fee be M, and let V be the pay-as-you-go equivalent cost of the workload actually completed—same tasks, same success criteria. Then:
Effective discount factor = M ÷ V
If you pay 300 in a month while the completed workload would have cost 500 pay-as-you-go, the effective discount factor is 60%. If you only consume the equivalent of 150, the factor becomes 200%—the fixed fee was not amortized by utilization.
At minimum, a plan evaluation should check:
- Whether the quota resets weekly, monthly, or on a rolling window;
- Whether unused quota rolls over;
- Whether there are time-of-day or concurrency restrictions;
- Whether exceeding the quota stops service, throttles speed, or triggers separate billing;
- Whether permitted use cases match your actual business.
Also, a weekly quota should not be mechanically multiplied by 4 for every month. A rough annual average uses 52 ÷ 12 ≈ 4.33 weeks, but the quota available in any given month still depends on reset timing and the specific rules.
Build a Cost Dashboard Tied to Business Outcomes
Token cost is only the first layer of metrics. What organizations really need to know: how much does one合格—successful—task actually cost? More precisely: how much does it cost to complete one qualified task?
Track at least:
- Task type and request time;
- Cache-hit input, uncached input, and output usage;
- The applicable billing window and price version;
- Retry counts and failure reasons;
- Whether the task passed quality acceptance;
- Whether manual revision or fallback handling was needed.
On that basis, compute:
Cost per successful task = total relevant cost ÷ number of successful tasks
“Success” should be defined by business standards. Generating text is not the same as completing a document task; returning code is not the same as completing a development task. Retries, invalid outputs, and required human review all affect the final economics.
Note that logging does not require storing full input content. For workloads involving sensitive data, record only the necessary metering and status metadata, following data-minimization principles.
Turn Cost Optimization into Ongoing Practice
Reliable optimization starts with real usage data—not with assuming an extremely high cache hit rate.
First, establish baselines per task type, observing input length, output length, hit rates, and success rates separately, so a single average doesn’t mask the differences.
Second, where the service supports it and business semantics allow, keep shared context stable and organize rapidly changing information separately from stable content. Whether caching actually engages depends on the specific mechanism—do not equate “similar content” with “will hit the cache.”
Third, control unnecessary output length, but not at the cost of cutting essential reasoning, explanations, or verification details. The goal is to reduce wasted generation, not simply to chase shorter answers.
Finally, periodically validate your estimates against actual bills. If predictions and bills diverge, check in order: metering definitions, price units, time-window boundaries, additional fees, retried requests, and quota deduction rules.
The true cost of an LLM is the joint result of pricing structure and workload. Only by unifying your statistical denominators, clarifying output ratios, accounting for costs by time window, and folding plan utilization and task success rates into your evaluation can you move from “looks cheap” to “actually under control.”
