LLM API Cost Assessment After Repricing: Tokens, Caching, and Peak Windows
This article outlines a reproducible way to assess large language model API costs after pricing changes. It covers token-level cost formulas, peak and off-peak windows, cache-hit economics, output control, model tiering, gateway metering, and a budgeting checklist so teams can replace outdated discount-based estimates with auditable cost models.
Turn the problem from “one discount” into a reviewable cost model
LLM API prices are rarely a single unit rate that stays fixed for a long time. Common changes include: a limited-time discount ending and falling back to list price, a discount becoming the new regular price, additional peak and off-peak multipliers on weekdays, and different unit prices for cache hits and cache misses. If the discussion remains stuck on “is it still one quarter of the original price,” the conclusion will quickly become outdated. A more robust approach is to break a single call into additive cost items and recalculate them with the current price list instead of relying on assumptions from several months ago.
In common industry billing models, the cost of one request roughly consists of three parts:
- Fresh input (prompt and context that do not hit the cache)
- Cache hits (repeated system instructions, fixed specifications, indexed repository fragments, and similar content)
- Output (text generated by the model)
Illustrative formula (align units with the price list; a common unit is “per million tokens”):
Cost ≈ fresh input tokens × input unit price + cache-hit tokens × cache unit price + output tokens × output unit price
If a peak multiplier exists, it applies to the corresponding unit prices for that time window as a whole, not only to output. Whether weekends and holidays are counted as off-peak all day must follow the time zone defined on the pricing page; colloquial rules such as “more expensive during the day, cheaper at night” are not a substitute.
Why old answers systematically underestimate bills
A discount moving from “limited-time” to “list price” and then being covered by peak/off-peak policy involves two different pricing events. The first changes the base price; the second changes the effective price of the same base price at different times. Remembering only “about one quarter of the original price” misses both base-price increases and time-window amplification.
Here is an order-of-magnitude example solely to demonstrate the method; the numbers are not current quotes from any vendor. Suppose a coding session contains 50,000 fresh input tokens, 200,000 cache-hit tokens, and 30,000 output tokens. If the cache unit price is much lower than fresh input and the output unit price is several times the input price, total cost becomes highly sensitive to “output length” and “whether it falls in peak hours.” If the same workload is estimated using a retired uniform discount price, actual off-peak spending may be close to twice the old estimate, and peak spending may be several times higher. The difference comes from two factors: the old assumption had no time-of-day split, and the relative prices of cache and output have been widened in the new price list.
Therefore, review or procurement conclusions should include the review date and time zone. After the pricing page changes, unit prices in historical posts can serve only as background, not as a budget. On the finance side, write the “price-list version number or page review date” into the cost ledger to avoid approving quotas with expired screenshots.
Time windows: translate the clock into real usage windows
The key to time-based pricing is not memorizing two sets of numbers, but confirming whose working hours the peak period falls into. If peak is defined as several UTC hours on weekdays, after conversion to local time it often covers concentrated morning development and afternoon integration work. In other words, interactive coding, code review, and online troubleshooting — calls with a human in the loop — are naturally more likely to hit high-price windows; batch document generation, nightly regression, and offline summarization are more likely to fall into off-peak periods.
Practical scheduling principles:
- Keep necessary short interactive sessions during working hours, but limit the maximum output per call and the number of retries.
- Queue deferrable refactoring suggestions, test completion, and long-document summarization for off-peak periods or non-working days.
- Have automated pipelines explicitly record the request-originating time zone. When bills are aggregated by local business day, they must be traceable back to the pricing time zone to avoid a mismatch between “billing day” and “usage day.”
- Whether holidays are off-peak all day should follow the pricing notes. Do not mistake a make-up workday for an off-peak day.
If the platform operates its own gateway, it can use soft rate limiting instead of hard rejection: during peak hours, release only the interactive quota and place batch tasks into a delayed queue. This avoids inventing vendor APIs that do not exist and avoids relying on people remembering whether “now is expensive.”
Cache hits: save repeated context, not model capability
The cache-hit unit price is usually significantly lower than fresh input because the service avoids recomputing a stable prefix. The prerequisite for saving money is that the prefix is genuinely stable. Rewriting the system prompt every turn, randomly reordering tool instructions, or placing frequently changing logs at the very front of the prompt will invalidate the prefix, reduce the hit rate, and still bill the content as fresh input.
Recommended practices:
- Place fixed text such as the system role, coding standards, and output format at the front of the prompt, and replace it as a whole when the version changes rather than tweaking a few words every turn.
- For repository context, prioritize reusing an established session or an explicit cache key; append only changed files for incremental updates instead of resending the whole repository.
- Track “cache-hit tokens / total input tokens” as a daily metric. A drop in hit rate often shows up in the bill earlier than a unit-price increase.
- Do not stuff unrelated long text into the prompt just to increase cache hits. Cheap cache is not free; an overly long prefix still consumes context window and increases latency.
Illustrative usage-record structure (field names are only for explanation, not an interface from any cloud provider):
session_id, pricing_window, fresh_input_tokens,cache_hit_tokens, output_tokens, estimated_cost
Aggregating by day with this structure can answer whether cost is driven by peak hours, output, or cache misses, rather than showing only that the total has increased.
Output unit prices are usually higher: controlling generation is more effective than compressing questions
In most conversational billing, the output unit price is higher than the input price, sometimes by several times. If a coding assistant defaults to “write a long explanation first, then give the patch,” cost will concentrate on the generation side. Controls should target product behavior rather than repeatedly deleting user questions:
- By default, request only the diff patch and necessary explanation; make long design documents expandable on demand.
- Set maximum steps and per-step output limits for tool calls to prevent agent loops from spinning without progress.
- Retries should use backoff, and avoid feeding the previous full output back as new input unless the cache can hit reliably.
- For evaluation tasks, track “effective output” and “discarded drafts” separately; otherwise exploration cost will be mistaken for delivery cost.
Input hygiene still matters: unrelated files, repeated logs, and entire unreferenced dependency source files increase both fresh input and latency. But when the output multiplier is higher, governing generation length first is usually more cost-effective than continuing to fine-tune prompts.
Tier by task difficulty instead of using the highest tier for everything
Within the same model family, a high-capability tier suits difficult reasoning, multi-file changes, and agent tasks that require strict constraints; a lightweight tier suits format conversion, single-point edits, comments, and rewrites after simple retrieval. Tiering should be based on the cost of task failure and the number of rework cycles, not on which name sounds stronger.
Practical routing:
- First use the lightweight tier for small changes that can be verified; if tests or static checks fail, escalate to the high-capability tier and include only failure-related context.
- Enable stricter stopping conditions for the high-capability tier: stop once the pass criteria are met instead of continuing to “polish.”
- If internal orchestration is used (prompt assembly, tool permissions, memory), record the orchestration version together with the model tier. With the same model, different orchestration can change success rates and token consumption by an order of magnitude; do not attribute all performance differences to list price.
- When comparing tiers, use the same task set, the same stopping conditions, and the same caching strategy; otherwise “cheaper” may simply mean less work was done.
This article does not evaluate the relative strength of any specific model. A common phenomenon in public discussion is that out-of-the-box performance depends on default orchestration, and rankings can change after swapping in a different set of tool calls and constraints. Procurement decisions should be based on pass rate, rework count, and cost per successful task on your own task set, not on a single leaderboard or one discount event.
Integration form does not change the nature of pricing
Regardless of which common chat protocol a gateway provides, cost is still determined by tokens and time windows. Configuration only needs to confirm three things: the base URL points to an official or self-hosted compliant endpoint, the model identifier matches the name in the price list, and credentials are stored only in environment variables or a secret manager rather than in the repository. How protocol fields map should follow the documentation of the selected endpoint; this article does not invent parameter names.
If an enterprise forwards traffic through a unified gateway, metering should be done at the gateway rather than trusting only client-side estimates. Clients often cannot see whether cache hits occurred, nor can they see the server-side counting rules for special tokens. Reconcile against server-side usage; use client logs to explain “why this call was so long.”
Budget and governance checklist
Writing the following items as a checklist is more durable than remembering a discount from a particular day:
- Whether the price review date, time zone, peak windows, and cache unit prices are listed separately.
- Whether interactive and batch workloads are routed to different windows.
- Whether fixed prefixes are stable and whether hit rate has an alert threshold.
- Whether output limits, agent step counts, and retry policies are stricter during peak hours.
- Whether escalation conditions from the lightweight tier to the high-capability tier can be automated.
- Whether billing dimensions include at least application, task type, time window, and model tier.
Illustrative accounting can be done in a spreadsheet: for each task type, fill in the median fresh, cache, and output token counts, multiply them by off-peak and peak unit prices to obtain a per-call cost range, then multiply by daily call volume. A range rather than a single point is necessary to cover the real-world distribution in which “people write code during peak hours.” If an estimate based on the old discount assumption falls outside the range, update the budget instead of continuing to use an expired conclusion for approval.
Conclusion
After pricing moves from limited-time offers to regular list prices and then to time-based and cache-differentiated pricing, the right question is no longer “is it still one quarter of the original price,” but “under the current price list, current time zone, and current prompt shape, how much does one successful delivery cost?” Meter fresh input, cache hits, and output separately; reserve peak windows for short interactive sessions that require human involvement; turn stable context into cacheable prefixes; and move between tiers according to task difficulty. This turns API cost from an unexpected bill into a designable engineering parameter without relying on any one model vendor’s narrative. Specific numbers should follow the price list published by the selected service on the review date; the order-of-magnitude examples here illustrate method only and do not constitute a quote.
