LLM API Peak-Off-Peak Pricing and Cost Optimization Practices
This article explains how a shift to all-day off-peak pricing on weekends changes the economics of large language model API usage. It includes a reusable cost model, a comparison of daily costs across model tiers and input/output ratios, four practical cost-control levers (cache hit rate, output length, tiered routing, and asynchronous batching), and guidance on avoiding organizational side effects. Readers will learn how to build a billing baseline and keep inference costs stable over time.
1. From “Weekend Makeup Workdays” to “All-Day Weekend Off-Peak”: What the Pricing Change Means
In late August, a cloud provider adjusted the price structure of its LLM inference service: weekdays (Monday to Friday) continue to use the two-tier peak/off-peak pricing, while Saturday and Sunday are billed at the off-peak rate for the entire day. On the surface, this looks like a calendar-level change. In practice, it corrects a mismatch between the supply curve and the demand curve.
The original time-of-day pricing rested on a simple assumption: overall load drops on rest days, so moving makeup workdays or overtime to the weekend would unlock lower prices. In reality, enterprise R&D and operations activity is heavily concentrated on weekdays, and weekend compute demand is already low. Moving tasks to the weekend does not change the behavior pattern of most teams, which is “call during the day, idle at night.” Peak-hour calls still fall into the peak price band, so the optimization benefit is close to zero.
Under the adjusted rule, the pricing anchor shifts from “whether the enterprise is working” to “whether the cluster is in a high-load window,” which is closer to the facts of resource scheduling. For users, there are three direct implications:
- The billing model is simpler. Capacity planning can be modeled directly as “5 peak/off-peak days + 2 off-peak days,” with no special branch needed for makeup workdays.
- There is more room to schedule long-running, deferrable tasks, and the weekend becomes a stable low-price window.
- The focus of cost optimization shifts from “moving tasks in time” to “improving hit rate, controlling output length, and tiered routing.”
2. Doing the Math: A Reusable Cost Model
The absolute values of time-of-day pricing do not matter; the difference structure does. Let the daily call volume be T (tokens), the cache hit rate be h, the input share be p, and the output share be 1-p. Let the off-peak and peak unit prices be (a_in, a_out) and (b_in, b_out), respectively. Then:
Cost_offpeak = T * [ h*p*a_in + (1-h)*p*a_in + (1-p)*a_out ]Cost_peak = T * [ h*p*b_in + (1-h)*p*b_in + (1-p)*b_out ]Δ = Cost_peak - Cost_offpeak
Because the price ratio between “cache hit input” and “cache miss input” is fixed within the same tier, Δ simplifies to “total token cost in that tier × (1 - off-peak unit price / peak unit price).” Take a general tier where peak is about 2x off-peak, with T = 10 billion tokens and h = 95%:
| Scenario | Input/Output | Off-Peak Day Cost | Peak Day Cost | Daily Difference |
|---|---|---|---|---|
| Lightweight tier | 95% / 5% | ≈ CNY 3.4K | ≈ CNY 6.8K | ≈ CNY 3.4K |
| Lightweight tier | 80% / 20% | ≈ CNY 10.0K | ≈ CNY 20.0K | ≈ CNY 10.0K |
| High-capability tier | 95% / 5% | ≈ CNY 10.2K | ≈ CNY 20.5K | ≈ CNY 10.2K |
| High-capability tier | 80% / 20% | ≈ CNY 29.9K | ≈ CNY 59.9K | ≈ CNY 29.9K |
Two conclusions are worth emphasizing. First, the output share is an amplifier of the bill: when output rises from 5% to 20%, total cost roughly triples, because the output unit price is typically about 3x the input price. Second, model tier and share are multiplicative, so cost governance must address both “choosing a smaller model” and “compressing output.” Optimizing only one has limited effect.
3. Four Levers for Cost Governance
1) Cache hit rate. The cached portion typically costs only one-tenth to one-twentieth of the uncached input. The practice is to fix the system prompt, tool definitions, and long document prefixes at the very front and keep them byte-level stable, avoiding timestamps or random IDs in the prefix.
[Stable prefix: system instructions + tool schema + knowledge snippets] ← cacheable[Volatile part: user question + timestamp + session ID] ← placed at the end
2) Output length. Replace free-form generation with structured constraints. Ask for the skeleton first, then fill in the content, which can significantly reduce tokens:
Requirement: output JSON only, with fixed fields {title,summary,tags}, and summary no longer than 120 characters.
3) Tiered routing. Route by difficulty to different capability tiers: use a small model for classification, extraction, and rewriting, and reserve complex reasoning for the high-capability model. Also set a per-request token limit and timeout circuit breaker.
4) Batching and asynchrony. Convert offline evaluation, log summarization, and batch translation into queue-driven asynchronous jobs. Use a message queue to smooth peaks, and persist intermediate results to object storage, which naturally lands in the off-peak window.
4. Watch Out for “Reverse Optimization”: Organizational Side Effects
Once the low-price window is stable, two non-technical problems tend to appear. First, weekday limits with weekend openness can cause high-consumption jobs to pile up passively on weekends, forming a new local peak. Second, simply allocating a “cost reduction” target to teams can incentivize delaying delivery just to hit the off-peak window.
The response is to write cost constraints into engineering standards rather than manual approvals: set a token budget and alert threshold for each business line, use monitoring alerts and logging services for usage attribution, and assess by “cost per unit of business output” rather than “total bill.” At the same time, set a maximum delay SLA for deferrable tasks to avoid sacrificing timeliness for savings.
5. Implementation Checklist
- Use the formula above to build your own billing baseline, and clarify the three sensitive parameters: h, p, and the tier multiplier.
- Prioritize prefix stabilization and output constraints; these two usually deliver the fastest returns.
- Make the batch pipeline asynchronous and schedule it in the weekend and nighttime off-peak windows.
- Establish a closed loop of budget, attribution, and alerting, and reserve peak headroom in capacity planning.
- Review rule changes once per quarter, and treat pricing strategy as a tunable parameter rather than a hard-coded constant.
The essence of time-of-day pricing is to transmit the economic signal of load balancing to users. Only by understanding the rules, quantifying the difference, and changing how you call the API can you achieve a stable and sustainable cost curve on general-purpose inference services such as those offered by Baidu AI Cloud.
