How to reduce LLM costs: nine changes, ranked by payoff
- 1. Route by task class (60–85% off)
- 2. Stop retrying after the first token (5–20% off)
- 3. Price the model, not the vendor (10–40% off)
- 4. Cache the fixed prefix (5–25% off on prompt-heavy work)
- 5. Cut output tokens, not input (10–30% off)
- 6. Trim context with retrieval, not truncation (5–40% off on document work)
- 7. Batch the non-interactive work (up to 50% off)
- 8. Kill duplicate calls (varies, often 10%+)
- 9. Meter per feature, or you cannot manage any of this
- What the order means
- Where these numbers come from
Anyone who has tried to cut an inference bill has met the same advice: use a smaller model, shorten your prompts, cache. All true, all vague, and none of it ordered.
This is ordered. The percentages are from re-pricing typical chat and extraction workloads against live marketplace rates, and they compound in the order listed.
1. Route by task class (60–85% off)
The largest single lever. Most products send every request to one model because that is what the code was written against.
Split tasks into three classes:
- Classify, extract, moderate, route → flash tier. Interchangeable outcome, 10–40× cheaper.
- Generate, summarise, rewrite → mid tier.
- Reason, plan, debug code → frontier tier, hopefully under 10% of volume.
A workload at 80/15/5 across those tiers costs roughly a fifteenth of the same traffic on the top tier alone. Nothing else on this list comes close.
2. Stop retrying after the first token (5–20% off)
Retry logic written against chat APIs usually retries on any error. But a stream that has already emitted a token is a billable completion — retrying it doubles the charge and duplicates output.
The rule: retry only before first token, only for connection-level failures, never for 4xx. Providers failing at 3–5% with naive retries add 5–20% to the bill invisibly.
3. Price the model, not the vendor (10–40% off)
The same model can be served by several independent suppliers at very different rates. On live market data the spread between the lowest offer and list price runs 84–99% depending on the model:
| Model | Market / 1M in | List / 1M in |
|---|---|---|
| deepseek-flash | $0.0056 | $0.14 |
| gemini-3.1-flash | $0.03 | $0.25 |
| claude-sonnet-5 | $0.20 | $2.00 |
| claude-opus-5 | $0.50 | $5.00 |
If your client hardcodes one vendor's endpoint, you are paying list while the market clears lower. Keep the base URL configurable and the model name in config, not in source.
4. Cache the fixed prefix (5–25% off on prompt-heavy work)
Every request that starts with the same 600-token system prompt pays for it again. Prompt caching discounts that prefix to roughly 10–25% of the input rate.
Two conditions for it to work: the prefix must be byte-stable (no timestamps, no per-user text in the system message) and the provider must support it. See OpenAI's prompt caching guide for the caching granularity, and check whether your gateway passes the cache headers through — some normalise them away.
5. Cut output tokens, not input (10–30% off)
Output costs 2–5× input. Instructions that encourage brevity — "answer in under 80 words", "return only the JSON", "no preamble" — are worth more than trimming a 900-token prompt to 850.
Also: stop asking for restated context. A model that echoes your question back is billing you for flattery.
6. Trim context with retrieval, not truncation (5–40% off on document work)
Sending a full 60k-token document for a question about one paragraph is the most common overspend in document AI. Retrieval that selects 3–5 relevant chunks changes the bill by an order of magnitude for the same answer quality.
Truncation is the crude version and it fails on the long tail; chunk-and-rerank is the version that holds.
7. Batch the non-interactive work (up to 50% off)
Background jobs — enrichment, backfills, evals, nightly summarisation — do not need interactive latency. Batch APIs and off-peak routing are priced lower for exactly that reason, and they free capacity for user-facing traffic.
8. Kill duplicate calls (varies, often 10%+)
Two patterns show up in almost every audit:
- The same prompt sent twice because a UI retried on a slow response.
- A "check then generate" sequence where the check duplicates work the generation already did.
Instrument per-feature request counts before optimising anything else; duplication hides in feature flags.
9. Meter per feature, or you cannot manage any of this
None of the above is measurable without request-level records: model, provider, tokens in, tokens out, effective unit price, latency. A monthly total tells you the bill grew; it never tells you why.
Export the rows and build one chart: cost per feature per day. Every optimisation above becomes a before/after on that chart.
What the order means
Routing (1) plus not double-billing retries (2) plus market pricing (3) is 70–90% of achievable savings on a typical product. Caching and prompt hygiene are real but smaller, and they only matter once the first three are in place.
Measure first, then change one thing at a time — otherwise you cannot tell which change paid.
Where these numbers come from
The percentages come from re-pricing a 40,000 request/day workload against live offers on the Cisoma pricing table, which shows market rates next to list prices per model. Cache behaviour is documented by each provider — OpenAI's prompt caching guide is the clearest explanation of prefix caching granularity, and FrugalGPT is the paper behind the cascade pattern in step one.
The arithmetic for your own workload is in what your prompt actually costs; the implementation detail for routing and failover is in routing and token accounting.
Model each lever before shipping it with the LLM API cost calculator, or see every rate at once in the model price comparison.
FAQ
What is the fastest way to cut an LLM bill?
Route commodity traffic to a flash-tier model and stop paying list price for models with competing suppliers. Together those two changes typically cut 70–85% with no change to what users see.
Does a cheaper model reduce quality?
It reduces quality on the tasks that need frontier reasoning, and leaves it unchanged on classification, extraction, routing and short summarisation. Route by task class rather than choosing one model for everything.
How much does prompt caching actually save?
On a workload with a 600-token fixed system prompt and 900 total input tokens, caching that prefix saves roughly 5–7% of total cost at market rate — meaningful at scale, but smaller than routing. On long-document workloads where the cached prefix is most of the prompt, it is much larger.
Is it worth self-hosting to save money?
Only above sustained volume, and only if engineering time is genuinely cheap for you. Self-hosting shifts spend from per-token fees to GPU hours and maintenance; below a few hundred dollars a month of inference, the maintenance usually costs more than the savings.
Every number on this page comes from the marketplace's own live offers. Point the OpenAI SDK at Cisoma and keep your code.
Get 100M free tokens