GUIDE: AI RUNNING COSTSHow to reduce LLM token usage and AI running costs
An AI bill comes down to two numbers: tokens sent and received, and the price per token of the model handling them. Ten levers change one or both, and they stack.
| Step | Change | Monthly cost |
|---|---|---|
| Baseline | 30,000 input and 800 output tokens per request | $68,000 |
| Retrieve instead of stuffing | Input falls to 9,000 tokens | $26,000 |
| Structured output | Output falls to 400 tokens | $22,000 |
| Cache the instructions | 4,500-token prefix read from cache | $13,450 |
| Route to a small model | Assumed 80% handled by Claude Haiku 5.5 | $3,246 |
| Semantic cache | Assumed 30% of questions answered from cache | $2,272 |
Ten levers cut LLM running costs: prompt caching (cached input billed at 5 to 10 per cent of the normal rate), batch processing (50 per cent off), model routing (35 to 85 per cent lower cost in published router research), context trimming, compaction, output limits, reasoning effort settings, semantic caching, distillation and, at high volume, self-hosting.
Estimate your own monthly cost with the AI cost calculatorPrices below are list prices in US dollars per million tokens (MTok) as of 6 Nov 2026, from the community-maintained LiteLLM price list. [23] Prices change often, so treat the arithmetic as a method, not a quote.
| Model | Input | Output | Cached input |
|---|---|---|---|
| Claude Opus 5.5 | $4.00 | $20.00 | $0.20 |
| Claude Sonnet 5.5 | $2.00 | $10.00 | $0.10 |
| Claude Haiku 5.5 (prompts up to 100k) | $0.10 | $0.50 | $0.01 |
| GPT-6.1 Sol | $2.00 | $10.00 | $0.10 |
| GPT-6.1 Terra | $1.00 | $5.00 | $0.05 |
| GPT-6 Luna | $0.10 | $0.50 | $0.01 |
| Gemini 3.8 Flash | $0.75 | $3.75 | $0.075 |
| Gemini 3.5 Flash-Lite | $0.30 | $2.50 | $0.03 |
| DeepSeek V4 Flash | $0.30 | $1.20 | $0.006 |
On the Claude and GPT models listed, output costs five times as much as input.
Price watch: Google’s pricing page lists Gemini 3.8 Flash prices doubling from 1 January 2027. [4] Recheck before you rely on these figures.
1. Prompt caching
What it is. When requests share a long prefix (instructions, a policy manual, tool definitions), the provider stores the processed prefix and charges far less to reuse it.
When it helps. Assistants with long, stable system prompts, and agents that resend tool definitions every turn.
What the providers say.
- Anthropic: reads cost 0.1x base input (0.05x on Opus 5.5 and Sonnet 5.5); writes cost 1.25x for the default 5-minute lifetime, refreshed free on each hit, or 2x for 1 hour. Minimum 512 tokens on current models. [1]
- OpenAI: automatic. On GPT-5.6 and later, minimum 1,024 tokens; reads 0.1x (0.05x on GPT-6.1 Sol and Terra); writes 1.25x for the default 30 minutes or 2.5x for 12 hours. [2]
- Google: implicit caching on by default, minimum 4,096 tokens on Gemini 3.8 Flash; cached input 10 per cent of base, plus hourly storage for explicit caches. [3][4]
| Provider | Minimum prefix | Lifetime | Cached read |
|---|---|---|---|
| Anthropic | 512 tokens | 5 min (refreshed on each hit) or 1 h | 0.1x base, 0.05x on Opus 5.5 and Sonnet 5.5 |
| OpenAI (GPT-5.6 and later) | 1,024 tokens | 30 min or 12 h | 0.1x base, 0.05x on GPT-6.1 Sol and Terra |
| Google (Gemini 3.8 Flash) | 4,096 tokens | Implicit by default; explicit caches add hourly storage | 10% of base |
| Request | Minute | Cache |
|---|---|---|
| 1 | 0.5 | write |
| 2 | 1.7 | hit |
| 3 | 3.4 | hit |
| 4 | 6.8 | hit |
| 5 | 7.7 | hit |
| 6 | 13.2 | write |
| 7 | 14.6 | hit |
| 8 | 16.7 | hit |
| 9 | 17.5 | hit |
| 10 | 22.2 | hit |
| 11 | 23.8 | hit |
| 12 | 26.7 | hit |
| 13 | 27.9 | hit |
Pitfalls. Caching matches an exact prefix, so a timestamp at the top of the prompt breaks every hit. Put stable content first. Sparse traffic pays the write premium without the reads.
2. Batch and flex processing
What it is. Submit work that can wait asynchronously, at a lower price.
When it helps. Overnight classification, evaluation runs, data enrichment.
What the providers say. Anthropic’s Message Batches API is 50 per cent off all usage, with most batches finishing in under an hour and a 24-hour limit; it stacks with prompt caching, although cache hits in batches are best effort. [5] OpenAI’s Batch API is 50 per cent off with a 24-hour window and up to 50,000 requests per batch, [6] and its Flex tier is priced at batch rates in exchange for slower responses and occasional unavailability. [7] Google’s Batch API runs at 50 per cent of standard cost with a 24-hour target. [8]
Pitfalls. Batches can take the full 24 hours, so never batch work a customer is waiting on.
3. Model routing and cascades
What it is. Send each request to the cheapest capable model. A router decides up front; a cascade tries a small model first and escalates when a check fails.
When it helps. Mixed workloads that are mostly routine.
What the research and providers say. The RouteLLM paper (ICLR 2025) reported cost reductions of over 85 per cent on MT Bench, 45 per cent on MMLU and 35 per cent on GSM8K against using GPT-4 alone, while reaching 95 per cent of GPT-4’s performance. [9] FrugalGPT reported up to 98 per cent cost reduction while matching the best single model on its benchmarks, a best case rather than a typical one. [10] Anthropic’s own guidance is more cautious: “Tune one model before you add a second,” and its measured multi-model results ranged from about a third cheaper at similar quality to cheaper but measurably worse. [11]
Above 97.5% escalation the cascade costs more than sending everything to Claude Opus 5.5, because escalated requests also pay for Claude Haiku 5.5.
| Escalation rate | Cascade cost | All on Claude Opus 5.5 |
|---|---|---|
| 0% | $300 | $12,000 |
| 20% | $2,700 | $12,000 |
| 50% | $6,300 | $12,000 |
| 100% | $12,300 | $12,000 |
Pitfalls. A cascade pays twice for escalated requests, and weak checks let poor answers through. Measure quality on routed traffic.
4. Evaluation-driven model selection
What it is. Choose the model for each task by testing candidates on your own data, then pick the cheapest one that passes.
When it helps. Always, first. Anthropic’s model guide says “Having a good evaluation set is the most important step in the process” and suggests starting with a fast, low-cost model and upgrading “only if necessary”. [12]
40x spread for the same token count
- Claude Opus 5.5$9,000
- Claude Sonnet 5.5$4,500
- GPT-6.1 Sol$4,500
- GPT-6.1 Terra$2,250
- Gemini 3.8 Flash$1,688
- Gemini 3.5 Flash-Lite$925
- DeepSeek V4 Flash$600
- Claude Haiku 5.5$225
- GPT-6 Luna$225
| Model | Cost per 1M requests |
|---|---|
| Claude Opus 5.5 | $9,000 |
| Claude Sonnet 5.5 | $4,500 |
| GPT-6.1 Sol | $4,500 |
| GPT-6.1 Terra | $2,250 |
| Gemini 3.8 Flash | $1,688 |
| Gemini 3.5 Flash-Lite | $925 |
| DeepSeek V4 Flash | $600 |
| Claude Haiku 5.5 | $225 |
| GPT-6 Luna | $225 |
Pitfalls. Public benchmarks rarely reflect your edge cases. Re-run evals when a provider ships a new model version.
5. Trim context and retrieve instead of stuffing
What it is. Send only the passages a question needs, found through retrieval (RAG), instead of pasting whole documents into every prompt.
When it helps. Question answering over large document sets, policy assistants, agents with long tool outputs.
What the sources say. Anthropic’s engineering team calls context “a finite resource with diminishing marginal returns” and recommends “the smallest set of high-signal tokens”. [13] Research also found models use information in the middle of long inputs less reliably than at the start or end. [14]
Pitfalls. Retrieval that misses the right passage yields a confident wrong answer, so evaluate retrieval separately.
6. Summarise and compact long conversations
What it is. Replace older turns of a long session with a summary, so each request carries less history.
When it helps. Long chats and agents, where input grows every turn.
What the providers say. Anthropic’s compaction feature “replaces the older turns of a conversation with a summary that Claude writes on the server”, and its context editing can clear old tool results by rule. [15]
| Turn | No compaction | Compacted |
|---|---|---|
| 5 | 10000 | 10000 |
| 10 | 20000 | 20000 |
| 15 | 30000 | 13000 |
| 20 | 40000 | 23000 |
| 25 | 50000 | 13000 |
| 30 | 60000 | 23000 |
| 35 | 70000 | 13000 |
| 40 | 80000 | 23000 |
Pitfalls. Summaries can drop detail a later turn needs. Compaction also changes the prefix and resets prompt caching, so with heavy caching the saving is smaller.
7. Cap output length and use structured outputs
What it is. Ask for exactly what you need, in a defined format, with a sensible maximum length.
When it helps. Extraction, classification, form filling and any output a program reads.
What the providers say. OpenAI’s Structured Outputs ensures responses “adhere to your supplied JSON Schema”, so there is “no need to validate or retry incorrectly formatted responses”. [16] Fewer retries mean fewer paid calls.
Pitfalls. A limit set too low truncates answers, and on reasoning models it must leave room for reasoning tokens.
8. Tune reasoning effort
What it is. Reasoning models can think more or less before answering. Hidden reasoning tokens are billed as output.
When it helps. Routine, high-volume or latency-sensitive tasks that do not need deep reasoning.
What the providers say. OpenAI: reasoning tokens are “billed as” output tokens, and “Lower effort favors speed and lower token usage.” [17] Anthropic: low effort gives “Significant token savings with some capability reduction”, and “Tuning effort is often a better lever than switching models.” Defaults differ: Claude Opus 5.5 and Haiku 5.5 default to medium, most others to high. [18][12] Neither provider publishes a fixed percentage.
Pitfalls. Effort levels are recalibrated between model versions; re-test when you upgrade.
9. Deduplicate and use semantic caching
What it is. Return a stored answer when a new question matches an old one exactly (deduplication) or in meaning (semantic caching), skipping the model call.
When it helps. FAQ-style traffic, internal help desks, repeated lookups.
What the research says. One 2024 preprint reported up to 68.8 per cent fewer API calls, with hit rates of 61.6 to 68.8 per cent on customer-service-style queries, a single study on one workload. [19] Open-model servers such as vLLM offer a related feature, automatic prefix caching. [20]
Pitfalls. A loose similarity threshold returns the right answer to the wrong question. Do not cache answers that depend on the user, the date or live data.
10. Fine-tune or distil to a smaller model
What it is. Use a large model’s best outputs to train a smaller model for one specific task.
When it helps. A stable, high-volume task where a small model nearly passes your evals.
What the providers say. OpenAI describes distilling “the results of a large model to create training data for supervised fine tuning”, so that a small model performs “similarly on a specific task to a larger, more costly model”. [21]
Pitfalls. Distilled models generalise poorly beyond their training data; retrain when the task changes, and check provider terms on training with outputs.
Hosted or self-hosted: where the break-even sits
Self-hosting open models swaps per-token prices for a mostly fixed monthly cost. It pays when that cost is lower than the API spend it replaces at equal quality.
- Monthly self-hosted cost:
C = (GPUs x price per GPU-hour x 730) + O, where O covers engineering, monitoring, power and, for owned hardware, amortised purchase cost. - Blended API price:
P = (input share x input price) + (output share x output price). - Break-even monthly tokens:
T = C / P. - Capacity check: the hardware must sustain
T / (2,628,000 x U)tokens per second, where 2,628,000 is the seconds in a 730-hour month and U is average utilisation.
Lambda lists these GPU prices as taking effect 16 November 2026. [22] Recheck before you rely on them.
Blended price P = (0.75 x input price) + (0.25 x output price), a 3:1 input-to-output mix.
| Replacing | Blended price per MTok | Break-even tokens a month |
|---|---|---|
| Claude Sonnet 5.5 | $4.00 | 6.7 billion |
| DeepSeek V4 Flash (hosted) | $0.525 | 51.1 billion |
| Claude Haiku 5.5 | $0.20 | 134 billion |
What this means. On cost alone, self-hosting competes best against frontier-priced APIs at sustained volume, where an open model passes the same evals. Against the cheapest hosted tiers, break-even volume is very high. The stronger case is often not price: data that cannot leave your network, regulation, offline sites and predictable latency.
How we approach it at Quantana
Ramesh Emandi, Quantana’s Co-Founder and CTO, describes this practice:
- Open models offline for most use cases. Most of Quantana’s use cases run offline on open models, on Quantana’s own Nvidia-powered pods or on client infrastructure, including through SecGPT Vault, our private on-premises AI.
- Hosted frontier models where they are needed. Claude, OpenAI and Gemini models are used for very advanced research that needs live internet data.
- Assessment per use case. Each model is assessed for each use case on the effort it takes to integrate, test, train and handle edge cases, not on headline benchmarks.
- Low latency and extensive quality evals. Latency is kept low, and quality is checked through extensive evaluations before and after changes.
- Self-auditing systems. Quantana runs self-auditing systems that recommend improvements, so cost and quality are reviewed continuously rather than once.
Sources
All accessed 6 November 2026. Model prices are from the LiteLLM snapshot [23]; confirm on each provider’s own pricing page.
- Anthropic, “Prompt caching”, Claude Platform docs
- OpenAI, “Prompt caching”, API docs
- Google, “Context caching”, Gemini API docs
- Google, “Gemini API pricing”
- Anthropic, “Batch processing”, Claude Platform docs
- OpenAI, “Batch API”, API docs
- OpenAI, “Flex processing”, API docs
- Google, “Batch API”, Gemini API docs
- Ong et al., “RouteLLM: Learning to Route LLMs from Preference Data”, ICLR 2025
- Chen, Zaharia and Zou, “FrugalGPT: How to Use Large Language Models While Reducing Cost and Improving Performance”, 2023
- Anthropic, “Optimizing for cost and intelligence”, Claude Platform docs
- Anthropic, “Choosing the right model”, Claude Platform docs
- Anthropic Engineering, “Effective context engineering for AI agents”, 29 Sep 2025
- Liu et al., “Lost in the Middle: How Language Models Use Long Contexts”, TACL 2024
- Anthropic, “Compaction overview”, Claude Platform docs
- OpenAI, “Structured Outputs”, API docs
- OpenAI, “Reasoning models”, API docs
- Anthropic, “Effort”, Claude Platform docs
- Regmi and Pun, “GPT Semantic Cache: Reducing LLM Costs and Latency via Semantic Embedding Caching”, 2024 preprint
- vLLM, “Automatic Prefix Caching”, vLLM docs
- OpenAI, “Model distillation”, API docs
- Lambda, “Pricing” (on-demand GPU instances) Listed prices effective 16 Nov 2026.
- BerriAI, LiteLLM “model_prices_and_context_window.json” (MIT licence, community maintained), snapshot of 6 Nov 2026
Reducing AI costs, answered.
What is the fastest way to reduce LLM costs?
Usually prompt caching and batch processing, because neither changes your prompts or models. Caching cuts the cost of a repeated prefix to 5 to 10 per cent of the normal input price on current Claude, OpenAI and Gemini models. Batch APIs from all three providers charge 50 per cent of standard prices for work that can wait up to 24 hours.
Does using a cheaper model make answers worse?
Sometimes, which is why you test first. Build an evaluation set from real requests, including difficult edge cases, and run candidate models against it. Pick the cheapest model that passes. Published routing research shows large savings with small quality loss, but Anthropic’s own measurements include cases where cheaper combinations scored lower. Your evals decide.
Why are output tokens more expensive than input tokens?
Generating text happens one token at a time, while input is processed in parallel, so providers price output higher. On the Claude and GPT models in this guide, output costs five times as much as input. That makes concise, structured answers and sensible reasoning effort settings worth more than trimming a few input tokens.
How does prompt caching differ from semantic caching?
Prompt caching is a provider feature: it reuses processing of an identical prompt prefix, and the model still writes a fresh answer. Semantic caching is something you build: it stores whole answers and returns one when a new question means the same as an old one, skipping the model call. Semantic caching saves more per hit but carries more risk of a mismatched answer.
When does self-hosting an open model make financial sense?
When sustained volume is high enough that a fixed GPU cost beats per-token pricing for a hosted model of equal quality on your evals. Use the break-even formula in this guide with your own GPU price, utilisation, operating costs and measured throughput. Data residency, privacy and offline needs often matter as much as price.
How much can these levers save in total?
It depends on the workload, so we avoid a single figure. The illustrative waterfall in this guide takes a hypothetical 1 million requests a month from $68,000 to about $2,270 by stacking five levers, but every split and hit rate in it is an assumption. Measure your baseline, then apply levers one at a time.
Do these techniques work with on-premises AI?
Most do. Context trimming, output limits, compaction, routing, semantic caching and distillation work the same way. Batch discounts do not apply, but batching still raises GPU utilisation. Open-model servers such as vLLM provide automatic prefix caching, which reuses computation for shared prompt prefixes.
How often should we review AI costs?
Whenever a provider changes prices or ships a new model, and on a regular schedule in between. Prices in this guide are from 6 Nov 2026, and at least one provider has announced increases from January 2027. Effort settings and model defaults also change between versions, so re-run your evals each time.
Talk to us about reducing your AI costs
If your AI bill is growing faster than its value, talk to Quantana. We can review where your tokens go, which levers fit your workloads, and whether hosted, self-hosted or a mix suits your data. Try our AI cost calculator for a first estimate, then get in touch.