Evaluating LLM Price Increases: A Guide to Caching and Agent Costs

    When a large language model raises its prices, the headline increase on one pricing tier rarely reflects the real cost impact on your business. This article explains how to analyze model pricing correctly: distinguishing pricing tiers from actual workload costs, calculating real expenses with a unified formula that accounts for cache hit rates and input-output ratios, understanding what caching actually reuses and why high hit rates cannot fully offset price hikes, and diagnosing why agent workloads are prone to cost runaway. It also provides practical metrics and governance measures for evaluating whether a model upgrade is truly cost-effective.

    1. Before Judging Whether a Model Is Expensive, Define the Basis of Comparison

    The most common mistake when discussing LLM pricing is treating the increase of a single billing tier as the cost increase for the entire business.

    In practice, a single model call typically involves several types of usage billed at different rates:

    • Input that misses the cache;
    • Input that hits the cache;
    • Output generated by the model;
    • Other items billed separately in some services.

    The proportions of these vary widely across workloads. Short Q&A may involve little input and substantial output; document analysis may involve very long input and short output; a continuously running coding agent may repeatedly submit shared instructions, project context, and historical execution results.

    As a result, even when two types of users call models with identical capabilities, their final bills can differ by a factor of several.

    Analyzing a price change requires distinguishing three questions:

    First, how much each billing tier increased. This is a change at the price-list level.

    Second, how much the total cost of calls increased under the same workload. This depends on the input-output structure and cache hit rates.

    Third, how much it costs to complete one qualified business task. This also involves model quality, retry counts, tool overhead, and human review.

    Only the third question directly helps a company decide whether a purchase or upgrade is worthwhile.

    2. Calculating Actual Call Costs with a Unified Formula

    To avoid tying the discussion to any specific product, the following purely illustrative prices are used to demonstrate the calculation method. They do not represent any actual service pricing:

    Billing item Hypothetical unit price
    Input (cache miss) 20 per million tokens
    Input (cache hit) 2 per million tokens
    Output 100 per million tokens

    A token is the basic unit of text processed by a model and should not be equated with word counts or character counts. Different text content, encoding methods, and tokenization rules can all affect actual usage.

    Let:

    • (I) be the number of input tokens;
    • (O) be the number of output tokens;
    • (h) be the input cache hit rate;
    • (P_u) be the unit price of uncached input;
    • (P_c) be the unit price of cached input;
    • (P_o) be the output unit price.

    If the cache hit rate is measured by input tokens, the weighted input price is:

    [
    P_i=hP_c+(1-h)P_u
    ]

    The total call cost is:

    [
    C=\frac{I[hP_c+(1-h)P_u]+OP_o}{10^6}
    ]

    One easily overlooked detail: request hit rate is not the same as token hit rate.

    For example, if nine out of ten requests hit the cache but each reuses only a very short shared prefix, the token-based hit rate may still be low. Cost estimates must use the same statistical basis as the actual bill.

    Scenario 1: Long Input with Well-Reused Shared Context

    Assume an input-output ratio of 20:1 and a cache hit rate of 90%.

    The weighted input price is:

    [
    0.9\times2+0.1\times20=3.8
    ]

    The average cost per million combined input and output tokens is:

    [
    \frac{20\times3.8+100}{21}\approx8.38
    ]

    Scenario 2: Highly Variable Input with Limited Cache Reuse

    Assume an input-output ratio of 5:1 and a cache hit rate of 20%.

    The weighted input price is:

    [
    0.2\times2+0.8\times20=16.4
    ]

    The combined average cost is:

    [
    \frac{5\times16.4+100}{6}\approx30.33
    ]

    The average unit prices of the two scenarios differ by about 3.6x, but this alone does not prove that a certain type of customer receives an extra discount. Both the cache hit rate and the input-output ratio changed here; the difference results from the combined effect of the two factors.

    More importantly, a lower average unit price does not mean a lower total task cost. A long task consuming tens of millions of tokens can produce a higher total bill than a large volume of short Q&A, even at a very low unit cost.

    3. Why a High Cache Hit Rate Cannot Automatically Offset a Price Increase

    The value of caching is reducing part of the computation and cost associated with repeated input—not making the entire request cheap.

    Under the assumptions above, when the hit rate rises from 90% to 100%, the weighted input price drops from 3.8 to 2, but the output price remains 100.

    For a 20:1 input-output ratio, the minimum combined average cost is still:

    [
    \frac{20\times2+100}{21}\approx6.67
    ]

    This means cache optimization has a clear benefit ceiling. As the hit rate approaches its upper limit, compressing output, reducing retries, and eliminating invalid calls may be more effective than further cache tuning.

    The formula shows that, all else being equal, converting one million uncached input tokens into one million cached input tokens saves:

    [
    P_u-P_c
    ]

    Reducing one million output tokens saves:

    [
    P_o
    ]

    But engineering optimization should not blindly pursue token reduction. Excessively short output may omit necessary steps; compressing context may degrade answer quality, ultimately introducing more retries and manual corrections. What should truly be optimized is the total resources needed to complete a task—not any single metric in isolation.

    4. What Does Caching Actually Reuse?

    In generative model inference, caching is typically used to reuse intermediate states corresponding to already-processed prefixes, such as the key-value cache required for attention computation.

    When a subsequent request meets the server’s reuse conditions, the system may not need to fully reprocess the identical prefix, reducing part of the input processing overhead.

    However, the following three concepts must be kept separate:

    1. Business content repetition: requests contain the same project materials or shared instructions.
    2. Successful reuse by the inference system: the service actually recognizes and retains reusable state.
    3. Billing recorded as a hit: that portion of input qualifies under the service’s billing rules.

    These three do not necessarily coincide.

    Caching can also be affected by prefix position, text consistency, expiration, capacity, scheduling, and isolation mechanisms. The specific conditions must be verified against the service documentation and actual observation—you cannot infer a cache hit merely because “the content is similar.”

    A Request Structure Better Suited to Reuse

    A common practice is to place stable information first and frequently changing information last:

    Shared behavioral constraints → Stable domain knowledge → Project context → Current task → Latest execution results

    Note that timestamps, random identifiers, and dynamic state inserted into the shared prefix can destroy reuse opportunities for the large segments that follow.

    In addition, permissions and data boundaries take priority over hit rates. To improve reuse, you must not mix user data or sensitive information that should not be shared into a common context.

    5. Why Agent Tasks Are More Prone to Cost Runaway

    Traditional conversation is a user asking and the model answering. Agent tasks may form a continuous loop:

    Understand the goal → Make a plan → Call tools → Read results → Revise judgment → Execute again.

    Each loop may add new input, output, and external tool costs. Agent cost is therefore closer to:

    [
    Total\ cost=\sum model\ fees\ per\ round + tool\ fees + runtime\ resource\ fees
    ]

    If the same task also undergoes multiple failed retries, all attempts should be counted—not just the final successful call.

    1. Repeated Processing of Historical Context

    If every round carries the full history and the history keeps growing, cumulative input volume can grow very quickly.

    In a simplified model, assuming each round adds a fixed-length piece of information and every request submits the entire history, the cumulative submitted input across many rounds may grow approximately quadratically. This describes the cumulative scale of the business workload; it does not mean that the per-request computational complexity of all inference implementations is identical.

    2. Uncontrolled Feeding of Tool Results Back into the Model

    Complete logs, lengthy files, and duplicate retrieval results, if returned to the model without filtering, expand the context, increase processing latency, and may interfere with judgment.

    A more reasonable approach is to retain only the evidence needed for the next step, read large content on demand, and provide summaries with traceable references to the original locations when necessary.

    3. Retries Without New Information

    If, after a task fails, the same request is simply resent without adding the error cause, environment state, or repair constraints, the system may fall into a high-cost loop.

    Every retry should therefore answer two questions: What effective new information does this attempt add? Why is the probability of success higher now?

    6. Understanding Inference Costs Requires More Than Parameter Count

    Model pricing is related to deployment cost, but it cannot be derived directly from any single architectural metric.

    For sparse mixture-of-experts architectures, each token typically activates only a subset of experts, which reduces computation relative to having all experts participate. However, the overall deployment may still bear significant overhead in weight storage, expert scheduling, and inter-device communication.

    Similarly, long-context inference involves multiple stages:

    • The input processing stage must digest the existing context;
    • The token-by-token generation stage continuously accesses model weights and the relevant cache;
    • Concurrent serving must balance throughput, response latency, and resource utilization.

    In common standard full-attention implementations, with the model and data type fixed, key-value cache capacity typically grows approximately linearly with context length and the number of concurrent sequences. But with sliding-window attention, cache compression, or other mechanisms, the specific relationship changes.

    Therefore, one cannot claim that all long-context costs grow in the same way, nor conclude from public parameter counts alone that a given price must be loss-making or wildly profitable.

    Commercial pricing is also influenced by supply and demand, service guarantees, capacity reservation, operational investment, and market strategy.

    7. How to Determine Whether an Upgrade Is Truly Worthwhile

    When evaluating a model upgrade, enterprises should use a fixed task set, keeping task inputs, acceptance criteria, and the runtime environment as consistent as possible.

    At minimum, four groups of metrics should be observed simultaneously.

    1. Cost Metrics

    Record uncached input, cached input, output, and additional tool fees. Do not look only at the total call count in the console, because the lengths of different requests can vary greatly.

    2. Effectiveness Metrics

    Track task completion rate, factual accuracy, constraint compliance, and the amount of human modification. For coding tasks, combine executable tests and code review rather than evaluating only whether the response reads fluently.

    3. Efficiency Metrics

    Record end-to-end latency, number of call rounds, tool invocations, and retry counts. A faster single response does not necessarily mean the whole task completes faster.

    4. Stability Metrics

    Beyond averages, observe high-percentile costs and worst cases. A small number of tasks stuck in long loops can contribute a large share of the bill.

    A metric closer to real value is:

    [
    Cost\ per\ accepted\ task=
    \frac{All\ model,\ tool,\ and\ related\ runtime\ fees\ across\ attempts}{Number\ of\ tasks\ passing\ acceptance}
    ]

    To measure full business investment, human review and correction costs should also be included. Success rates are not fixed, so estimates should be based on a sufficient number of representative tasks, not a handful of demo cases.

    8. Actionable Cost Governance Measures for Development Teams

    First, Maintain Per-Task Usage Records

    Record at least the task identifier, number of call rounds, the three categories of token usage, retry reasons, latency, and acceptance results. Track long tasks independently so costs are not scattered across many requests and become impossible to attribute.

    Second, Set Hard Boundaries for Loop Execution

    Limit the maximum number of execution rounds, cumulative output, per-task cost, and no-progress retries. When a threshold is hit, the task should stop, degrade, or be handed off to a human—not continue indefinitely.

    Third, Match Capability to Difficulty

    Format conversion, simple extraction, and high-difficulty reasoning do not need the same resource allocation. You can start with a lower-cost capability that meets the requirement and upgrade on failure or uncertainty—but verify that the tiered strategy does not introduce excessive duplicate calls.

    Fourth, Govern Context Rather Than Endlessly Extending It

    Reuse stable background where possible, introduce dynamic evidence on demand, and remove expired information promptly. Keep sources and key constraints in summaries to prevent compression from losing details that affect correctness.

    Fifth, Standardize Output Contracts

    Explicitly specify required fields, evidence, and conclusions to reduce repetitive explanation. For execution-oriented tasks, prioritize verifiable results over lengthy process descriptions.

    9. Conclusion: Look Beyond the Price List—Look at the Task Ledger

    Whether an LLM price increase is reasonable cannot be judged by the increase of a single output tier; whether caching is effective cannot be judged by a hit rate detached from the business structure.

    A more reliable analysis sequence is: first verify the billing rules, then fix the workload, then calculate actual costs, and finally evaluate business value in combination with success rates, retries, and labor costs.

    For developers, what truly needs optimizing is not “how much each call costs” but “how much it costs to achieve a business goal at acceptable quality and risk.” Only by putting caching, context, output, tool loops, and acceptance criteria into the same task ledger can you see the real impact behind a price change.