Evaluating Peak and Valley Token Pricing for Large Language Models
This article explores how to evaluate the recent shift toward peak and valley token pricing for large language models. It breaks down the roles of input, output, and cache-hit tokens, and analyzes the underlying logic of pricing restructuring. Developers and enterprise users will learn how to assess overall costs, leverage off-peak scheduling, optimize cache hit rates, and implement model layering to mitigate expenses, ensuring an efficient and observable LLM integration strategy.
Recently, some large language model (LLM) services have adjusted their pricing, adopting a more pronounced peak and valley pricing model. On the surface, the price changes for different token types seem scattered. However, when comparing input tokens, output tokens, and cache-hit tokens together, the core change isn’t a simple “across-the-board price hike” but a restructuring of the proportional relationship among these three token types.
For developers and enterprise users, the focus shouldn’t be on how much a single unit price has increased, but rather: whether the pricing structure aligns with resource consumption patterns, when business traffic primarily occurs, and whether current API call methods can leverage caching, off-peak scheduling, and model layering to reduce overall costs.
1. Understanding the Three Types of Tokens
Tokens are the basic units of measurement used by LLMs to process text. They don’t strictly correspond to words or characters, as the actual count is affected by language, punctuation, code formatting, and tokenization. Therefore, billing is typically based on the number of tokens rather than the number of API requests.
The three common types of tokens can be understood as:
1. Input Tokens
Input tokens are the content sent to the model, including questions, system prompts, chat history, business data, tool call results, and retrieved context.
In practice, input tokens are often underestimated. A seemingly short user question paired with lengthy system instructions, multiple rounds of chat history, and extensive retrieved context can result in an input size far exceeding the visible text.
2. Output Tokens
Output tokens are the responses generated by the model. Compared to input, output usually requires more computational resources because the model generates results autoregressively, with each new token potentially involving a new inference step.
Tasks like code generation, long-form writing, report summarization, and structured data generation typically produce long outputs. Thus, even with minimal input, output costs can become a significant part of the total expense.
3. Cache Hit Tokens
Cache hit tokens refer to instances where part of the request’s context matches previously processed content. The service can reuse existing computation results without repeating the entire processing pipeline.
Typical scenarios include fixed system prompts, long-term role settings, unified knowledge base prefixes, recurring business rules, and retained historical context in multi-turn conversations.
The value of caching extends beyond a “discount.” It reduces redundant computation, lowers latency, and improves resource utilization in high-frequency scenarios. However, whether caching takes effect usually depends on context stability, request structure consistency, and the provider’s specific caching policies.
2. The Unified Logic Behind Apparent Price Chaos
If only comparing unit prices before and after an adjustment, users might conclude that different items have inconsistent price hikes. However, pricing systems are usually evaluated by the relative ratios of the three token types, not just individual price fluctuations.
A common design approach includes:
- Base input tokens as the foundational price;
- Output tokens priced higher due to increased compute costs;
- Cache hit tokens billed at a lower rate;
- Peak hours priced higher than off-peak hours;
- Different price tiers for different models, context lengths, or service levels.
The logic here is that generating outputs and processing long contexts for the first time require more compute resources, while cache hits reuse existing results, naturally justifying different prices.
In other words, what is unified is not the percentage increase of each item, but the “multiplier relationship between input, output, and cache hits.” Once the ratio is normalized, providers can use a clearer cost model to explain price differences across various scenarios.
3. Peak and Valley Pricing: Factoring Time into Cost Calculations
Traditional billing focuses on request volume and token count. Peak and valley pricing introduces time as a factor.
During peak hours, a large number of users send requests simultaneously, putting higher pressure on compute resources, GPU memory, networks, and scheduling systems. If a provider charges the same price at all times, it must provision capacity for peak demand, leading to idle resources during off-peak periods.
The primary goals of peak and valley pricing are:
- To suppress non-urgent requests during peak times via higher prices;
- To attract delay-tolerant tasks during off-peak times;
- To improve overall resource utilization;
- To allow different businesses to bear costs based on their time sensitivity.
For example, online customer service, real-time moderation, and interactive coding are highly time-sensitive and cannot be easily delayed. Conversely, batch summarization, offline classification, historical data cleaning, and periodic report generation can be scheduled for off-peak execution.
From a resource scheduling perspective, peak and valley pricing doesn’t necessarily mean a massive increase in overall costs for all users. For tasks that can be shifted to off-peak hours, lower off-peak prices might offset or even mitigate the impact of peak prices. The businesses most affected are usually those that must run continuously during peak hours and cannot queue their tasks.
4. Four Metrics to Determine if the Pricing is Acceptable
1. Look at Overall Cost, Not Unit Price
Enterprises should not focus solely on the price hike of a single token type. Instead, calculate the complete cost per business unit.
You can estimate using the following logic:
Single Request Cost =Input Token Count * Input Unit Price+ Output Token Count * Output Unit Price+ Cache Hit Token Count * Cache Unit Price
If peak and valley differences apply, further split the calculation by actual time of occurrence:
Monthly Total Cost =Peak Hour Request Cost+ Off-Peak Hour Request Cost+ Failed Retry Cost+ Supplementary Call Cost
Note that failed retries, timeout retries, and invalid requests are often overlooked but can accumulate significant expenses in large-scale systems.
2. Evaluate Off-Peak Scheduling Capability
Peak shifting isn’t just about delaying all tasks; it requires distinguishing task priorities.
Tasks can be categorized into three types:
- Real-time tasks: Must complete within seconds or minutes;
- Quasi-real-time tasks: Allow some delay;
- Offline tasks: Can be queued and processed when resources are available.
Real-time tasks usually must accept peak prices, but quasi-real-time and offline tasks can reduce costs through queue scheduling, timed execution, and batch merging.
3. Check if the Cache Hit Rate is Sufficiently High
If your system sends the same lengthy prompt with every request, there is theoretical room for caching. However, whether it actually hits depends on the stability of the request prefix.
Common factors affecting cache hits include:
- Mixing fixed and dynamic content;
- Changing the system prompt with every request;
- Inconsistent ordering of historical messages;
- Inserting random fields before the stable prefix;
- Inconsistent request formats or serialization methods.
Therefore, cache optimization isn’t about blindly adding context, but placing stable content at the beginning and dynamic content (like user queries, timestamps, random IDs) at the end, while keeping the request structure consistent.
4. Assess if the Price Buys Stability
If a price increase brings more stable response times, lower failure rates, and clearer resource guarantees during peak hours, users must factor stability into their evaluation.
For scenarios like payments, risk control, customer service, and production operations, a single timeout can cause business losses far exceeding the token price difference. Therefore, do not judge a solution solely by unit price; pay attention to latency, success rates, rate-limiting probabilities, and failover capabilities.
5. Cost-Reduction Strategies for Developers
1. Trim Invalid Context
Longer context doesn’t always mean higher quality. Regularly clean up duplicate rules, irrelevant chat history, and intermediate results from completed tasks.
Adopt the following practices:
- Periodically summarize chat history;
- Retain only messages relevant to the current task;
- Limit the number of retrieved results;
- Remove duplicate documents and redundant fields;
- Prune fields in structured data.
2. Design a Stable Prompt Structure
Split the request into stable and dynamic parts:
Stable Prefix:Role definitionOutput formatBusiness rulesSecurity constraintsDynamic Suffix:User queryCurrent dataTime informationTask parameters
This structure facilitates cache reuse and simplifies future maintenance. Note that actual cache hit rules are determined by the service provider; developers should verify through monitoring rather than assuming caching works based solely on request format.
3. Establish a Model Layering Mechanism
Not all tasks require the same high-capability model. Build a tiering strategy based on task difficulty:
- Simple classification, format conversion: Use lightweight models;
- Standard Q&A and summarization: Use general-purpose models;
- Complex reasoning, code analysis: Use high-capability models;
- High-risk tasks: Add manual review or secondary verification.
The goal of model layering is finding an acceptable balance among accuracy, response speed, and cost—not just pursuing the lowest price.
4. Bound the Output Length
Longer outputs generally mean higher costs and potentially longer response times. Set reasonable maximum output limits based on task requirements and explicitly state them in the prompt:
- Return only necessary fields;
- Use a fixed format;
- Do not repeat the question and background;
- Prioritize conclusions when limits are exceeded;
- Generate long texts in stages.
For structured outputs, ask the model to provide a brief result first, then expand details as needed, preventing every request from generating long-form content by default.
5. Batch and Queue Requests
Offline tasks can enter a unified queue, executed by a scheduling system based on priority, time windows, and budget. This leverages off-peak hours and prevents multiple services from triggering massive concurrent requests simultaneously.
The queue system should also support:
- Failed retries;
- Maximum retry limits;
- Timeout cancellation;
- Task priority;
- Budget limits;
- Execution result logging.
6. Monitoring Metrics for Enterprises
To determine if peak and valley pricing impacts your business, monitor at least the following data:
- Daily input token count;
- Daily output token count;
- Cache hit token count and hit rate;
- Proportion of peak vs. off-peak requests;
- Average cost per request;
- Average cost per business unit;
- Request success rate;
- Average response time and tail latency;
- Number of retries;
- Model usage ratio across different tasks.
Reviewing only the monthly total bill is insufficient. Enterprises must break down costs by application, department, project, and task type to find the true sources of waste.
For example, a bill increase might not be caused by a price change, but by longer historical context, increased output length, runaway auto-retries, or a surge in calls after launching a new feature. Only by separating “price factors” from “usage factors” can you make an accurate assessment.
7. A Rational Conclusion on Peak and Valley Pricing
Whether peak and valley pricing is worth accepting has no universal answer; it depends on business characteristics.
For businesses with high real-time requirements, fixed call times, and low cache reuse rates, peak prices will directly increase operational costs, requiring a careful evaluation of budgets and alternative solutions.
For businesses with numerous offline tasks, stable context structures, and queue scheduling capabilities, peak and valley pricing might actually provide optimization opportunities. Through off-peak execution, cache reuse, batch processing, and model layering, overall costs may not rise in tandem with surface-level price hikes.
Therefore, when evaluating price adjustments, follow three principles:
First, don’t just look at the price increase percentage; look at the overall cost of the actual business.
Second, don’t just compare input prices; analyze output ratios and cache hit rates simultaneously.
Third, don’t passively accept bill changes; actively alter your cost structure through scheduling, monitoring, and prompt engineering.
In the long run, LLM service pricing systems will become increasingly granular. Token types, computational complexity, time windows, resource priority, and service quality may all become pricing factors. What developers truly need to build is not an emotional reaction to a single price adjustment, but an observable, schedulable, and optimizable LLM call system. Only by unifying call volume, task timing, context structure, and business value can you accurately determine whether peak and valley pricing is a cost burden or an opportunity to optimize resource utilization.
