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.
- ✓Model choice is the biggest lever: prices differ up to 40 times
- ✓Route tasks by difficulty instead of using one model for everything
- ✓Prompt caching cuts the cost of repeated context sharply
- ✓Batch APIs offer about 50% off for jobs that can wait
- ✓Measure cost per completed task, not just total spend
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?
How does model routing work?
- Simple, standard or complex
- Simple → small model
- Standard → mid-tier
- Complex → frontier
- Low confidence goes up a tier
- Log cost and outcome
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?
-
1
Tag every requestRecord feature, model, tokens and cost.
-
2
Measure cost per taskTrack cost per resolved ticket or processed document, not just totals.
-
3
Set budgets and alertsUse provider spend limits and your own alerts.
-
4
Review monthlyFind the most expensive features and optimise them first.
-
5
Re-test after releasesNew, 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.
