How to cut LLM API costs: caching, batching and model routing

To cut LLM API costs, use the smallest model that meets your quality bar, route simple tasks to cheap models and only hard ones to expensive models, cache repeated context with prompt caching, send non-urgent work through batch APIs at about half price, keep prompts and outputs short, and track cost per task. On Claude, for example, Haiku 5.5 costs $0.50 per million output tokens against $20 for Opus 5.5, and cache reads cost a fraction of normal input.

Why do LLM costs grow so fast?

API pricing is per token: you pay for every word you send and every word the model writes back. Costs climb when teams use the most capable model for every request, resend long system prompts or documents each time, ask for long answers and run agents that call the model many times per task. The fixes are mostly design choices, not discounts. Our Claude API guide explains how tokens and pricing work.

What are the main cost levers?

  • Model choice: Use the smallest model that passes your quality test.
  • Routing: Send easy tasks to cheap models and escalate hard ones.
  • Prompt caching: Cache long, repeated context such as instructions and documents.
  • Batch processing: Run non-urgent jobs through batch APIs at about half price.
  • Shorter prompts: Remove unused instructions and send only relevant context.
  • Shorter outputs: Ask for concise formats and set output limits.

How does model routing work?

In many applications most requests are simple, so routing alone can cut costs substantially. Our AI model decision framework shows how to test which tier each task needs.

How much does prompt caching save?

Prompt caching stores a long, repeated part of a prompt, such as instructions, a style guide or a large document, so later requests read it from cache instead of paying full input price. On Anthropic’s API, cache reads cost a small fraction of normal input, while writing to the cache costs slightly more than normal input, so caching pays off when the same context is reused several times. OpenAI and Google offer similar mechanisms. Put stable content first in the prompt and variable content last, so the cacheable part stays identical.

When should you use batch APIs?

Batch APIs accept many requests at once and return results within hours rather than seconds, at about half the normal price on major providers. They suit overnight jobs such as tagging support tickets, summarising documents, generating product descriptions or evaluating test sets. Anything a person is waiting for should stay on the real-time API.

Why are agents especially expensive?

  • Each step resends the growing conversation and tool results
  • Multi-agent systems multiply calls
  • Retries and loops add hidden cost
  • Large tool outputs inflate input tokens

Set limits on steps and spend per task, trim tool outputs and cache the agent’s instructions. Our AI agent cost guide covers budgeting.

What does this look like in practice?

A support platform answers around 50,000 customer questions a month using a frontier model for every request, with a 6,000-token system prompt and help-centre extracts resent each time. The team makes four changes. A small model now classifies each question and answers the simple ones, about two thirds of the total; only complex questions go to the larger model. The fixed instructions are cached, so repeated requests pay the cache-read rate. Overnight tagging and summarising moves to the batch API. Answers are capped at around 150 words unless the customer asks for detail. Measured on the same test set, answer quality is unchanged, while the monthly bill falls sharply. Figures differ by product, but this combination is the usual pattern.

What mistakes should you avoid?

  • Optimising before measuring which features cost the most
  • Switching to a cheaper model without re-running your test set
  • Changing the start of prompts constantly, which breaks caching
  • Sending whole documents when only a few passages are needed; use RAG instead

How do you keep costs under control?

  • Tag every request: Record feature, model, tokens and cost.
  • Measure cost per task: Track cost per resolved ticket or processed document, not just totals.
  • Set budgets and alerts: Use provider spend limits and your own alerts.
  • Review monthly: Find the most expensive features and optimise them first.
  • Re-test after releases: New, cheaper models may meet your bar.

How UIUX Studio helps

We audit AI features for cost, implement routing, caching and batching, and set up monitoring so spend stays predictable. Talk to our product engineering team.

Frequently asked questions

What is the fastest way to cut LLM costs?

Use a smaller model where it meets quality, and route only hard tasks to larger ones.

What is prompt caching?

Storing repeated prompt content so later requests read it at a much lower price.

How much do batch APIs save?

About 50% on major providers, for jobs that can wait.

Will cheaper models hurt quality?

Not if you test them on your tasks and keep a fallback to a larger model.

How should we track AI costs?

Per feature and per completed task, with budgets and alerts.

Related articles

{{ p.category }} {{ t }}

{{ p.title }}

{{ p.excerpt }}

U{{ author.name }} {{ p.readMins }} min read
{{ p.category }}
{{ p.title }}
{{ mo.sub }}
{{ m.tag }}
{{ m.t }}
{{ m.d }}
{{ m.left.t }}✕{{ x.t }}
{{ m.right.t }}✓{{ x.t }}
{{ m.big }}{{ m.label }}
{{ x.t }}
{{ m.label }}
✓{{ x.t }}
{{ x.t }}
{{ m.label }}
{{ x.t }}
{{ m.status }}
{{ m.label }}
{{ x.t }}{{ x.n }}
{{ x.t }}
{{ m.label }}{{ m.stepTxt }}
{{ x.t }}
{{ m.btn }}
{{ x.t }}
{{ m.q }}
{{ m.a }}
{{ x }}
{{ k.n }}
{{ k.v }}
{{ m.label }}
{{ m.status }}
{{ m.label }}
{{ st.n }}{{ st.t }}
{{ m.hub }} {{ nd.t }}
AaAaAaAa
ButtonInput fieldTag
THE SHORT ANSWER

{{ p.answer }}

KEY TAKEAWAYS
  • ✓{{ k }}
RELATED SERVICES{{ l.t }}

{{ b.t }}

{{ g.t }}{{ g.t }}

{{ b.label }}:{{ b.t }}
{{ c.ini }}
{{ c.t }}
{{ c.d }}
  1. {{ s.n }}
    {{ s.t }}
    {{ s.d }}
{{ h }}
{{ c.t }}
{{ b.alt }}
{{ b.alt }}
{{ g.alt }}
{{ g.alt }}
{{ b.title }}
{{ c.t }}
{{ c.s }}
  • {{ i }}
{{ c.t }}{{ c.s }}
{{ b.caption }}
{{ s.v }}
{{ s.l }}
{{ s.s }}
{{ b.caption }}
{{ b.title }}
{{ b.unit }}
{{ r.l }}{{ r.d }}
{{ b.caption }}
{{ b.title }}
A{{ b.a.t }}
  • {{ i }}
B{{ b.b.t }}
  • ✓{{ i }}
{{ b.caption }}
{{ b.title }}
  1. {{ t.d }}
    {{ t.t }}
{{ b.caption }}
“
{{ b.t }}
{{ b.by }}
{{ b.title }}
{{ r.d }}
{{ r.l }}
{{ b.caption }}
{{ b.title }}
{{ m.n }}
{{ b.lo }}{{ b.hi }}
{{ m.n }}
{{ m.l }}
{{ m.d }}
{{ b.caption }}
{{ b.cs.client }} case study
Case study · {{ b.cs.client }} {{ b.cs.title }} {{ b.cs.text }}
{{ f.v }}{{ f.l }}
View case study →
SOURCES AND FURTHER READING
  1. {{ s.t }}

Frequently asked questions

{{ f.a }}

U
Written by {{ author.name }}
{{ author.role }}

Keep reading

More articles from across design, AI and marketing.

All articles
{{ r.category }} · {{ r.readMins }} min{{ r.title }}

For Ambitious Founders

Startup Strategy Session Discuss Your Project with Our Senior Experts

  • No Obligation
  • Expert Insights
  • Tailored Guidance