LLM API Peak-Valley Pricing Tested: How to Calculate Costs After the Price Increase
This article examines a time-of-use pricing scheme recently introduced by a large model API platform, under which peak-hour rates are higher than off-peak rates. It explains how the change affects input, output, and cache-hit billing. It also reports the time and cost of eight developer tasks run during peak hours, compares flagship and lightweight model tiers, and offers practical steps to control API spending.
1. Background: What Peak-Valley Pricing Changes
A large model platform recently made a major adjustment to its API pricing. It introduced time-of-use pricing, which charges different unit rates for peak and off-peak hours. According to the published price list, the input price of its flagship-tier model during peak hours rose to three times the previous level. The output price increased even more. The most controversial change affects cache hits. The cache-hit price jumped by an order of magnitude, from a previously negligible level to an increase of more than tenfold.
To understand the impact, it helps to review the main billing dimensions:
- Input cost: Charged by the number of prompt tokens in each request. It is usually the lower-priced part of the bill.
- Output cost: Charged by the number of tokens the model generates. Output tokens cost more than input tokens, and the sharp increase in output prices after this adjustment hits heavy users hardest.
- Cache-hit cost: Applies to repeated prefix content, such as system prompts and long context documents. Cached content used to cost far less than regular input. This discount was a key way for multi-turn chat and retrieval-augmented generation (RAG) applications to control costs. After the adjustment, the discount shrank considerably.
Peak-valley pricing is not new. Peak-valley electricity pricing is an established precedent in the power industry. The business logic is straightforward. Inference compute is in short supply during peak hours, so price signals encourage non-urgent workloads to move to off-peak hours. This smooths the load curve and improves resource utilization. If a business can run batch or scheduled jobs off-peak, it could in theory reduce costs considerably. The problem is that high-frequency, interactive applications, such as online customer support and coding assistants, are difficult to schedule around peak hours. These applications have to absorb the higher prices.
2. How to Evaluate Cost-Effectiveness After a Price Change
Judging a price change by intuition is unreliable. A more rigorous approach is a repeatable test: fix the task set and acceptance criteria, run every task under the same conditions (in this case, all during peak hours), record the time and cost of each task category, and then compare the results.
The following records come from eight real-world tasks, all run during peak hours. The tasks cover typical scenarios in which developers use large models. Each task had a defined deliverable and acceptance criteria, which avoids vague conclusions such as “it ran, so it works.”
1. Front-End Development
Task: Build a responsive data dashboard from scratch. It includes chart rendering, a data list, search and filtering, and mobile adaptation. The acceptance criterion was that the page works correctly on both desktop and mobile. The run took about 12 minutes and cost 1.85 yuan (CNY). This cost buys one working front-end prototype, which can still appeal to individual developers. However, if the output needs several rounds of refinement, the cost grows roughly linearly with each round.
2. Back-End Development
Task: Implement a user management API from scratch. It covers create, read, update, and delete operations, pagination, parameter validation, and unified error handling. Acceptance was based on passing an interface test suite. The run took about 4 minutes and cost 0.74 yuan (CNY), and all tests passed. Compared with the front-end task, this task was faster and cost less, even though its output was dense in tokens. This suggests that the size of the output is the primary driver of cost.
3. Full-Stack Development
Task: Build a complete task management system, with the front end, back end, data persistence, and integration all working end to end. The run took about 17 minutes and cost 3.27 yuan (CNY), the most expensive of all eight tasks. The reason is straightforward. Full-stack tasks have the longest context and the most round trips, so their total input and output tokens are much higher than those of single-role tasks.
4. Bug Fixing
Task: In a working project, four types of defects were planted: a search malfunction, incorrect data display, a mobile layout problem, and a runtime error. The model had to locate, fix, and verify each defect on its own. The run took about 3 minutes and cost 0.94 yuan (CNY). For bug fixes with clearly defined locations, the model is economical. It may cost much less than manual debugging.
5. Data Analysis
Task: Prepare a business report with about 1,000 records. The data intentionally included missing values, duplicate rows, and outliers. The model had to clean the data, compute statistics, and produce an analysis report. The run took about 6 minutes and cost 1.19 yuan (CNY). Data tasks have a high share of input tokens, because the raw data goes into the context. As a result, changes in input prices affect these tasks more than changes in output prices.
6. Office Automation
Task: Automatically clean, merge, and summarize three months of sales records, then generate a summary file. The run took about 10 minutes and cost 1.67 yuan (CNY). For recurring jobs at high volume, moving the work to off-peak hours is the most valuable option, since it directly captures the price difference.
7. Image Processing
Task: Write and run a script to resize, compress, add watermarks to, and report file size statistics for 10 images of different dimensions. The run took about 4 minutes and cost 0.83 yuan (CNY). Essentially, this task asks the model to write a script. The model’s output is code rather than the processed images, so the cost stays manageable.
8. Web Automation
Task: Write and run an automation script for a fixed registration page. The script covers form filling, clicking, validation, and error scenarios. The run took under 2 minutes and cost 0.4 yuan (CNY), the cheapest of all tasks.
Summary: The eight tasks cost about 10.89 yuan (CNY) in total. Full-stack development was the most expensive at 3.27 yuan, and web automation was the cheapest at 0.4 yuan.
3. Model Tiers: Is the Expensive Model Always Worth It?
For the same full-stack development requirement, I also ran a test with a lower-tier model on the same platform, using an identical prompt and identical acceptance criteria. The flagship tier took 17 minutes and cost 3.27 yuan (CNY). The lightweight tier took 19 minutes and cost 1.12 yuan (CNY). The lightweight tier took only 2 minutes longer, but its cost was about one-third of the flagship’s.
This comparison leads to a key conclusion: for engineering tasks with a clear structure and explicit acceptance criteria, the lightweight tier adds little time but saves a lot of money. A sound approach is to route tasks by complexity:
- Complex reasoning, architecture design, and difficult debugging go to the flagship tier.
- CRUD generation, script writing, format conversion, and simple fixes go to the lightweight tier.
- Batch offline jobs are scheduled for off-peak hours.
4. Cost Optimization Checklist for Developers
- Reassess your caching strategy. Cache-hit prices have increased, so the savings from relying on long system prompts plus caching are smaller now. Trim your system prompts and remove redundant context.
- Control context growth. In multi-turn conversations, prune old messages promptly. For long documents, use retrieval instead of inserting the full text. Reducing input tokens helps at every model tier.
- Set output limits. Set reasonable maximum output lengths for generation requests. This matters more when output prices are high.
- Schedule tasks by time window. Use the off-peak pricing the platform offers. Run batch processing, report generation, and other non-real-time jobs during the cheaper hours, and use a message queue to smooth out peak demand.
- Track costs. Tag each API call with its business function, then track token usage and spending by task type. After a price increase, this makes it much faster to find where costs concentrate. The core idea is simple:
# Pseudocode: route tasks to model tiers by task typedef route(task):if task.complexity == "high":return "pro_model"if task.is_batch and not task.urgent:schedule(task, window="off_peak")return "flash_model"return "flash_model"
5. Conclusion
A price change does not necessarily make a model less cost-effective. It may mark the end of calling models indiscriminately. The test results show that even at peak-hour prices and after the increase, completing a usable full-stack deliverable costs only a few yuan. The real risk is large-scale online usage without cost awareness. Grading tasks by complexity, scheduling them by time window, and trimming context form a practical three-part approach. Most teams can keep their unit costs healthy under the new pricing with these measures.
