Large Model API Peak and Off-Peak Pricing Explained
This article breaks down how a cloud provider's shift to time-of-day pricing for large model APIs restructures billing from a one-dimensional rate into a two-dimensional model-by-time-slot matrix with fixed ratios across three token types. It explains why input tokens without cache hits, input tokens with cache hits, and output tokens must be priced separately, the supply-and-demand economics behind peak and off-peak rates, and how to convert published prices into your own bill. It also covers six engineering tactics for cost control and common pitfalls to avoid.
1. The Pattern: Scattered Increases and Decreases Are Actually Ratio Alignment
A cloud provider adjusted its large model API billing in mid-August, splitting the previous single time-slot unit price into two tiers: peak hours and off-peak hours. On the surface, the direction of decreases and increases is inconsistent across different models and cache-hit scenarios—some go up, some go down—which makes it easy to misread the change as arbitrary repricing. But if you divide every price by its corresponding token base, the post-adjustment ratios converge tightly: a stable multiplier structure is maintained across the three token types (input without cache hit, input with cache hit, and output).
In other words, the core of this adjustment is not an across-the-board price hike. It upgrades the billing structure from a “one-dimensional unit price” to a “two-dimensional unit price (model × time slot)” while fixing the relative price gaps among the three token types. Understanding this matters more than memorizing any specific tier’s number, because price is a parameter, while the ratio structure is the model.
2. Why the Three Token Types Must Be Priced Separately
The cost of large model inference is not uniform. Splitting it into three types is an inevitable result of cost attribution.
- Input without cache hit: requires a full forward pass, with compute consumption roughly linear in context length. It is the most “expensive” input form.
- Input with cache hit: the prefix already has reusable intermediate computation results, so the saved cost is repeated compute. Its unit price is therefore significantly lower than a non-hit, usually only a small fraction of it.
- Output: generated token by token in an autoregressive manner, where each step reads all weights and the existing context. This is a memory-access-intensive workload, and its unit price is usually higher than input.
Once the ratios among the three are fixed, it is equivalent to establishing a set of “weights and measures” for the entire billing system. What developers really need to care about is how their own business is distributed across these three token types, rather than looking at a single listed price.
3. The Economics Behind Peak and Off-Peak Pricing
Time-of-day pricing is not a marketing concept; it is a direct mapping of the resource supply-and-demand curve.
- The load on the compute pool has clear peaks and troughs. Daytime and weekday afternoons are concentrated call periods, while nights and early mornings have idle capacity.
- The marginal cost during peak hours includes queuing, scaling, and stability redundancy. This cost must be suppressed by price signals to curb demand.
- Off-peak resources, if not consumed, are pure loss. Using low prices to attract deferrable workloads improves both overall throughput and resource utilization.
- For users, price becomes a scheduling signal: businesses that can move tasks to off-peak hours gain a cost dividend, while those that cannot continue to pay for certainty.
This is a typical “trading price for elasticity” mechanism, consistent with the load-tiered billing approach for other resources in the cloud.
4. Cost Estimation: Converting Listed Prices into Your Own Bill
Do not judge increases or decreases by feel; first calculate your business profile. The core is to measure three quantities: average input length, cache hit rate, and output length.
# Illustration: cost estimation for a single request (unit prices are placeholders; refer to the official price list)def estimate_cost(in_tokens, cached_tokens, out_tokens,p_in, p_cached, p_out, peak: bool):fresh = max(in_tokens - cached_tokens, 0)factor = PEAK_FACTOR if peak else 1.0 # peak multiplier defined by the platformreturn factor * (fresh * p_in+ cached_tokens * p_cached+ out_tokens * p_out)# Daily cost and shiftable ratiodaily = sum(estimate_cost(**r) for r in requests)shiftable_ratio = 0.6 # share of requests that can be deferred to off-peaksaving = daily * (1 - shiftable_ratio * (1 - OFFPEAK_DISCOUNT))
The judgment criterion is straightforward: if a business has a high cache hit rate and a low output share, the impact of the price increase is limited or even decreases due to the off-peak discount; if it is a generation-type workload with long outputs and low hit rates, the cost increase is most pronounced and must be offset through scheduling and structural optimization.
5. Six Engineering Countermeasures
- Load migration: schedule tasks without real-time requirements—batch processing, offline summarization, data cleaning, batch annotation—to off-peak hours, using message queues for peak shaving and delayed consumption.
- Prefix stabilization: fix the system prompt, tool definitions, and few-shot examples at the very front of the request without dynamic concatenation. This is the most effective way to improve cache hit rate.
- Context slimming: in retrieval-augmented scenarios, control the number of recalled items and fragment length, replacing “context stuffing” with reranking and redundancy removal.
- Output constraints: specify maximum generation length, structured output, and early-stopping conditions to avoid the memory-access overhead of uncontrolled generation.
- Tiered routing: send simple requests to smaller-parameter models and complex requests to larger-parameter models, using rules or a lightweight classifier for upfront decisions.
- Observability: instrument logs and monitoring alerts by business line, model, time slot, and the three token types separately, forming a cost dashboard and budget alerts.
An illustration of a stable prefix structure:
[Fixed segment] system instructions + tool schema + examples ← reused across requests, cache hit[Semi-fixed segment] domain knowledge / long-term memory ← updated infrequently[Dynamic segment] current user input + retrieved fragments ← changes every time
6. Common Pitfalls
- Looking only at unit price, not structure: ignoring the ratio among the three token types leads to misreading a structural increase as a general increase.
- Treating the off-peak discount as unlimited quota: off-peak resources are also capacity-constrained, and extremely concentrated migration will again form local peaks.
- Sacrificing quality for hit rate: forcibly moving dynamic content to the front breaks semantics; hit rate rises but output quality drops, which is not worth it.
- Making a one-time big change: scheduling strategies should be rolled out gradually, using A/B comparisons to observe both the cost and quality curves.
7. Conclusion and Action Checklist
The essence of this price adjustment is expanding the billing dimension from a single price to a matrix of “time slot + token type” and locking the ratio among the three token types. For developers, a viable response path is: first quantify your own token distribution, then migrate deferrable workloads to off-peak hours, then reduce unit cost through prefix stabilization, context slimming, output constraints, and model routing, and finally use a monitoring system to turn cost into a sustainably observable metric. If finer-grained elasticity and cost isolation are needed, you can also evaluate hosting self-built inference services on Baidu AI Cloud’s container platform, using object storage and logging services to accumulate call data, forming a hybrid cost structure of “managed API + self-built inference.”
