Large language models keep getting cheaper per token, yet plenty of teams watch their monthly bill climb anyway. The reason is simple: prices fall, but the number of model calls per task rises even faster. The good news is that five well-understood techniques can cut a typical LLM bill by 80 percent or more without touching output quality.
This guide walks through each lever, shows the mechanism behind it, and ends with a worked dollar example that takes a hypothetical $1,800 monthly bill down to about $317.
TL;DR: The five biggest levers for cutting LLM costs are prompt caching (up to 90 percent off repeated input), model routing, trimming context, batch APIs (50 percent off), and structured outputs. Combining them can cut a typical bill by more than 80 percent, as the worked example below shows. Start with prompt caching.
What Is the Fastest Way to Reduce LLM Costs?
The fastest win for most applications is prompt caching, because production prompts almost always reuse a large fixed prefix on every call. Caching that prefix bills repeated reads at roughly 10 percent of the base input price on Anthropic and Google, and 50 percent off on OpenAI, with no change to what the model returns. After caching, the next lever is model routing: send the easy majority of tasks to a small, cheap model and reserve the frontier model for the hard minority.
The full toolkit is five techniques. Each attacks a different part of the cost equation, and they stack cleanly. Use this decision table to pick where to start.
| Technique | How it works | Typical saving | Best when |
|---|---|---|---|
| Prompt caching | Bills a repeated prompt prefix at a fraction of base input price | 50 to 90 percent off the cached portion | A stable system prompt, style guide, or docs repeat on every call |
| Model routing | Sends each task to the cheapest model that clears the quality bar | Cheap models run ~5 to 30x less per token | Your traffic is a mix of simple and hard tasks |
| Trim the context | Sends only the tokens the task needs, not the whole window | Cuts input tokens 30 to 70 percent | You pass long histories or full documents every call |
| Batch APIs | Trades immediate delivery for a flat 50 percent discount | 50 percent off input and output | Work is non-urgent: reports, backfills, embeddings |
| Structured outputs | Constrains output to a schema so retries become rare | Removes 5 to 10 percent of wasted retry calls | You parse model output into JSON downstream |
The rest of this guide explains each row, then combines them into one bill.
Why LLM Bills Grow Even as Token Prices Fall
Your bill is driven by three multipliers, not one: tokens per call, price per token, and calls per task. Providers keep pushing price per token down, but modern AI applications keep pushing calls per task up. A single user request now fans out into planning, retrieval, generation, and verification steps, so one task can consume five to thirty times the tokens of a lone chat completion. The unit price drops while the total climbs.
This is why the right unit of measurement is cost per completed task, not cost per token. Per-token dashboards can look flat while spend rises, because they miss the growing call count. If you track only one number after reading this guide, track cost per task. For the deeper history of how call counts exploded once models gained tool use and long context windows, those two histories are worth a read. And because a token is the atomic unit you pay for, understanding how text becomes tokens through a tokenizer is the foundation everything below rests on.
Technique 1: Prompt Caching (Cut Repeated-Prefix Input Cost)
Prompt caching bills a repeated prompt prefix at a fraction of the base input price, and it is the highest-leverage change for any app with a stable preamble. Prompt caching works because most requests share the same opening: a fixed system prompt, a style guide, tool definitions, or retrieved documents. The provider stores that prefix after the first call and replays it cheaply on every request that follows.
The savings are large and well documented. On Anthropic, cache reads cost 0.1x the base input price, a 90 percent discount, with a one-time write premium of 1.25x for the five-minute cache and 2x for the one-hour cache, per the Anthropic prompt caching docs. Google Gemini bills cached content at about 10 percent of base input plus an hourly storage fee. OpenAI applies an automatic 50 percent discount on cached input tokens for prompts over 1,024 tokens, with no code changes.
| Provider | Cache read cost | Write or storage cost | Auto or manual |
|---|---|---|---|
| Anthropic | 0.1x base input | 1.25x (5-min), 2x (1-hr) write | Manual (cache breakpoint) |
| OpenAI | 0.5x base input | None | Automatic (over 1,024 tokens) |
| Google Gemini | ~0.1x base input | Hourly storage fee | Explicit or implicit |
The one rule that governs all three is that caching is a prefix match. Any byte change early in the prompt invalidates everything after it. Put stable content first and volatile content, such as timestamps, per-request IDs, and the user's actual question, at the very end.
A silent cache miss is the most common failure. If you interpolate the current date into your system prompt, or serialize a dictionary without sorting keys, the prefix bytes differ on every request and nothing caches. Check the cache_read_input_tokens field in the response: if it stays zero across identical-prefix calls, a non-determinism problem is invalidating your prefix. Designing prompts so the stable part stays frozen is the core discipline of context engineering.
Technique 2: Model Routing (Send Easy Tasks to Cheap Models)
Model routing sends each task to the cheapest model that can meet the quality bar, and it works because most production traffic is simple. A small, fast model can be roughly 5 to 30 times cheaper per token than a top-tier model. When the bulk of your requests are short classifications, summaries, and FAQ answers, running them on a frontier model means paying premium rates for work a small model handles perfectly.
The routing logic is straightforward: score each task's complexity, then dispatch. Simple tasks go to the cheap tier, and only genuinely hard reasoning reaches the expensive one.
┌─────────────────────┐
incoming task ──▶│ complexity check │
└──────────┬──────────┘
│
simple ◀─────────┴─────────▶ complex
│ │
▼ ▼
┌──────────────────┐ ┌──────────────────┐
│ small model │ │ frontier model │
│ ~5-30x cheaper │ │ premium rate │
│ summaries, FAQs │ │ hard reasoning │
└──────────────────┘ └──────────────────┘
Because the cheap tier handles the high-volume majority, routing captures most of the total saving even though the frontier model still does the hard work. The trade-off to watch is quality: route too aggressively and you push tasks to a model that cannot handle them, which triggers retries and erases the gain. Start conservative, measure per-task quality, and widen the cheap lane only where accuracy holds. Choosing the right level of reasoning effort per tier is part of the same decision, since a lower effort setting on a capable model is itself a cost lever. For an agent-specific deep dive into routing, our companion guide on AI agent cost optimization covers resource-aware routing in detail.
Technique 3: Trim the Context (Shorter Prompts, Fewer Tokens)
Trimming context cuts the input token count directly, and input is where most apps overspend. A bigger context window does not raise the price, but filling it does. Passing an entire document corpus or a full conversation history on every call multiplies input cost and can actually degrade the answer, an effect called context rot where relevant details get buried in noise.
Three habits keep context lean:
- Retrieve, do not dump. Pull only the passages relevant to the current question instead of the whole knowledge base. This is the core idea behind retrieval-augmented generation, and it cuts input tokens sharply.
- Compact old turns. In long conversations, summarize or clear earlier exchanges rather than resending them verbatim. Context compaction replaces a long history with a short summary the model can still act on.
- Drop stale tool results. Once an agent has used a tool's output, the raw result rarely needs to stay in context for the rest of the run.
Shorter context is a double win: you pay for fewer tokens and you often get a more accurate answer, because the model is not distracted by irrelevant material. If your app maintains state across sessions, pairing retrieval with a durable agent memory layer keeps the live prompt small while preserving what matters.
Technique 4: Batch Non-Urgent Work (50 Percent Off)
Batch APIs charge exactly half of standard price in exchange for delayed delivery, making them the single largest flat discount from major providers. Any work that does not need an immediate response, such as overnight reports, bulk classification, embeddings, data enrichment, and evaluation runs, belongs in a batch queue.
All three major providers offer the same headline deal.
| Provider | Batch discount | Turnaround | Applies to |
|---|---|---|---|
| Anthropic Message Batches | 50 percent | Up to 24 hours | Input and output |
| OpenAI Batch API | 50 percent | Up to 24 hours | Input and output |
| Google Gemini Batch Mode | 50 percent | Up to 24 hours | Input and output |
In practice most batches finish well inside the 24-hour window, often in one to six hours. The discount applies to both input and output tokens, and it stacks with caching, so a batched job that also reuses a cached prefix pays the batch rate on top of the cache read rate. The only rule is to keep interactive, user-facing calls on the standard synchronous endpoint, where a 24-hour SLA would be unacceptable.
Technique 5: Structured Outputs (Stop Paying for Retries)
Structured outputs constrain the model to return JSON that matches a schema you define, which nearly eliminates the malformed responses that force a retry. Every retry is a second full-price call for the same task, so cutting the failure rate cuts spend directly. This is the quietest of the five levers because the waste is invisible on a per-call dashboard, yet it compounds fast at scale.
The reliability gap is real. One 2026 analysis found that loose JSON mode fails schema validation 5 to 10 percent of the time, while strictly enforced structured outputs fail under 0.1 percent of the time, two orders of magnitude fewer retries. Fewer retries also mean less defensive parsing and validation code, so the saving shows up in both your token bill and your engineering time.
If your application feeds model output into a database, an API call, or another model, structured outputs should be the default rather than an afterthought. The non-determinism that makes free-form output risky is exactly what a schema constrains away.
A Worked Example: Cutting a $1,800 Monthly Bill by 82 Percent
Here is how the levers combine on a realistic workload. Take a support assistant handling 100,000 requests per month. Each request carries a 4,000-token stable prefix (system prompt plus retrieved docs), a 500-token variable question, and a 300-token answer. Using illustrative rates of $3 per million input tokens and $15 per million output tokens, the untouched bill is about $1,800 per month.
Now apply the levers in order:
| Step | Monthly cost | Cut vs baseline |
|---|---|---|
| Baseline (no optimization) | ~$1,800 | baseline |
| + Prompt caching on the 4,000-token prefix | ~$720 | 60 percent |
| + Route 70 percent of traffic to a 5x-cheaper model | ~$317 | 82 percent |
Caching alone does the heavy lifting. Steady traffic keeps the prefix warm, so nearly every call reads the cached 4,000 tokens at 0.1x instead of full price. The input portion of the bill collapses, taking the total from $1,800 to about $720. Routing the easy 70 percent of requests to a model roughly 5x cheaper then cuts the remaining bill by more than half again, landing near $317, an 82 percent reduction overall.
Two more levers stack on top without changing the headline number. Any share of that traffic that is not interactive, such as nightly summary jobs, can move to a batch API for another 50 percent off that slice. And switching the JSON-producing calls to structured outputs removes the 5 to 10 percent of retries that were quietly doubling some requests. The exact figures will differ for your workload, but the shape holds: cache first, route second, then trim, batch, and constrain.
How to Choose the Right Technique for Your Workload
Start with whichever lever matches your dominant cost. The order below reflects effort-to-impact for most teams: caching is nearly free to add and pays back immediately, while routing takes more measurement to get right.
- Repeated prefix? Add prompt caching. This is the default first move.
- Mixed task difficulty? Add model routing next.
- Long inputs? Trim context with retrieval and compaction.
- Non-urgent work? Move it to a batch queue.
- Parsing JSON downstream? Switch to structured outputs.
Across all of them, instrument cost per task and log the input, output, cached, and retry token counts each provider returns. Optimizing what you cannot see is guesswork, and the stateless nature of these APIs means every token you resend is a token you pay for again. Measure, change one lever, and compare.
Where Taskade Fits
If you would rather not build cost engineering yourself, Taskade handles the routing layer for you. Taskade EVE automatically routes each task across 15+ frontier models from OpenAI, Anthropic, Google, and open-weight providers, so simple tasks never pay frontier rates and you are not maintaining a router. Because Taskade bills flat plans rather than metered tokens, starting at Pro $10 per month billed annually, teams get predictable costs instead of a bill that scales with every prompt. You can wire real work end to end with automations and 100+ integrations, or browse the community gallery to see what teams have built. Compare the plans on the pricing page.
Reducing LLM costs is not about a single trick. It is about matching each task to the cheapest path that still meets the quality bar: cache the repeats, route by difficulty, trim the context, batch the non-urgent, and constrain the output. Do all five and an 80 percent cut is well within reach.
▲ ■ ●
Frequently Asked Questions
What is the fastest way to reduce LLM costs?
The fastest single win for most applications is prompt caching. If your requests share a large fixed prefix, such as a system prompt, a style guide, or retrieved documents, caching that prefix bills repeated reads at roughly 10 percent of the base input price on Anthropic and Google, and 50 percent off on OpenAI. Because most production prompts reuse the same preamble on every call, this often cuts the input portion of the bill by 60 to 90 percent with no change to output quality. After caching, the next lever is model routing.
How much can prompt caching save?
Prompt caching bills cache reads at a fraction of the base input price. Anthropic charges cache reads at 0.1x base input, a 90 percent discount, with a one-time write premium of 1.25x for the five-minute cache. Google Gemini charges cached content at about 10 percent of base input. OpenAI applies an automatic 50 percent discount on cached input tokens for prompts over 1,024 tokens. A workload with a 4,000-token fixed prefix and a 500-token variable question can cut its input cost by roughly 80 percent on the cached portion.
What is model routing and how much does it cut costs?
Model routing sends each task to the cheapest model that can meet the quality bar, instead of running every request on a frontier model. A small, fast model can be roughly 5 to 30 times cheaper per token than a top-tier model. Because most production traffic is simple, routing the easy majority to a cheap model and reserving the expensive model for the hard minority captures most of the savings. Routing 70 percent of traffic to a model 5x cheaper can cut the remaining bill by more than half.
Do prompt caching discounts work the same across OpenAI, Anthropic, and Google?
No, the mechanics differ. OpenAI caching is automatic for prompts over 1,024 tokens and gives a 50 percent discount on cached input, with no code changes. Anthropic caching is opt-in: you mark stable content with a cache breakpoint, and reads cost 0.1x base input while the first write costs 1.25x for the five-minute cache. Google Gemini offers both explicit and implicit context caching, billed at about 10 percent of base input plus a storage fee. All three are prefix-based, so any change early in the prompt invalidates everything after it.
When should I use a batch API instead of real-time calls?
Use a batch API for any work that does not need an immediate response: overnight reports, bulk classification, embeddings, data enrichment, and evaluation runs. Anthropic Message Batches, the OpenAI Batch API, and Google Gemini Batch Mode all charge 50 percent of standard price in exchange for a turnaround of up to 24 hours, though many jobs finish in one to six hours. Batching is the largest flat discount available from major providers, and it stacks with caching. Keep interactive calls on the standard synchronous endpoint.
How do structured outputs reduce cost?
Structured outputs constrain the model to return JSON that matches a schema you define, which nearly eliminates the malformed responses that force a retry. Every retry is a second full-price call, so cutting the failure rate cuts spend directly. One 2026 analysis measured JSON mode failing schema validation 5 to 10 percent of the time versus under 0.1 percent when the schema is strictly enforced. Fewer retries also mean less parsing and validation code, so the saving is both in tokens and in engineering time.
Does a bigger context window make my LLM app more expensive?
A bigger context window does not raise the price, but filling it does. You pay per input token, so stuffing the full window with history and documents on every call multiplies the input cost and can degrade answer quality, an effect known as context rot. The fix is to send only the tokens the task needs: retrieve the relevant passages instead of the whole corpus, summarize or compact old conversation turns, and drop stale tool results. Shorter, sharper context is cheaper and often more accurate.
Is it cheaper to use one big model or route between models?
For a mixed workload, routing between models is almost always cheaper. Running every request on a frontier model means paying premium rates for tasks a small model handles perfectly. Routing keeps the frontier model for genuinely hard reasoning and sends the simple majority to a cheaper tier, so you pay premium rates only when premium reasoning earns its keep. The exception is a workload where nearly every task is hard, in which case a single strong model with tight context management is simpler and about as cost-effective.
How do I measure whether a cost optimization worked?
Track cost per completed task, not cost per token. Per-token prices keep falling, but the number of calls per task keeps climbing, so the per-token view can look flat while your bill rises. Cost per task captures retries, tool calls, and multi-step loops, which is where real spend hides. Instrument each request with its input, output, cached, and retry token counts, group by task type, and compare before and after each change. Most providers return cache-hit and usage fields in the response you can log directly.
Can I combine prompt caching and batching?
Yes, and you usually should. Caching and batching optimize different axes: caching lowers the price of repeated input tokens, while batching applies a flat 50 percent discount for accepting delayed delivery. They stack, so a batched job that also reuses a cached prefix pays the batch discount on top of the cache read rate. In practice, use caching everywhere a stable prefix repeats, route by task complexity, and move any non-urgent portion of the workload into a batch queue.




