How to Reduce LLM API Costs: Caching, Batching and Routing

Colour photograph illustrating the Eoxys blog post 'How to Reduce LLM API Costs: Caching, Batching and Routing', used as the featured image for reduce llm api costs.

How to reduce LLM API costs with caching, batching and model routing

AI features that looked cheap in a demo can grow into a real monthly bill once users arrive. The good news is that you can usually reduce LLM API costs without hurting quality, because most bills are driven by a few patterns: the same long prompt sent again and again, work that did not need an instant answer, and big models doing small jobs.

This guide covers the four levers that matter most, with worked examples based on OpenAI’s and Anthropic’s published prices. Checked on 5 November 2026.

Key takeaways

  • Measure cost per user action before optimising; you cannot cut what you do not track.
  • OpenAI lists cached input for gpt-6.1-terra at $0.05 per million tokens against $1.00 for normal input.
  • OpenAI’s Batch tier is half the Standard price for gpt-6.1-terra: $0.50 input and $2.50 output per million tokens.
  • Anthropic charges cache reads at 0.1x the base input price on most models and 0.05x on Opus 5.5 and Sonnet 5.5, with cache writes at 1.25x for a 5-minute lifetime.
  • Routing easy requests to a smaller model is often the biggest single saving.

In this guide

Measure first

Log input tokens, output tokens, cached tokens, model and feature for every call. Then compute cost per user action, such as per answer or per document. Our AI agent observability guide covers the tooling. Look for the top three features by spend; they are usually most of the bill.

Four levers to reduce LLM API costs: cache, batch, route, trim
Start with the lever that matches your traffic pattern.

Prompt caching

If many requests start with the same long text, such as a system prompt, tool definitions or a policy document, providers can reuse that prefix at a lower price.

ProviderHow it worksPublished pricing
OpenAIRepeated input billed at a lower cached-input rategpt-6.1-terra: $1.00 input, $0.05 cached input per 1M tokens
AnthropicOpt in with cache_control, automatic or explicit breakpoints; 5-minute default lifetime, 1-hour optionCache reads 0.1x base input (0.05x on Opus 5.5 and Sonnet 5.5); writes 1.25x (5 min) or 2x (1 hour)
Sources: OpenAI pricing and Anthropic prompt caching docs, checked 5 Nov 2026.

To get cache hits, keep the stable part of the prompt first and identical across calls, and put the changing part (the user’s message, timestamps, retrieved text) after it. Anthropic notes that prompts below a minimum length, 512 tokens on its newer models, are not cached at all.

Example (our arithmetic)Without cacheWith cache reads
10,000-token system prompt, 100,000 calls, gpt-6.1-terra input only1B tokens × $1.00 = about $1,0001B tokens × $0.05 = about $50, plus write costs
Illustrative; real hit rates depend on traffic timing and prompt structure.

Is your AI bill growing faster than your users? Eoxys audits token usage and rebuilds prompts, caching and routing. Get a real project estimate within 24 hours. NDA on request.

Batch and flex pricing

Work that can wait, such as overnight document tagging, bulk summaries or evaluation runs, can use cheaper tiers. On OpenAI’s pricing page, Batch prices for gpt-6.1-terra are $0.50 input and $2.50 output per million tokens, half the Standard $1.00 and $5.00. A Flex tier is listed at the same rates.

WorkloadNeeds instant answer?Suggested tier
Customer chatYesStandard, with caching
Nightly report generationNoBatch
Re-running an evaluation setNoBatch
Back-office classificationUsually noBatch or Flex
Check each provider’s current tiers and limits before switching.

Model routing

Not every request needs your largest model. A router sends easy requests to a small model and escalates only hard ones. On OpenAI’s list prices, gpt-6-luna input is $0.10 per million tokens against $1.00 for gpt-6.1-terra, a tenfold difference.

  • Classify the request first, with rules or a small model.
  • Send FAQs, extraction and formatting to the small model.
  • Escalate long reasoning, sensitive cases or low-confidence answers.
  • Score both paths on the same test set so savings do not cost accuracy.

Trim prompts and outputs

WasteFix
Whole documents pasted into every callRetrieve only relevant passages; see RAG vs fine-tuning
Long chat history resent each turnSummarise older turns
Verbose answersSet output length and format limits
Retries after malformed outputUse structured outputs and validation
Unused tool definitionsSend only tools the step needs
Output tokens usually cost several times more than input tokens, so shorter answers save the most per token.

A cost-cutting plan

  • Week 1: add token and cost logging per feature.
  • Week 2: restructure the top feature’s prompt for caching.
  • Week 3: move non-urgent jobs to Batch.
  • Week 4: add routing for the highest-volume request type and compare quality.
  • Re-check monthly. For budgets on new builds see AI MVP development cost and AI agent cost.

FAQ

What is the fastest way to reduce LLM API costs?

Measure cost per feature, then fix the biggest one. Prompt caching is often quickest when a long system prompt or document is reused; routing simple requests to a smaller model usually saves the most overall. Moving non-urgent work to a batch tier is another quick win.

How does prompt caching save money?

When requests share the same opening text, the provider stores that prefix and bills reuse at a lower cached-input rate. OpenAI lists gpt-6.1-terra cached input at $0.05 per million tokens against $1.00 normal. Anthropic bills cache reads at 0.1x base input on most models.

Does caching change the model’s answers?

No. Anthropic’s documentation states that prompt caching has no effect on output token generation; the response is identical to an uncached call. It only changes cost and speed for the repeated part of the prompt. Cache hits need exactly identical prefixes.

When should I use batch processing?

Use it for work that does not need an instant answer: nightly reports, bulk tagging, data clean-up and evaluation runs. OpenAI’s Batch tier for gpt-6.1-terra costs half the Standard price. Keep live user chats on the standard tier.

Will a smaller model hurt quality?

Sometimes, which is why routing should be tested. Build a test set of real requests, score small and large models on it, and only route the request types where the small model performs well enough. Escalate anything uncertain to the larger model.

Can Eoxys reduce our AI API bill?

Yes. We audit token usage, restructure prompts for caching, add batch jobs and routing, and set up cost dashboards. See our AI development services. Get a real project estimate within 24 hours.

Work with Eoxys

Eoxys IT Solution LLP has built websites, apps and AI products since 2009, with 700+ projects delivered. See the work on our portfolio, or explore our AI and machine learning solutions.

Eoxys builds and tunes AI products, agents and chatbots so they stay fast, accurate and affordable. Get a real project estimate within 24 hours. NDA on request. Prefer to talk? Call +91 96678 22661.

Related reading:

Sources

Checked on 5 Nov 2026 against OpenAI’s API pricing page and Anthropic’s prompt caching documentation.

Shafeeq Khan

Author

Shafeeq Khan is a web developer who creates modern, responsive, and user-friendly websites with clean code and creative design

Latest Posts

Fitness app development cost in the UK 2026: Eoxys banner with a phone showing workout stats during a boxing session

Fitness App Development Cost in the UK (2026)

A fitness app in the UK lives or dies on two quiet moments: the first week, when a new member…

Shafeeq Khan
November 24, 2026
Real Estate App Development Cost in the UAE (2026) banner: agent handing house keys to a client

Real Estate App Development Cost in the UAE (2026)

A property listing in the UAE is only useful if it is legal to show, still available and answered fast….

Shafeeq Khan
November 23, 2026
Colour photograph illustrating the Eoxys blog post 'Bing AI Performance Report: How to Use It for AEO', used as the featured image for bing ai performance report.

Bing AI Performance Report: How to Use It for AEO

Most AI search tracking is guesswork: you ask a chatbot questions and note who it mentions. The Bing AI Performance…

Shafeeq Khan
November 23, 2026

Leave a Reply

Your email address will not be published. Required fields are marked *