Agent Cost Analysis Behind Large Model API Price Increases

    When large language model API prices rise, the headline numbers can be misleading. This article breaks down the three pricing tiers—uncached input, cache-hit input, and output—and shows why the cache hit rate, not the unit price alone, is the variable that truly determines cost. Using two worked examples, it compares a high-cache-hit enterprise agent workload (about 7.52 RMB per million tokens) with a low-cache-hit individual developer workload (about 30.17 RMB per million tokens) on the same model, a roughly 4x gap. It explains why the shift from chat-style calls to agent-style calls amplifies output and context-management costs, and offers engineering practices—stable prefix reuse, cache-key design, context control, model routing, output constraints, and cost observability—to help teams keep per-task costs under control. Finally, it outlines what to evaluate when selecting a model, moving beyond unit price toward a sustainable AI cost-governance approach.

    1. Breaking Down the Price: A Hike Is Not a Simple “Doubling”

    Recent discussions about rising large model API prices tend to fixate on a few headline numbers: output priced at 100 RMB per million tokens, uncached input at 20 RMB per million tokens, and cache-hit input at 1 RMB per million tokens. Looking only at the output side, it is easy to conclude that prices have jumped sharply. But if you break the pricing into its three tiers—input, output, and cache-hit input—it becomes clear that this is not a simple linear price increase, but a redistribution of the cost structure.

    Typical model-call billing usually involves at least three types of cost:

    1. Uncached input price: When a request enters the model, the context must be recomputed. In long-context scenarios, the prefill stage consumes a large amount of compute and bandwidth.
    2. Cache-hit input price: If part of the request’s prefix closely matches previous content—such as system prompts, tool definitions, code snippets, or knowledge fragments—the platform can reuse cached results and avoid redundant computation.
    3. Output price: The model generates the result token by token, involving GPU memory usage, bandwidth consumption, scheduling pressure, and the overhead of long-sequence generation during the decoding stage.

    Looking at the price structure, the output price has risen significantly while the cache-hit input price has risen only modestly. This reflects an important trend: model services are shifting from “conversational calls” toward “agent-style calls,” and output cost together with context-management cost is becoming the dominant cost source.

    As a result, judging whether a new model has “become more expensive” cannot rely on any single-tier unit price. You have to look at the blended token cost under real business workloads. An enterprise scenario that reuses the same prefix over the long term, and an individual scenario where every request is completely different, may end up bearing costs that differ by several times.


    2. Cache Hits: The Variable That Really Widens the Cost Gap

    In model calls, the cache hit rate is often more important than the listed price of any single tier. Cache hits can significantly reduce the computational pressure of repeated input, but only when the request has a highly repetitive, stable prefix.

    A simplified formula describes the actual cost on the input side:

    1. effective input price = cache-hit price × hit rate + uncached price × miss rate

    Assume a model with the following pricing structure:

    1. Uncached input: 20 RMB per million tokens
    2. Cache-hit input: 1 RMB per million tokens
    3. Output: 100 RMB per million tokens

    If the cache hit rate is 90%, the effective input price is:

    1. 1 × 0.9 + 20 × 0.1 = 2.9 RMB per million tokens

    If the cache hit rate is only 20%, the effective input price is:

    1. 1 × 0.2 + 20 × 0.8 = 16.2 RMB per million tokens

    Calling the same model, but with different cache hit rates alone, the input-side cost can differ by several times. Once you add the output price on top, the overall cost gap widens further.

    One point deserves emphasis: a cache hit does not simply lower the input price—it changes the entire cost curve of the request. For long-context, multi-turn calls, agent tool orchestration, code generation, and knowledge-base Q&A, the cache hit rate often determines whether an enterprise can keep the per-task cost within an acceptable range.


    3. Worked Example: A High-Hit Enterprise Scenario vs. A Low-Hit Individual Scenario

    To illustrate this more concretely, we can construct two typical scenarios for comparison. All prices below are abstract examples and do not point to any specific product or vendor.

    Scenario 1: A High-Hit-Rate Enterprise Agent Scenario

    Assume an enterprise-grade intelligent coding or office-automation scenario with the following characteristics:

    1. Input/output ratio: 20:1
    2. Cache hit rate: 90%
    3. Cache-hit input price: 1 RMB per million tokens
    4. Uncached input price: 20 RMB per million tokens
    5. Output price: 100 RMB per million tokens

    This kind of scenario typically has a stable system prompt, fixed tool descriptions, a long-term reused knowledge-base prefix, or repeated carriage of the same context across consecutive multi-step tasks. The cache hit rate is high.

    Effective input-side price:

    1. 1 × 0.9 + 20 × 0.1 = 2.9 RMB per million tokens

    The blended cost can be calculated by weighting with the input/output ratio:

    1. blended price = (input tokens × effective input price + output tokens × output price) / total tokens

    Since the input/output ratio is 20:1:

    1. blended price = (20 × 2.9 + 1 × 100) / (20 + 1)
    2. = (58 + 100) / 21
    3. ≈ 7.52 RMB per million tokens

    In other words, even with an output price as high as 100 RMB per million tokens, because the input side is heavily diluted by cache hits, the blended cost can still be kept at a relatively low level.

    Scenario 2: A Low-Hit-Rate Individual Developer Scenario

    Now assume another scenario:

    1. Input/output ratio: 5:1
    2. Cache hit rate: 20%
    3. Cache-hit input price: 1 RMB per million tokens
    4. Uncached input price: 20 RMB per million tokens
    5. Output price: 100 RMB per million tokens

    This scenario might correspond to ad-hoc use, one-off Q&A, individual developers frequently switching tasks, or cases where every request carries different context and different knowledge fragments. With no stable prefix to reuse, the cache hit rate is low.

    Effective input-side price:

    1. 1 × 0.2 + 20 × 0.8 = 16.2 RMB per million tokens

    Blended price:

    1. blended price = (5 × 16.2 + 1 × 100) / (5 + 1)
    2. = (81 + 100) / 6
    3. ≈ 30.17 RMB per million tokens

    Comparing the two scenarios:

    1. High-hit enterprise scenario: ≈ 7.52 RMB per million tokens
    2. Low-hit individual scenario: ≈ 30.17 RMB per million tokens
    3. Cost gap: ≈ 4x

    This result shows that the same model can present completely different actual costs under different workload patterns. On the surface it may look like a broad-based price increase, but for people with highly reusable prefixes, long-running tasks, and high cache hit rates, they are effectively paying a discounted price; while users whose requests are highly fragmented and whose context differs every time may end up near the list price or even above it.


    4. Why the Agent Era Amplifies Price Changes So Quickly

    In early conversational applications, a single user interaction might involve only tens to a few thousand tokens, so model-call costs were relatively limited and users were not very sensitive to unit-price changes. In agent scenarios, however, the calling pattern changes fundamentally.

    A typical agent task is often not a single request, but a combination of consecutive reasoning steps and tool calls. For example:

    1. User states a goal
    2. ↓
    3. Model decomposes the task
    4. ↓
    5. Calls tools such as search, code execution, database queries, file reads/writes
    6. ↓
    7. Continues reasoning based on tool results
    8. ↓
    9. Calls tools again or revises the approach
    10. ↓
    11. Produces the final result

    Under this pattern, token consumption rises significantly for several reasons:

    1. Context keeps accumulating: Each step’s tool output, intermediate reasoning, and message history may all be sent back into the model.
    2. Tool descriptions and system prompts are carried repeatedly: To keep agent behavior stable, prefixes such as tool definitions, permission notes, and format constraints tend to persist over the long term.
    3. Output length increases: An agent must not only answer questions but also generate call arguments, planning steps, and summaries, so output-side token consumption rises noticeably.
    4. Multi-agent parallelism multiplies the total: If multiple agents run simultaneously, each continuously generates calls, and the overall cost grows several-fold.
    5. Retries amplify overhead: Once a step fails, the context may need to be reloaded and the step retried, causing extra consumption.

    So the key question in the agent era is no longer just “how much does each call cost,” but “how much does it cost to complete a business task.” If a task involves tens of thousands of tool calls, hundreds of thousands of tokens, or multiple agents running in parallel for days, even a small change in unit price gets amplified by scale.

    This is also why the output-side price increase draws attention. In agent scenarios, the output is not simply “answer text”—it may include tool-call arguments, intermediate state, structured results, and subsequent reasoning content. The cost of each step on the output side can be amplified repeatedly across a long-chain task.


    5. How Enterprises Can Reduce Real Costs Through Engineering

    Faced with the new price structure, simply complaining about the increase is pointless. What matters more is optimizing cost from an architecture and engineering perspective. For enterprise developers, several approaches can help.

    1. Increase the Reuse Rate of Stable Prefixes

    The core source of cache hits is a stable prefix. Enterprises should place fixed content at the front of the request as much as possible and avoid inserting dynamic content into fixed regions.

    For example, a typical optimized structure might look like:

    1. [stable system prompt]
    2. [tool definitions]
    3. [long-term knowledge base]
    4. [history summary or fixed rules]
    5. [current dynamic input]

    If the system prompt, tool definitions, version numbers, timestamps, or user identifiers are modified frequently, the cache-hit condition is broken. Prefix stability is therefore the first principle of cache hits.

    2. Design Sensible Cache Keys and Version Strategies

    In long tasks, you cannot simply stuff all context into the cache, nor can you let a small change invalidate the entire cache. More reasonable approaches include:

    • Split the system prompt, tool descriptions, and knowledge fragments into independent cache blocks;
    • Replace the changing parts locally rather than rewriting the whole segment;
    • Set clear cache keys for different versions;
    • Set a longer validity period for content that is stable over the long term;
    • Use summaries or incremental representations for content that changes frequently.

    The essence of cache design is to reduce redundant computation, not to blindly increase context length.

    3. Control Context Length and Avoid Carrying Full History

    Many agent systems perform well initially, but as steps accumulate, the context grows longer and costs rise quickly. At that point you can consider:

    • Compressing and summarizing message history;
    • Keeping only the context relevant to the current step;
    • Writing state to external storage and reading it only when needed;
    • Using retrieval augmentation instead of injecting the full knowledge base;
    • Structurally compressing intermediate results to reduce redundant descriptions.

    The core goal of context management is not to “remember everything,” but to “retain the information necessary to complete the task.”

    4. Use Model Tiering and Task Routing

    Not every task needs the same tier of model. For simple tasks, you can use a lower-cost model or a rule engine; for complex reasoning, long-chain planning, and critical decisions, you can call a more capable model.

    For example:

    1. Simple classification: lightweight model or rules
    2. Intent recognition: lightweight model
    3. Ordinary Q&A: mid-tier model
    4. Complex planning: high-tier model
    5. Final review: high-tier model or human review

    Through task routing, you can avoid sending every request to a high-cost model, striking a balance between quality and cost.

    5. Constrain Output Length and Format

    When the output price is high, controlling output length is especially important. You can:

    • Limit the maximum number of output tokens;
    • Use structured output such as JSON, tables, or fixed fields;
    • Stream long-form generation and stop promptly once business goals are met;
    • Avoid making the model repeatedly explain things that are already clear;
    • Use templates or function-call constraints for tool-call arguments.

    Output is not better the longer it is. In agent scenarios, stable, parseable, and executable output is more valuable than verbose expression.

    6. Build a Token-Level Cost Observability System

    Without cost observability, teams often discover a serious budget overrun only after a task “succeeds.” Enterprises should build a complete cost ledger that includes at least:

    • Input tokens per request;
    • Output tokens per request;
    • Cache-hit tokens;
    • Uncached input tokens;
    • Cumulative cost per task;
    • Average daily cost per agent;
    • Extra cost incurred by each retry;
    • A top list of high-cost tasks.

    It can be expressed in pseudocode:

    1. def calculate_blended_cost(
    2. input_output_ratio,
    3. cache_hit_rate,
    4. hit_price=1.0,
    5. miss_price=20.0,
    6. output_price=100.0
    7. ):
    8. effective_input_price = cache_hit_rate * hit_price + (1 - cache_hit_rate) * miss_price
    9. blended_price = (
    10. input_output_ratio * effective_input_price + output_price
    11. ) / (input_output_ratio + 1)
    12. return blended_price
    13. # High-hit scenario
    14. print(calculate_blended_cost(20, 0.90)) # ≈ 7.52
    15. # Low-hit scenario
    16. print(calculate_blended_cost(5, 0.20)) # ≈ 30.17

    This code only illustrates the cost model. A real system needs to be calibrated against specific billing rules, retry strategies, input/output ratio, and cache hit rate.

    7. Detect Cost Anomalies Early with Monitoring and Alerts

    Once agent tasks move into production, cost risk often does not appear suddenly but accumulates gradually. It therefore helps to configure monitoring and alerts for cases such as:

    • A single task’s token consumption exceeding a threshold;
    • Abnormally high daily call volume;
    • A sudden drop in cache hit rate;
    • A noticeable rise in average output length;
    • A retry rate above expectations;
    • A certain type of tool call causing context bloat;
    • A single business path accounting for too large a share of cost.

    At the cloud-infrastructure level, you can leverage general capabilities such as container platforms, message queues, logging services, monitoring and alerting, and object storage to build a complete observability system spanning the call chain, task execution, and cost attribution.


    6. When Choosing a Model, Don’t Look Only at Unit Price—Look at Blended Cost

    For developers and technical decision-makers, the most common mistake when facing a new round of price increases is comparing only a single tier of price. A more reasonable approach is to build your own “real-workload cost model.”

    When selecting a model, focus on evaluating the following:

    1. Blended token cost: Not just the input or output unit price, but the blended cost calculated from the input/output ratio and cache hit rate.
    2. Cache-hit capability: Whether it supports stable-prefix reuse, provides cache-hit statistics, and lets the business side optimize cache keys.
    3. Long-context stability: Whether the model still produces stable output under long tasks, multi-turn tool calls, and complex context.
    4. Output controllability: Whether it supports structured output, function calling, format constraints, streaming, and early termination.
    5. Retry cost: If a task fails, does retrying recompute the entire context? Is there a checkpoint or resume-from-breakpoint mechanism?
    6. Cost observability: Whether it provides token-consumption details, cache-hit visibility, task-level cost aggregation, and alerting.
    7. Engineering integration: Whether it integrates easily with infrastructure such as logging services, monitoring and alerting, message queues, object storage, and container platforms.
    8. Business elasticity: Whether offline tasks, batch jobs, and high-priority online tasks can use different scheduling strategies and cost tiers.

    In other words, model selection is shifting from “buying a cheaper API” to “building a sustainable AI cost-governance system.”


    7. Conclusion: Price Increases Push AI Engineering Toward Greater Precision

    On the surface, raising the output price to 100 RMB per million tokens, the uncached input price to 20 RMB per million tokens, and lowering the cache-hit input price to 1 RMB per million tokens understandably raises cost concerns. But on closer analysis, this is not simply a “price increase,” but an inevitable result of model services moving from the conversational era into the agent era.

    In the conversational era, a request’s context was short, its output was short, and its call chain was simple, so price changes had limited impact on users. In the agent era, task chains grow longer, tool calls increase, context keeps accumulating, and output becomes more complex, so the compute, storage, and bandwidth pressure on the inference side all rise significantly. At this point, cache hits, context management, model routing, output control, and cost observability all become key determinants of real cost.

    For enterprise developers, the real concern is not “whether the unit price rises,” but “whether the blended cost of completing a task under your own business workload stays under control.” Long-running tasks with high cache hit rates can dilute most of the input cost, while highly fragmented requests that cannot reuse context will bear a higher unit price.

    Therefore, the future competition in AI applications will not only be about model parameters and quality, but also about engineering systems, cost governance, and scheduling capability. Whoever does well on cache hits, context compression, model tiering, task orchestration, and monitoring and alerting will maintain a healthier cost structure through this new round of price changes.