November 2, 202610 min read

LLM Cost Optimization Techniques, Priced: Caching, Batch, Routing and More

LLM cost optimization priced with vendor rates: prompt caching, Batch API, model routing, output caps, reasoning tokens, long-context and off-peak pricing.

Most advice on cutting an LLM bill stops at “use a smaller model” and “cache your prompts.” Both are right, and both are worth very different amounts depending on the provider, the model and the shape of your traffic. This post prices eight techniques with the vendors’ own published rates, four of them on one workload, so you can see what each is worth before you spend engineering time on it.

Every rate here comes from the provider’s own pricing page — Anthropic, OpenAI, Google and DeepSeek — as checked on November 2, 2026. Prices in this market change monthly; the LLM pricing explorer linked below tracks them.

Measure first: you can’t optimize what you can’t attribute

A technique is only worth applying where the spend is. Before changing prompts, split the bill by the boundary the provider records — OpenAI project, Anthropic workspace, or the account, subscription and tags on cloud-billed models — then by model and by token type. Token type matters most: a workload dominated by output tokens gains little from caching, and one dominated by a repeated system prompt gains little from shorter answers.

Then track effective $ per 1M tokens per model: token-metered cost divided by tokens. It tells you whether caching and batching are working, because it moves when they do and the list price does not.

The workload, and what each technique saves

The examples use one hypothetical workload: a support assistant on Claude Sonnet 5.5 serving 1 million requests a month. Each request sends 10,000 input tokens — a 9,000-token system prompt and knowledge-base context that is identical on every call, plus 1,000 tokens of conversation — and receives 500 output tokens. At list price ($2 per 1M input tokens, $10 per 1M output tokens) that is $20,000 of input and $5,000 of output: $25,000 a month.

One workload, five changes — monthly cost at Anthropic list prices as of 2026-11-02
ChangeAssumptionMonthly costvs. baseline
BaselineClaude Sonnet 5.5, no caching, synchronous$25,000—
Prompt caching9,000-token prefix read from cache on 99% of calls, written to the 5-minute cache on 1%$8,116−67.5%
Batch APIWhole workload sent through Message Batches at 50% off input and output$12,500−50.0%
Model routing70% of calls moved to Claude Haiku 5.5; 30% stay on Sonnet 5.5$8,375−66.5%
Output capAverage output cut from 500 to 300 tokens$23,000−8.0%
Routing + cachingThe routing split, with the same caching on both models$2,750−89.0%

The caching row, worked: 10,000 cache writes of 9,000 tokens at $2.50 per 1M is $225; 990,000 cache reads of 9,000 tokens at $0.10 per 1M is $891; the 1,000 uncached tokens on every call cost $2,000; output stays at $5,000. Total $8,116.

1. Prompt caching: check the read multiplier for your model

Caching bills a repeated prompt prefix at a fraction of the input price, and the fraction is not uniform. On Anthropic, a cache read costs 0.1× base input on most models, 0.05× on Claude Opus 5.5 and Claude Sonnet 5.5, and 0.025× on Claude Fable 5.1; a write costs 1.25× for the 5-minute cache or 2× for the 1-hour cache. At the standard 0.1× read rate, Anthropic’s own break-even is one read for a 5-minute write and two reads for a 1-hour write. Caching is opt-in on the Claude API, through a cache_control field.

OpenAI caches automatically on supported models. For GPT-5.6 and later, the minimum cacheable prompt is 1,024 tokens, writes cost 1.25× input for the default 30-minute lifetime or 2.5× for the 12-hour lifetime in the Responses API, and reads cost 0.1× on most models and 0.05× on GPT-6.1 Sol and GPT-6.1 Terra. Google’s Gemini API prices cached tokens per token, and explicit context caches add a storage charge per 1M tokens per hour — $4.50 on Gemini 3.1 Pro Preview — so an idle cache has a running cost; Gemini 4 Argon and later support implicit caching only.

The structural rule is the same everywhere: a cache only matches an identical prefix. Put stable material — system prompt, tool definitions, reference documents — first, and per-request material last. A timestamp at the top of the system prompt turns every request into a cache miss.

2. Batch API: 50% off anything that can wait

OpenAI, Anthropic and Google all price batch requests at 50% of standard on input and output. The trade is latency: OpenAI’s batch completion window is 24 hours, and Anthropic says most batches finish within an hour and expire if not done in 24. Evaluations, backfills, nightly summarization, classification and enrichment jobs rarely need an answer in seconds. OpenAI and Google also list Flex tiers priced at their batch rates for the models checked here.

Discounts stack. Anthropic states that its caching multipliers apply on top of the Batch discount, but cache hits inside a batch are best-effort — it reports typical hit rates of 30% to 98% — and it recommends the 1-hour cache for batches with shared context.

3. Model routing: the largest single lever

Price gaps between model tiers are larger than any discount. Claude Haiku 5.5 lists at $0.10 input and $0.50 output per 1M tokens against Sonnet 5.5’s $2 and $10, a 20× difference. Moving 70% of the example traffic to Haiku cuts the bill by two-thirds before any other change, provided the routed requests still pass your quality bar. Anthropic’s model-selection guide maps Haiku 5.5 to the lowest latency and price, Sonnet 5.5 to everyday coding, agent and enterprise workloads, Opus 5.5 to complex agentic and enterprise work, and Fable 5.1 to the highest available capability.

Routing needs an evaluation set, not a guess. Score a sample of real requests on both models, route the request classes where the cheaper model passes, and keep measuring. The FinOps Foundation’s “cost per successful outcome” is the right denominator, because a cheap answer that has to be retried on the expensive model costs more than sending it there first.

4. Output length: the expensive side of the meter

Output tokens list at five times input on Claude Sonnet 5.5, Haiku 5.5 and Opus 5.5 and on GPT-6.1 Sol. Asking for structured output instead of prose, removing “explain your reasoning” from prompts that do not need it, and setting max_tokens to a real ceiling all shrink the expensive side. In the example, trimming 200 output tokens per request saves $2,000 a month — modest because that workload is input-heavy, decisive in one that generates long documents.

5. Reasoning tokens are billed as output

Reasoning models think before they answer, and the thinking is billed. OpenAI documents that reasoning tokens are not visible through the API but are billed as output tokens, and exposes reasoning.effort with model-dependent values from none to max. Anthropic’s current models use adaptive thinking steered by an effort setting and report billed thinking tokens in usage.output_tokens_details.thinking_tokens. Google’s Gemini output prices include thinking tokens.

The effect is easy to underestimate. Suppose a request on GPT-6.1 Sol ($10 per 1M output tokens) produces 500 visible tokens and 3,000 reasoning tokens: 1 million such requests cost $35,000 in output, not $5,000. Lowering effort so reasoning falls to 1,000 tokens brings that to $15,000. Set effort per route, cap total output with max_output_tokens or max_tokens, and log reasoning tokens separately so they show up in per-model numbers.

6. Long-context premiums: thresholds reprice the request

Some models charge more once a prompt crosses a length threshold, and the higher rate applies to the whole request. Claude Haiku 5.5 moves from $0.10 / $0.50 to $0.50 / $2.50 per 1M tokens when a prompt exceeds 100,000 tokens, and Anthropic counts cache reads and writes toward that length. A 120,000-token prompt with a 1,000-token answer costs $0.0625; trimmed to 95,000 tokens it costs $0.0100 — about 21% fewer prompt tokens, 84% less money.

OpenAI prices requests above 272K input tokens at its long-context rates: $4.00 input and $15.00 output per 1M on GPT-6.1 Sol, against $2.00 and $10.00. Gemini 3.1 Pro Preview steps from $2.00 / $12.00 to $4.00 / $18.00 above 200K tokens. Anthropic’s other current models, by contrast, bill the full 1M-token window at standard rates. Retrieval that sends the relevant 20 pages instead of the whole manual is cheaper on every model, and decisively so near a threshold.

7. Off-peak pricing: DeepSeek halves its rates outside peak hours

DeepSeek prices by time of day. Peak hours are 01:00–04:00 and 06:00–10:00 UTC, Monday through Friday, excluding Chinese public holidays; every other hour is off-peak, at half the peak rate. For deepseek-v4-pro that is $0.66 versus $1.32 per 1M cache-miss input tokens and $1.98 versus $3.96 per 1M output tokens. A job of 1 billion input and 100 million output tokens costs $1,716 at peak and $858 off-peak — a batch-sized discount, earned by scheduling.

8. Tokenizers: compare cost per task, not price per token

A token is not a fixed unit of text. Anthropic states that Claude 4.7 and later models use a newer tokenizer that produces approximately 30% more tokens for the same text than Claude Sonnet 4.6 and earlier, with the exact increase depending on content. Sonnet 5.5 lists at $2 / $10 against Sonnet 4.6’s $3 / $15 — a third cheaper per token — but at 30% more tokens the same text costs the equivalent of $2.60 / $13: roughly 13% cheaper, not 33%.

The same applies across providers. Before switching models on a per-token comparison, count tokens for a sample of your real prompts on each candidate model and compare cost per completed task.

Premiums to leave off by default

Two options raise the price on purpose. Fast modes trade money for speed: Claude Opus 5.5 fast mode lists at $8 / $40 per 1M tokens against $4 / $20 standard, and OpenAI’s Fast mode for GPT-6.1 Sol at $4.00 / $20.00 against $2.00 / $10.00. Data-residency routing adds a location premium: Anthropic applies a 1.1× multiplier to all token prices when inference_geo is set to us on Claude 4.6 and later models, and OpenAI charges a 10% uplift on regional processing endpoints for models released on or after March 5, 2026. Both are right when a requirement demands them, and expensive defaults when nobody asked.

Rates used in this post, USD per 1M tokens, from each vendor’s pricing page as of 2026-11-02 (— = not listed)
ModelInputCache readOutputBatch inputBatch output
Claude Sonnet 5.5$2.00$0.10$10.00$1.00$5.00
Claude Haiku 5.5 (prompts ≤100K)$0.10$0.01$0.50$0.05$0.25
Claude Haiku 5.5 (prompts >100K)$0.50$0.05$2.50$0.25$1.25
Claude Opus 5.5$4.00$0.20$20.00$2.00$10.00
GPT-6.1 Sol (≤272K input)$2.00$0.10$10.00$1.00$5.00
GPT-6.1 Sol (>272K input)$4.00$0.20$15.00$2.00$7.50
Gemini 3.1 Pro Preview (≤200K)$2.00$0.20$12.00$1.00$6.00
DeepSeek V4 Pro (off-peak)$0.66$0.022$1.98——

How do I reduce OpenAI API costs?

Split spend by project and model first, so you know where it is. Then, roughly in order of payoff: route simple requests to a smaller model (GPT-6 Luna lists at $0.10 / $0.50 per 1M tokens against GPT-6.1 Sol’s $2.00 / $10.00); send anything that can wait through the Batch API at 50% off; keep stable prompt prefixes first so automatic caching bills them at 0.05× to 0.1× input; lower reasoning effort where quality allows; and keep prompts at or under 272K input tokens to avoid long-context rates. Rates as of November 2, 2026.

How can I reduce Claude API costs?

Cache the repeated part of your prompt with cache_control — reads cost 0.05× input on Sonnet 5.5 and Opus 5.5 and 0.1× on most other models. Route simple tasks to Claude Haiku 5.5 and keep its prompts at or under 100,000 tokens, above which its price steps up 5×. Use Message Batches for asynchronous work at 50% off, steer thinking with the effort setting, and leave fast mode and US-only inference off unless you need them. Rates as of November 2, 2026.

Does prompt caching actually reduce LLM costs?

Yes, when a large part of each prompt repeats and requests arrive often enough to keep the cache warm. In the example above, caching a 9,000-token prefix on Claude Sonnet 5.5 cut a $25,000 month to $8,116. It does little for output-heavy workloads, for prompts that change near the start, or for traffic too sparse to hit the cache before it expires.

Is the Batch API worth it?

For any workload that can wait hours instead of seconds, yes: OpenAI, Anthropic and Google all price batch requests at 50% of standard. OpenAI’s completion window is 24 hours; Anthropic reports most batches complete within an hour. The cost is pipeline work — submitting requests as a batch and collecting results asynchronously — not a quality trade-off, because the model is the same.

What is the most effective LLM cost optimization technique?

Model choice, by a wide margin, wherever a cheaper model passes your quality bar: price gaps between tiers run to 20×, while batch discounts are 50% and caching discounts apply only to repeated input. Caching is usually the second lever for input-heavy workloads, output and reasoning control for output-heavy ones. Measure first — the right order depends on which token type dominates your bill.

Measure before you optimize. CloudQuell reads OpenAI and Anthropic billing data by project, workspace, model and token type — cached input included — next to your cloud bill, so you can see which lever is worth pulling. Free under $10K/month of tracked spend.

Try CloudQuell →
← Back to all posts