Peak and Off-Peak Pricing for LLM APIs: How Time-Based Billing Works and How to Cut Costs
This article breaks down how peak and off-peak billing works for large language model APIs, why pricing follows the provider's capacity utilization rather than consumer demand, and how much difference the time window makes. It includes a sample cost model in Python, a guide to which workloads can be shifted to off-peak and weekend windows, the role of cache hit rate, a timezone caveat for overseas developers, and a practical action checklist for reducing API bills.
1. The Shift: A Weekly Price Tag Rewritten
A cloud provider recently changed the billing rules for its LLM inference service twice. First, it split weekdays into peak and off-peak periods, charging the standard rate at peak and half price off-peak. Then it added a rule that from midnight on Saturday and Sunday, the entire weekend is billed at the off-peak rate with no peak/off-peak distinction. The result is a weekly price tag where weekday daytime is expensive, lunch breaks and nights are cheap, and weekends are cheap all day.
The rule itself is simple, but it puts a long-overlooked issue on the table: the cost of an LLM API is no longer a scalar but a function of time. The same tokens, the same model, and the same parameters can produce a bill that differs by a factor of two depending only on when the request is made.
2. The Counterintuitive Part: The Pricing Baseline Is Not the Consumer
The common assumption is that weekends are peak AI usage time—students on break, individual developers running experiments, and backlogged tasks getting cleared. If compute demand followed consumer-side fluctuations, weekends should be the most expensive.
The actual rule is the opposite. This can only mean one thing: the demand that sets the pricing baseline comes from institutional and enterprise workloads that need real-time responses during weekday daytime. The choice of peak periods (the working hours in the morning and afternoon) matches this closely, and classifying lunch breaks and nights as off-peak also fits the activity curve of enterprise production systems.
From this we can abstract the first principle of peak/off-peak billing: time-of-use pricing is a supply-side tool for shaving peaks and filling valleys, and the price follows the provider’s own resource utilization curve, not the public’s willingness to use the service. What gets cheaper is the provider’s idle time, not the time of highest demand.
A further inference: the peak/off-peak spread is essentially a time-arbitrage mechanism, and only “movable workloads” can capture the benefit. The price signal works only for workloads whose execution time can be changed; it has no effect on rigid real-time paths.
3. The Numbers: How Large Is the Spread
Using the public tier structure of a general-purpose LLM as an illustration (per million tokens, in CNY):
| Billing item | Off-peak | Peak |
|---|---|---|
| Cached input | 0.05 | 0.10 |
| Cache-miss input | 1.5 | 3.0 |
| Output | 4.5 | 9.0 |
Peak is strictly twice off-peak. This “integer multiple” design is not arbitrary; it lets the cost model be expressed simply: bill ≈ base cost × time coefficient, where the coefficient is 1 or 2.
Assuming 10 billion tokens per day, a 95% cache hit rate, and input accounting for 95% of tokens:
- All off-peak: about CNY 3,414
- All peak: about CNY 6,828
- Daily difference: about CNY 3,400
Higher capability tiers scale proportionally, and the daily difference can reach the order of CNY 10,000. This is the real economic driver behind practices like “move batch jobs to nights or weekends”—for teams running large offline workloads, the time difference is real money.
Note that these figures are illustrative estimates based on the public unit-price structure. Actual bills depend on the model tier, caching strategy, and input/output ratio, and should be checked against the provider’s current billing documentation.
4. Cost Model: Writing the Bill as Code
To make optimization verifiable, make the billing logic explicit first:
# Illustration: time-of-use billing and cost estimationPEAK_HOURS = {(9, 12), (14, 18)} # Weekday peak periodsdef is_peak(dt, weekend_flat_offpeak=True):if weekend_flat_offpeak and dt.weekday() >= 5:return False # Weekends billed at off-peak all dayreturn dt.weekday() < 5 and (dt.hour in PEAK_HOURS)def cost(tokens_in, tokens_out, cache_hit_ratio,price, peak, weekend_flat_offpeak=True):coef = 2.0 if peak else 1.0hit = tokens_in * cache_hit_ratiomiss = tokens_in - hitreturn coef * (hit * price["in_hit"]+ miss * price["in_miss"]+ tokens_out * price["out"])def daily_bill(jobs, price, weekend_flat_offpeak=True):return sum(cost(j["in"], j["out"], j["cache"],price, is_peak(j["ts"], weekend_flat_offpeak),weekend_flat_offpeak) for j in jobs)
With this function, any scheduling strategy can be replayed against historical workloads to get a definite answer to “how much can changing the time save,” instead of relying on guesswork.
5. Which Workloads Can Move and Which Cannot
Movable (suitable for off-peak and weekend windows):
- Offline batch inference, data cleaning, and labeling assistance
- Vector store builds and index rebuilds, document chunking, and embedding backfills
- Model evaluation, regression testing, and offline A/B scoring
- Repository-level batch processing and bulk unit test generation in code generation tools
- Nightly aggregation and analysis of logs and tickets
Not movable (rigid peak spending):
- Real-time chat and completion endpoints for end users
- Synchronous risk control, moderation, and routing decisions in production paths
- Online retrieval-augmented Q&A with SLA constraints
A practical test is to ask three questions: Can the result be returned with minute-level delay? Can a failure be retried without affecting the business? Is the call triggered by an event rather than a user? Only when all three are “yes” does a workload count as movable.
6. The Underrated Factor: Cache Hit Rate
In the example above, the input side accounts for most of the cost, and the cache hit rate directly determines the unit-price structure of the input side. Raising the hit rate from 80% to 95% reduces input cost by far more than any time-window optimization. Practical engineering steps include: keeping the prefix order of the system prompt and tool descriptions stable, placing unchanging long context at the front, applying semantic-level result caching to high-frequency questions, and controlling timestamps and random strings in the context so prefix consistency is not broken.
The priority should be: first reduce the hit rate problem and input volume, then do time-based scheduling. The former is structural optimization; the latter is parametric optimization.
7. An Easily Overlooked Timezone Detail
Peak and off-peak periods are defined in the provider’s local time. For overseas developers, their daytime may fall exactly in the provider’s nighttime off-peak window. This is effectively an implicit regional discount, and it raises two practical issues: first, bill attribution for cross-timezone teams needs to be unified to a single timezone; second, “off-peak” does not mean “no congestion,” and the absolute throughput and rate-limiting behavior of low-price periods still need to be measured.
8. Reading the Signal: Price Is Also a Capacity Scheduler
Looking at the two changes together makes the logic clearer: raising peak prices uses price to push deferrable inference demand out of peak hours and free up compute for training and internal tasks; making the whole weekend off-peak means, at the margin, giving up the arrangement of “using these cards for training or on-call duty on weekends” and instead hoping to convert idle capacity into external revenue. The provider did not explain the specific reasons, but from a capacity operations perspective this is self-consistent: the marginal cost of keeping staff to maintain compute on weekends may not be lower than the revenue from renting the cards out cheaply.
The takeaway for users: price is a public signal of capacity, and reading it well lets you anticipate the provider’s capacity tightness and schedule your own heavy-task windows accordingly.
9. Action Checklist
- Tag calls with timestamps and business labels, and track the share of peak/off-peak tokens.
- Use a replay script to quantify the upper bound of savings from “migrate everything” versus “migrate partially.”
- Refactor batch jobs into interruptible, retryable queue jobs consumed by a message queue and scheduled jobs during off-peak windows.
- Set separate quotas and degradation policies for real-time paths so they do not compete with batch jobs for peak allowance.
- Build a cost dashboard with continuous monitoring and alerts on three metrics: cache hit rate, input/output ratio, and time-of-day distribution.
- Review billing rule changes once per quarter; when the rules change, the scheduling strategy must change with them.
The conclusion is straightforward: time-of-use billing is not a discount but a way of externalizing a resource utilization problem into a price problem. The real gain for developers comes not from waiting for the weekend but from reshaping their workloads into a form that “can wait”—movable workloads enjoy off-peak rates, while workloads that cannot wait optimize caching and context. Walking on both legs is what structurally lowers the bill.
