LLM Cost Evaluation: API Calls, Cache Hits, and Subscription Pricing

    Evaluating LLM costs requires more than comparing output-token prices or the face value of a subscription plan. This article explains how to align billing units, model task-level costs across input, output, and cache-hit tokens, measure cache effectiveness, calculate the effective multiplier of prepaid plans, and govern production budgets using unit success cost, retry rate, and cache hit rate. It also outlines when a price increase may still be justified by quality improvements, lower rework, or more efficient task execution.

    One of the easiest ways to distort a pricing discussion is to treat a several-fold increase in the output-token unit price as an equivalent increase in usage cost. LLM billing is usually split into at least input, output, and cache-hit categories. Some workloads also add context length, tool calls, multiple retries, and failed replays. Looking only at output pricing can overstate how expensive a model has become; looking only at the sticker price of a subscription can understate real consumption. A rational evaluation should answer three questions: how much quota a typical task actually consumes, how much of that quota is repeated context, and how many similar tasks a prepaid plan can cover.

    Align the billing basis first

    Before comparing prices, align the units. Common list prices are quoted per million tokens, with separate prices for input, output, and cache hits. Output is often significantly more expensive than input because decoding consumes more compute and bandwidth. Cache-hit pricing gives a discount for prefix context that has already been seen, rewarding stable system prompts, long-document prefixes, and repeated retrieval results.

    Let the input tokens for one call be (I), with (C) being the portion that hits cache and (I-C) the uncached portion. Let the output tokens be (O). Let the unit prices be (p_i), (p_c), and (p_o), respectively. The cost of one call can be written as:

    [
    \text{Cost}=(I-C)\cdot p_i+C\cdot p_c+O\cdot p_o
    ]

    This formula shows two things. First, a several-fold increase in output unit price does not mean the same increase in total cost unless the task consists almost entirely of newly generated content. Second, however low the cache price is, it matters only when prefixes are stable and the hit rate is genuinely measurable. If a cache discount is used as a promotional claim without reporting actual hit rates, the evaluation cannot be reproduced.

    Evaluators should also distinguish between the list price, the billed price, and the cost of failure. Rate-limit retries, tool round trips, and prompts rewritten by the model can turn one user request into multiple billed calls. Bills should therefore be aggregated by business request, not averaged by the number of model calls.

    Use task cost instead of token intuition

    Developers do not primarily care about the price of one million tokens. They care about the cost of completing a support ticket, making a code change, or handling one round of Q&A. Sample real traffic and stratify it by task type rather than using short laboratory prompts to represent production.

    At a minimum, divide tasks into four categories: short Q&A, long-document understanding, multi-turn agent tasks, and batch offline processing. For each category, record input-length and output-length distributions, cache hit rate, average retry count, and number of tool round trips. Then use the formula above to calculate quantiles, not just averages. Long-tail tasks often determine the budget, while averages are diluted by a large number of short calls.

    Multi-turn agents are especially easy to misjudge. Each step may produce little output, but every step carries accumulated context, and uncached input is billed repeatedly. If the prefix can be cached reliably, the marginal cost drops noticeably. Claims such as “the average cost per task is close to that of a certain high-priced model” must therefore disclose the task definition, whether context is reused, and whether failed retries are included. Without those conditions, cross-model comparison is meaningless.

    Cost can also be expressed in terms of unit business value: per successfully merged code change, per deliverable report generated, or per customer support issue resolved. When success rates are low, a model with a cheap nominal token price can still be more expensive, because wasted calls and manual rework must be included.

    Cache hits are discounts, not commitments

    Caching is suitable for system prompts, fixed tool instructions, and knowledge prefixes that change infrequently. It is not suitable for user questions that are rewritten every turn, nor for stuffing all unrelated history into the context in the hope of a hit. Hit rates should be recorded server-side at the request level and tied to the prompt template version. When a template changes, the prefix hash changes and the hit rate can fall sharply; this is a metric that must be reviewed when changes go live.

    Three engineering practices help. First, separate stable prefixes from volatile suffixes; avoid inserting timestamps, random numbers, or the current user text into the prefix. Second, control how much history is replayed, retaining only the state summary needed to complete the task rather than the entire conversation. Third, use fixed templates and warm up batch tasks so that later entries share prefixes. These practices reduce billable input without relying on any vendor’s proprietary interface.

    Avoid reverse optimization as well: keeping an unnecessarily long prefix solely to raise the hit rate increases total input, so total cost may not fall. Review net benefit weekly, calculated as savings from cache hits minus the additional input cost.

    Evaluate subscriptions by effective multiplier, not face value

    A prepaid plan is essentially a fixed fee paid for a basket of quota, which is then converted into consumable tokens at the unit prices for each category. When evaluating a plan, calculate its effective multiplier. Suppose the same set of real tasks would cost (A) under pay-as-you-go pricing, the plan price is (S), and the included quota exactly covers those tasks. The multiplier is approximately (A/S). A higher multiplier means the plan is more economical than pay-as-you-go; a multiplier close to 1 means it is merely prepayment, without a price advantage.

    The most common mistake is to use the cheapest cache unit price from an official example to convert the entire quota, producing an inflated usage estimate. The correct approach is to use your own team’s mix of input, output, and cache. For a coding agent with a high output share, the effective quota will be much smaller than the upper bound calculated by pricing everything at the cache rate. For batch classification with extremely short outputs and stable prefixes, the effective price will be closer to a mix of cache and input pricing.

    Also check whether quota can be used across models, whether it resets every calendar month, whether overage falls back to metered billing, and whether concurrency and rate limits impose separate restrictions. A plan with a high face value but insufficient throughput, very expensive overage, or poor coverage of primary models has limited value for production traffic. The optimal choice also differs between light personal use and stable enterprise workloads: the former may benefit from a capped monthly fee, while the latter needs predictable unit costs and budget alerts.

    When comparing different providers or model generations, do not rely only on multiples of output unit price. Compare completion cost on the same task set under the same success criteria, and report quality differences separately. Quality improvements that reduce retries and manual edits may offset part of a unit-price increase. Conversely, if scores improve but task consumption rises at the same time, users may still perceive the result as more expensive. Scores, unit prices, and task consumption must be examined together.

    When a price increase may still be justified

    A price increase is not automatically unreasonable. Longer context, lower failure rates, and fewer external tool turns all change total task cost. Whether the new price is justified can be assessed with the following comparisons rather than slogans.

    • Quality threshold: Under a fixed review standard, does the new price correspond to a higher first-pass rate and fewer rework cycles?
    • Consumption structure: Have the proportions of input, output, and cache worsened because of model behavior, such as unnecessarily lengthening output?
    • Alternative paths: Can simple steps in the same task be handled by a smaller model, with only difficult steps sent to the high-priced model?
    • Budget elasticity: After the price increase, does the unit economics of the core business still hold? If only peripheral features become unacceptable, use rate limiting rather than abandoning the model entirely.

    Routing is a general-purpose technique: send classification, summarization, and format cleanup to lower-cost models; send planning, complex edits, and high-risk conclusions to higher-cost models. Validate routing rules with online samples to avoid raising the failure rate in pursuit of savings, which can result in a higher total cost.

    Measurement and governance in production

    Make cost observability a first-class metric alongside latency and error rate. For each business request, record the model tier, input tokens, output tokens, cache-hit tokens, retry count, and converted amount. Dashboards should allow drill-down by application, prompt template version, and task type. When launching a new template or switching models, compare unit task cost and success rate over the seven days before and after the change, rather than looking only at the total bill.

    Budget governance can be straightforward: set a daily spending threshold for each application and alerts for abnormal growth, such as a single request’s output length suddenly reaching its limit, a rise in retry rate, or a drop in cache hit rate. These signals often expose prompt replay errors or recursive tool loops earlier than a monthly bill.

    An illustrative aggregation method is to group multiple model calls by business request ID, calculate the amount using a unified price table, and divide by the number of successful requests to obtain unit success cost. Keep the price table in configuration and update it according to contracts, rather than hard-coding numbers from one period into an article or code comment as permanent facts. Discounts, tiers, and regional differences vary widely across contracts. External claims about “how much it costs” or “how many times the usage” are only someone else’s sample and should not be treated directly as your own bill.

    Conclusion

    To judge whether LLMs are expensive, map output list prices, cache discounts, and subscription face values back to your team’s task distribution. An increase of several times in output unit price only makes clear that one billing component has changed; true cost depends on output share, cache hits, and retries. Whether a subscription is competitive depends on the effective multiplier calculated from your own consumption mix, as well as on overage, rate-limit, and reset rules, not on the theoretical maximum usage in marketing material. By continuously measuring unit success cost, cache hit rate, and first-pass rate, pricing discussions can move from impression-based comparisons to reviewable engineering judgments.