Most of an LLM bill comes from a few habits, not from the price list. Every request goes to the largest model. The same long instructions are resent and paid for in full each time. The context grows with every turn. And jobs nobody is waiting for run in real time. Fix those four and the bill usually falls sharply, while quality stays the same or improves, because shorter and better-targeted prompts tend to produce better answers. This guide walks through the levers in the order we apply them. We rewrote it in November 2026. It contains no prices, only ratios, because prices change faster than the principles do.

How the bill is built

Language models are billed per token, which is roughly a word fragment. You pay for what you send (input) and for what the model writes (output), and the two are priced differently. On Anthropic's published list at the time of writing, output tokens cost five times as much as input tokens on every current Claude model, and the gap between the smallest and the largest model in the range is far more than tenfold (Anthropic pricing). Other providers follow the same pattern. Three conclusions follow directly:

1. Measure cost per task, not per call

You can't reduce what you haven't attributed. For every request, log the feature it belongs to, the model, input tokens, cached tokens, output tokens and whether the result was accepted. Then add it up per completed task. A support answer that takes three model calls and one retry is one task. This view usually shows that one or two features account for most of the spend, and it gives you a baseline to prove that a change saved money without hurting results.

2. Send each job to the smallest model that does it well

Classifying an email, pulling fields from an invoice or deciding which department a question belongs to does not need the model you'd use to draft a contract analysis. Routing means matching the job to the model:

The research backs the idea. The FrugalGPT paper showed a cascade matching the best single model with up to 98% lower cost in its experiments (Chen, Zaharia and Zou, 2023), and RouteLLM reported cost reductions of more than two times in certain cases without loss of response quality (Ong et al., 2024). Those are benchmark results, not promises. Your own number depends on your mix of easy and hard requests, which is why routing decisions belong on a test set, as described in our guide to evaluating LLM quality.

3. Cache the part of the prompt that never changes

In most business systems the bulk of every prompt is identical from one request to the next: instructions, tool definitions, examples, a product catalogue or policy document. Prompt caching lets the provider reuse that prefix instead of processing it again.

All three work on the same rule: the cache matches from the start of the prompt, so the stable content must come first and anything that changes must come last. The classic mistake is a timestamp or a customer name at the top of the system prompt. It changes on every request, so nothing after it is ever reused. Check the usage fields in the response to confirm you are getting cache hits. A cache nobody verifies is often a cache that never matches.

An illustrative example: an assistant sends 4,000 tokens of instructions and reference text plus a 300-token question, about 2,000 times a day. Without caching, all 4,300 input tokens are billed in full each time. With the prefix cached and read at 10%, each request is billed as the equivalent of 700 tokens. That is about 84% less input cost on every cache hit, before the modest surcharge for writing the cache.

A second kind of cache sits in your own application: if the same question arrives often and the answer doesn't depend on who asks, store the answer and skip the model. Be careful with anything personal. A cached answer must never leak one customer's details to another.

4. Keep the context short

Context is the easiest cost to let grow unnoticed. Chat history accumulates, retrieval returns more passages than needed, and tool results are pasted in whole.

Shorter context is not only cheaper. Researchers have shown that models use information at the start and end of a long context best, and that accuracy drops when the relevant passage sits in the middle (Liu et al., "Lost in the Middle"). Padding a prompt with marginal material can make answers worse while you pay more for them.

5. Batch what nobody is waiting for

A large share of AI work is not a conversation. Classifying last night's documents, summarising a backlog, enriching records or running a test suite can all wait an hour. Batch APIs are built for exactly this. Anthropic's Message Batches API charges 50% less than standard requests, with most batches finishing in under an hour and results available within 24 hours at the latest (batch processing docs). OpenAI's Batch API offers the same 50% discount with a 24-hour completion window (batch guide). Anthropic's documentation notes that the batch and caching discounts can be combined, which makes large overnight jobs with a shared prompt very cheap.

6. Don't call the model when code will do

The cheapest request is the one you never make. Before a model call, ask whether the step is truly a language problem. Validating a postcode, looking up an order status, checking a number against a threshold or matching an exact product code is ordinary code: faster, free to run and correct every time. A well-built system uses the model for the parts that need judgement and plain software for everything else.

The levers side by side

LeverSaves whenTrade-off
Model routingMany requests are simpleNeeds a test set and an escalation path
Prompt cachingA long prefix repeats across requestsPrompt order must stay stable
Shorter contextHistory and retrieval have grownRequires good retrieval and summaries
BatchingResults can wait up to a dayNo instant answers
Code instead of a modelThe step is deterministicMore engineering up front

What not to cut

Two things look like savings and are not.

The real unit is cost per correct result. Keep that in view and the optimisations sort themselves into the right order. It is also how you should present the numbers internally, alongside the hours saved, as we set out in our guide to measuring AI automation ROI.

When to consider running your own model

At high and predictable volume, or when data may not leave your environment, hosting an open model yourself can be the better deal. It replaces a per-token bill with hardware and operations, so it only pays off above a certain steady workload. We cover the reasoning in self-hosted LLMs for GDPR-compliant AI.

A cost checklist

  1. Log tokens, model and outcome per feature, and report cost per completed task.
  2. List your request types and assign each the smallest model that passes your test set.
  3. Reorder prompts so stable content comes first, then switch on caching and verify the hit rate.
  4. Cap retrieval, history and output length.
  5. Move every job without a waiting user to a batch API.
  6. Replace deterministic steps with code.
  7. Rerun the test set after each change, and set a spend alert so surprises show up the same day.

Neurova AI designs these controls in from the first sprint, so running cost is part of the design and not a surprise after launch. If you have an AI feature whose bill is growing faster than its use, tell us about it through our AI development page and we'll look at where the tokens go.

Frequently asked questions

How can I reduce LLM API costs? Measure cost per completed task first, so you know which feature spends the most. Then send simple work to a smaller model, cache the parts of the prompt that repeat, keep the context short, run non-urgent jobs through a batch API, and replace model calls with ordinary code wherever the task is deterministic. Check every change against a test set so quality does not slip.

What is prompt caching and how much does it save? Prompt caching lets a provider reuse the unchanged start of a prompt, such as instructions, tool definitions and reference documents, instead of processing it again on every request. Reused tokens are billed at a fraction of the normal input price. Anthropic lists cache reads at 10% of the base input price on its standard models, and OpenAI describes discounts of up to 95% on cached input.

Does using a cheaper model reduce quality? Not if the task suits it. Classification, extraction, routing and short summaries are usually handled well by smaller models. Harder reasoning and long, open-ended writing benefit from larger ones. The safe way to decide is to run both models on the same test set of real examples and compare the results, not to guess.

When does batch processing make sense for LLM workloads? When nobody is waiting for the answer. Nightly document classification, backfills, bulk summaries and evaluation runs are good candidates. Anthropic and OpenAI both offer a 50% discount for batch requests, in return for results arriving within 24 hours instead of immediately.

Written by Andreas Chitos, founder of Neurova AI. He builds AI systems and medical software from Eindhoven, the Netherlands. Get in touch.