LLM API Peak and Off-Peak Pricing: A Practical Guide to Cost Optimization
This article breaks down how modern LLM API pricing works across multiple dimensions—time of day, cache hit status, and input versus output tokens—and explains why a single "price increase" multiplier can be misleading. You will learn how to build a computable cost model, shift deferrable workloads to off-peak windows for automatic discounts, and design requests for prefix cache hits. The goal is to help engineering teams rebuild their cost strategy rather than simply judge whether an API is expensive.
1. Why One Multiplier Cannot Describe a Price Change
A platform recently released a new model framework, announced it as free and open source, and raised API prices at the same time. The most widely shared claim was “prices went up by as much as 11x.” But if you break the billing items apart, the change varies dramatically across dimensions: cached input saw the largest increase, uncached input is roughly 3x the original price, and output is roughly 4.5x. The platform also introduced two pricing tiers—peak and off-peak—with off-peak charged at half the peak rate.
So the correct reading is neither “everything went up 11x” nor “low prices were just a customer acquisition tactic and the harvesting has begun.” The real shift is that pricing moved from a single unit price to a multi-dimensional structure of time slot × cache status × input/output type. For engineering teams, the task is not to judge whether it is expensive, but to rebuild the cost model.
Note: This article does not address any specific vendor’s rules. It only discusses billing dimensions and optimization methods common across the industry. Actual prices, time slot definitions, and limits should be confirmed against the official billing documentation of the platform you use.
2. Turning the Bill into a Computable Model
Any token-based call can be abstracted into four variables: input token count, output token count, input cache hit rate, and which time slot the request falls into.
Cost per call =uncached input tokens × uncached unit price+ cached input tokens × cached unit price+ output tokens × output unit pricethen multiplied by the time slot factor (peak 1.0 / off-peak 0.5)
This formula explains why the “largest increase” often appears in the cached input item: its original price was extremely low (typically on the order of one percent of the uncached price). A small base means any adjustment shows up as a large multiplier. Uncached input and output have large bases, so the multipliers look moderate, but they often have a bigger impact on the total bill.
An illustrative comparison (numbers are for demonstration only, not real quotes):
Scenario A: long system prompt + short Q&A, cache hit rate 90%Scenario B: short prompt + long output, cache hit rate 0%Conclusion: A is sensitive to the cached price; B is sensitive to the output price and uncached price
Practical implication: before optimizing, measure whether you are A or B, then decide whether your focus should be cache reuse or output length control.
3. The First Principle of Peak/Off-Peak Pricing: Move Deferrable Workloads
Time-based pricing is essentially using price signals for capacity scheduling. There are three practical engineering approaches:
- Task classification. Split requests into online interactive (user is waiting, must run at peak) and offline batch (can tolerate minute-level to hour-level delay). Offline tasks include log summarization, batch labeling, offline evaluation, data cleaning, and report generation.
- Queue-based peak shaving. Use a message queue to hold offline tasks and consume them during off-peak windows, naturally getting a 50% discount.
- Elastic scaling. Have the container platform scale up and down based on queue length, avoiding paying for peak capacity year-round.
# Example: choose the execution window by task typedef run(task):if task.deadline_slack_minutes >= 60:enqueue(task) # hand off to the offline queue, consumed during off-peakelse:call_model(task) # online synchronous call
Note: the discount comes from the time slot, not from “using fewer calls.” Migrating deferrable workloads to off-peak windows usually yields more stable savings than compressing prompts.
4. Cache Hits: From Accidental to Actively Designed
The general principle of prefix caching is that an identical token sequence at the beginning of a request can be reused and billed at the cached price. To actively leverage it, follow three engineering constraints:
- Stable prefix: put invariant content (system instructions, tool definitions, knowledge snippets, examples) at the very front, and put per-request variable content (user input, timestamps, random IDs) at the end.
- Deterministic content: avoid concatenating time, random numbers, or variably ordered retrieval results into the prefix, otherwise
