AI Model Output Prices Up 5x: How to Evaluate Input, Output, and Cache Costs
As Large Language Models (LLMs) transition from simple chatbots to code generation, AI agents, and automated workflows, API pricing has become a critical factor in technology selection. With flagship model output prices potentially surging by 5x, developers often question whether the cost-to-performance ratio has dropped and if caching can offset these expenses. This article provides a comprehensive analysis of LLM billing structures—input, output, and cache—and explores the reasons behind price hikes. It offers practical formulas for calculating true usage costs, caching strategies, comparisons between subscription and pay-as-you-go models, and actionable methods to optimize overall AI expenditure.
As large language models (LLMs) transition from simple chatbots to code generation, AI agents, document analysis, and automated workflows, API pricing has become a critical variable in technology selection. Especially when a generation of flagship models sees an output price increase of about 5x compared to the previous generation—reaching around “20 units per million input tokens, 100 units per million output tokens, and 1 unit per million cached input tokens”—developers typically raise two questions:
First, does a price increase mean a decline in cost-effectiveness?
Second, since cache prices are very low, can context reuse offset output costs?
To answer these questions, you cannot simply compare “cost per million tokens.” Instead, you must conduct a comprehensive analysis across multiple dimensions: task value, token structure, cache hit rate, invocation patterns, and alternative solutions.
1. Understanding the Three Billing Types: Input, Output, and Cache
Most pay-as-you-go models split costs into input tokens and output tokens. Some services also offer a cache price for context that has already been processed and can be reused.
1.1 Input Token Costs
Input tokens include all content sent to the model, such as:
- System prompts;
- User questions;
- Conversation history;
- Code files;
- Retrieval results;
- Tool call results;
- Structured business data;
- Billing quantities for images or other multimodal content after encoding.
Input prices are typically lower than output prices because input mainly involves the model understanding existing information, while output requires step-by-step content generation and consumes more inference resources.
However, input tokens are not necessarily cheap. For code agents, long-document Q&A, and enterprise knowledge base scenarios, a single request might carry tens of thousands or even hundreds of thousands of tokens. If the full context is re-transmitted every time, input costs will accumulate rapidly.
1.2 Output Token Costs
Output tokens are the content generated by the model, including natural language answers, code, tool call parameters, execution plans, and intermediate reasoning results.
The output price is significantly higher than the input price, usually reflecting the following factors:
- The generation process requires step-by-step inference;
- Stronger models often have higher reasoning complexity;
- Long outputs occupy computing resources for a longer time;
- Code generation and agent tasks may require multiple rounds of planning;
- Output quality, stability, and success rates for complex tasks may be higher.
Therefore, a 5x increase in output price does not mean the overall usage cost will inevitably increase by 5x. The true cost depends on the proportion of input and output in the total tokens.
For example, if a request has 100,000 input tokens and 10,000 output tokens, calculated at an input price of 20 units and an output price of 100 units:
- Input cost: 100,000 ÷ 1,000,000 × 20 = 2 units;
- Output cost: 10,000 ÷ 1,000,000 × 100 = 1 unit;
- Total cost per call is about 3 units.
If the same task outputs only 2,000 tokens, the total cost is about 2.2 units. It is evident that in long-context tasks, output cost is not necessarily the sole determining factor; however, for code generation, complex analysis, and AI agents, output length often becomes the primary cost source.
1.3 Cache Hit Costs
Caching is usually used for recurring prefix content, such as:
- Fixed system prompts;
- Long project specifications;
- General codebase documentation;
- Enterprise knowledge base index information;
- Workflow role definitions;
- Historical context that does not change frequently.
When a part of the request matches previously processed content, the server may directly reuse the relevant computation results and bill at a lower cached input price.
Note that caching is not “automatically free for all inputs,” nor is it simply saving historical messages. Whether a cache hit occurs usually depends on the following conditions:
- Whether the prefix content is exactly identical;
- Whether the cache validity period has expired;
- Whether the request structure conforms to caching rules;
- Whether the system allows caching of this type of content;
- Whether dynamic content is placed before the fixed prefix;
- How cache capacity and eviction policies are configured.
If the system prompt is modified for every request, different project descriptions are inserted, or dynamic content is placed before fixed content, most of the context may not be reusable.
2. Why Flagship Model Prices Increase Significantly
Price increases are usually not just simple market pricing changes; they often involve changes in model scale, reasoning capabilities, and service forms.
2.1 Higher Success Rates for Complex Tasks
In simple Q&A, the differences between models may not be obvious. But in the following tasks, the advantages of flagship models are more easily reflected:
- Locating issues across multiple files;
- Understanding complex business constraints;
- Generating runnable, complete code;
- Automatically breaking down multi-step tasks;
- Revising implementations based on test results;
- Handling dependencies within long contexts;
- Clarifying and planning for ambiguous requirements.
If a model can reduce the number of manual reviews and lower the probability of rework, the higher per-token price may be offset by lower total effort.
2.2 Longer Outputs and More Reasoning Rounds
In AI agent scenarios, a single “user request” might correspond to multiple internal calls:
- Analyze the task;
- Read files;
- Plan the modification scheme;
- Call tools;
- Check execution results;
- Generate a patch;
- Run tests again;
- Output final instructions.
If developers only focus on the final reply seen on the frontend, they will underestimate the actual token consumption. The true cost should be calculated based on the complete call chain, not just a single conversation turn.
2.3 Long Context Capabilities Expand Problem Scope
Long context can reduce manual splitting work, but it may also cause a single request to carry more irrelevant information. The fact that a model can process more content does not mean all content should be sent to it.
If a task only requires checking three files but the entire codebase is put into the context, even if caching can reduce some input costs, it may increase retrieval noise, prolong response times, and raise overall call costs.
3. How to Calculate True Usage Costs
It is recommended to use the following formula to estimate the cost of a single call:
Total Cost = New Input Tokens × Input Price + Cache Hit Tokens × Cache Price + Output Tokens × Output Price
If priced per million tokens, it can be written as:
**Total Cost = (New Input Volume ÷ 1,000,000 × Input Price)
- (Cache Input Volume ÷ 1,000,000 × Cache Price)
- (Output Volume ÷ 1,000,000 × Output Price)**
To further calculate monthly costs:
Monthly Cost = Single Call Cost × Daily Calls × Days Used per Month
For example, a team performs 100 code analysis tasks daily, with each task averaging:
- 20,000 new input tokens;
- 80,000 cached input tokens;
- 5,000 output tokens.
Calculated at an input price of 20 units, cache price of 1 unit, and output price of 100 units:
- New input cost: 0.02 × 20 = 0.4 units;
- Cache input cost: 0.08 × 1 = 0.08 units;
- Output cost: 0.005 × 100 = 0.5 units;
- Single call cost is about 0.98 units;
- Calculated over 30 days a month, the monthly cost is about 2,940 units.
This example shows that although the cache price is very low, output still accounts for a large proportion. If the average output is controlled from 5,000 tokens to 3,000 tokens, the single call cost drops by about 0.2 units, and the monthly cost can be reduced by about 600 units.
4. Can Caching Solve the Price Increase Problem?
Caching can significantly reduce the input cost of repeated context, but it cannot directly reduce output costs. Therefore, it is more suitable for solving the problem of “repeated transmission of long context” rather than solving the problem of “model generating overly long content.”
Content Suitable for Caching
- Stable system instructions;
- Version-locked project specifications;
- Interface documentation that rarely changes;
- General business rules;
- Shared code framework documentation;
- Fixed roles and output formats.
Content Unsuitable for Caching
- Current user questions;
- Real-time database results;
- High-frequency changing logs;
- Retrieval content that differs every time;
- Sensitive temporary data;
- Short text that is almost never reused between requests.
Key Principles of Cache Design
First, fixed content should be placed as far forward in the prompt as possible, and dynamic content at the back. This can increase the probability of prefix matching.
Second, stable content should be versioned. For example, update the version identifier when project specifications change to avoid mixing old and new content.
Third, do not force sending irrelevant content just to achieve cache hits. Caching reduces price but does not automatically improve task quality.
Fourth, monitor the cache hit rate. If the hit rate is consistently low, it indicates that the cache structure may not be well designed, or the business itself is not suitable for caching.
5. Choosing Between Subscription and Pay-as-you-go
In addition to directly comparing token prices, you should also distinguish between subscription and pay-as-you-go billing.
5.1 Subscription Suits High-Frequency Individual Use
If a user needs to perform code completion, refactoring, document generation, and error troubleshooting daily, a fixed monthly fee is usually easier for budget control. The advantages of subscription include:
- Clearer cost caps;
- More stable user experience;
- No need to account for each call individually;
- Suitable for interactive development;
- Easy for individuals to get started quickly.
However, subscriptions are often subject to quota, concurrency, rate, or model scope limitations. For peak-time batch processing and automated tasks, subscription quotas may not meet the demand.
5.2 Pay-as-you-go Suits Enterprises and Automated Systems
If the model is integrated into business systems, pipelines, or agent frameworks, pay-as-you-go is usually more flexible. It is suitable for:
- Batch code reviews;
- Automated test generation;
- Document classification and summarization;
- Knowledge base Q&A;
- Background tasks;
- Intelligent features in business systems.
The difficulty with pay-as-you-go lies in cost fluctuation. You must set budgets, rate limits, maximum tokens per request, and anomaly alerts. Otherwise, a loop error or an out-of-control agent could generate massive costs.
5.3 Hybrid Models are Usually More Reasonable
In practice, a tiered strategy can be adopted:
- Use fixed quotas for daily interactions;
- Use pay-as-you-go APIs for batch tasks;
- Use low-cost models for simple tasks;
- Upgrade to flagship models for complex tasks;
- Enable caching for stable context;
- Retain manual confirmation for high-risk tasks.
This approach is more likely to balance performance and cost than “using the strongest model for all requests.”
6. Specific Methods to Reduce Model Costs
6.1 Control Output Limits
When output token prices are high, you should explicitly require the model to:
- Only return necessary conclusions;
- Use patch format for code modifications;
- Avoid pasting complete files repeatedly;
- Split detailed explanations into on-demand requests;
- Summarize logs and error messages.
6.2 Use Retrieval Instead of Bulk Injection
For large codebases or knowledge bases, do not send all content to the model at once. You can first filter candidate content through search, indexing, and relevance ranking, and then place the most relevant fragments into the context.
6.3 Task-Level Routing
Model routing can be performed according to task complexity:
- Format conversion, simple summarization: low-cost models;
- Routine code completion: medium models;
- Architecture design, complex debugging: flagship models;
- High-risk modifications: flagship models plus manual review.
6.4 Track Complete Usage
Monitoring metrics should at least include:
- Input tokens;
- Output tokens;
- Cache hit tokens;
- Cache hit rate;
- Cost per request;
- Monthly cost per user or project;
- Number of failed retries;
- Average call rounds per agent.
Without usage data, it is impossible to determine what the price increase actually impacts.
7. How to Ultimately Judge Whether a Model is “Expensive”
Judging model prices cannot rely solely on unit price; you should focus on the cost per unit of effective output.
The following metric can be used:
Effective Task Cost = Total Call Cost ÷ Number of Successfully Completed Tasks
If, after switching models, the single call price increases, but:
- The task success rate improves;
- Manual revision time decreases;
- The number of retries drops;
- Delivery speed accelerates;
- Code defects decrease;
Then the overall investment may not increase.
Conversely, if the model output is long but frequently deviates from requirements, or requires multiple rounds of rework, it may not be a good deal even if the input price is low.
Therefore, a 5x increase in output price should be seen as a signal to recalculate, rather than a simple “do not use.” For low-frequency, simple, short-output tasks, a high-priced flagship model may indeed be uneconomical; for complex code, long-context, and high-value automated tasks, as long as it can reduce manual labor costs, a higher price may still be reasonable.
The safest approach is to first establish a sample of real usage, separately count the proportions of input, output, and cache hits, and then conduct small-scale A/B testing to compare the “total cost per successful task.” This is closer to actual business decision-making than simply comparing prices per million tokens.
