Skip to main content

How to reduce AI token costs.

The tactics that cut LLM API costs, from model routing and prompt caching to batch discounts and loop guards, with who acts on each and how to keep the savings.

Topic
AI cost
Product
Novie Control
Format
Guide
Reading time
10 min
Published
29 October 2026
In short

To reduce AI token costs, send each task to the smallest model that does it well, cache the prompt prefix every request repeats, move work that can wait to a batch API at half price, and cap output length and agent loops. Then give each agent a budget, so the money saved stays saved.

We checked every provider mechanic below against OpenAI's and Anthropic's own documentation on 29 October 2026. Prices and discounts change often, so the guide explains how each one works and links to the page that sets it.

Where AI token costs come from.

Every model call is billed as input tokens times the input price, plus output tokens times the output price. A task costs the sum of its calls, and an agent can make dozens of calls for one task, each one re-reading what came before.

That gives four places to cut. Make fewer calls. Send fewer tokens in each call. Pay less for each token, through a cheaper model, a cache or a batch discount. And stop the runs that go wrong before they repeat. Output usually costs several times more per token than input, and on reasoning models the hidden reasoning is billed as output too, which OpenAI's reasoning guide states plainly.

Our guide to what an AI agent costs to run works through the formula with two examples from public price lists.

TakeawayCost per call is tokens times price, so every saving comes from fewer calls, fewer tokens, cheaper tokens or a run that stops sooner.

AI cost optimisation strategies, and who acts on each.

Most savings sit with engineers, who change the code. Budget owners decide which work may wait for a batch, which model tier each use case is allowed, and what each agent may spend. The table pairs each tactic with the mechanism that saves money and the person who makes the change.

TacticHow it savesWho acts
Right-size the model per task.Smaller models carry a lower price per token, often by a wide margin.Engineers test. Budget owners set the default tier per use case.
Prompt caching.Repeated prompt prefixes are billed at a fraction of the input price.Engineers.
Batch APIs and flex processing.Work that can wait is billed at half the standard rate.Budget owners decide what can wait. Engineers move it.
Limits on output and reasoning effort.Fewer output tokens, which are the dearer kind.Engineers.
Retrieval instead of stuffing.Each call carries the passages it needs instead of whole documents.Engineers.
Shorter context in long sessions.Old turns stop being resent with every call.Engineers and every user of a coding tool.
Turn limits and retry limits for agents.A failing run ends after a known number of paid calls.Engineers set them. Agent owners choose the numbers.
Caching of results.An identical question gets a stored answer and no model call.Engineers.
A budget and a cap per agent.Freed budget is held instead of absorbed by new usage.Budget owners, with finance.

TakeawayEngineers make most of the changes, and budget owners set the defaults and the caps that keep the savings.

How to choose the right model for each task.

Use the smallest model that passes your own test set for the task, and keep the largest models for the steps that need deep reasoning. The price gap is large enough that this is usually the biggest single saving.

On Anthropic's price list, checked on 29 October 2026, its smallest model costs US$0.10 per million input tokens and US$0.50 per million output tokens for prompts up to 100,000 tokens, a mid-sized large model costs US$4 and US$20, and its largest model costs US$10 and US$50. The same task can cost a hundred times more on the top model than on the smallest one. OpenAI's cost optimisation guide gives the same advice: use models that keep accuracy while reducing cost and latency.

Anthropic price list, prompts up to 100,000 tokens, checked 29 October 2026.

Model routing to cut cost.

  1. Build a small test set for each task from real inputs, with the answer you expect.
  2. Run the smallest model first and move up a tier only when it fails the test set.
  3. Route by step inside an agent. Classification, extraction and short drafts go to a small model, and planning goes to a larger one.
  4. Escalate on doubt. When the small model's answer fails a check, retry that one call on the larger model.
  5. Re-run the test set when a provider releases a new model, because the cheapest model that passes changes over time.

TakeawayPick the model per step from your own test results, and let only the hard steps reach the dearest tier.

How prompt caching works on OpenAI and Anthropic.

Prompt caching bills the repeated start of a prompt, such as instructions, tool definitions and reference documents, at a fraction of the normal input price. OpenAI applies it automatically. On Anthropic you turn it on with a cache_control field.

On OpenAI.

OpenAI's prompt caching guide says caching is on by default for supported models, with cached input tokens discounted by up to 95 percent. The minimum cacheable prompt is 1,024 tokens on its newest models, where a cache write costs 1.25 times the standard input rate; earlier models carry no write charge. A prompt_cache_key can improve hit rates for requests that share a prefix, though the guide says it influences routing and does not guarantee a hit.

On Anthropic.

Anthropic's pricing page sets a five-minute cache write at 1.25 times the base input price and a one-hour write at twice the base price. A cache read costs 0.1 times the base input price on most models, and less again on its newest models, down to 0.025 times on the largest. A five-minute cache pays for itself after one read, and a one-hour cache after two. The prompt caching guide says a prompt below the model's minimum length is processed without caching and returns no error, and the minimum is 512 tokens on the newest models.

How to make caching pay.

  1. Put the content that never changes first, and the user's question last.
  2. Keep the prefix identical from call to call. A timestamp or a reordered tool list at the top breaks every hit.
  3. Keep thinking settings stable within a conversation. Anthropic's documentation says changing them invalidates cached breakpoints.
  4. Read the cached token counts in each response, and treat a falling hit rate as a bug.

TakeawayPut the stable prefix first and keep it byte for byte the same from call to call.

When to use a batch API to cut LLM API costs.

Use a batch API for any work that can wait up to a day. Both OpenAI and Anthropic bill batched requests at half the standard price.

  • OpenAI's Batch API gives a 50 percent discount compared with synchronous calls, with a 24-hour completion window. OpenAI names evaluations, classifying large datasets and embedding content as typical jobs.
  • OpenAI's flex processing prices tokens at Batch API rates for ordinary requests, in exchange for slower responses and occasional unavailability. A request refused for lack of capacity returns a 429 error and is not charged.
  • Anthropic's Message Batches API cuts input and output prices by 50 percent. Most batches finish within an hour, and a request the batch could not process within 24 hours expires and is not billed.
  • Anthropic's pricing page says the batch discount and prompt caching multipliers stack, and its batch guide suggests the one-hour cache for batches that share context.

Good candidates are nightly summaries, backfills, document tagging, test runs against an evaluation set and any report nobody reads until the morning. A budget owner who lists the work that can wait often finds a share of spend that halves with no change to the model.

TakeawayAnything that can wait a day belongs in a batch, at half price, and caching discounts apply on top.

How to cut the tokens in each call.

Send each call only the context it needs, and cap how much the model may write and think. Input grows quietly, while output and reasoning cost the most per token.

Cap output and reasoning.

On OpenAI, max_output_tokens caps everything the model generates, reasoning included. OpenAI's reasoning guide warns that a run can hit the cap before any visible output, so you pay for input and reasoning and get no answer, and it suggests reserving at least 25,000 tokens while you experiment. Lower reasoning effort favours speed and fewer tokens. On Anthropic, the effort setting controls how much newer models think, and models numbered 4.6 and later keep earlier turns' thinking in context and bill it as input.

Retrieve instead of stuffing.

Pasting a whole policy manual into every prompt pays for the manual on every call. Retrieval sends the few passages a question needs. Tool definitions count as input too: Anthropic's pricing page lists the tool names, descriptions and schemas, plus a tool-use system prompt, among the tokens each request pays for. Load the tools a step uses, and summarise long conversations before they grow past what the task needs.

TakeawayCap output and reasoning per call, and send only the passages and tools the step needs.

How to stop agent loops and retries multiplying the bill.

Give every agent a turn limit, a retry limit and a spending cap per run, so a step that keeps failing stops after a known cost. Every retry and every extra turn is a paid call that re-reads the whole task so far.

  1. Set a turn limit. OpenAI's Agents SDK takes a max_turns value and raises MaxTurnsExceeded when a run passes it.
  2. Set a retry limit per tool and per model call, with backoff, and fail the run when the limit is reached.
  3. Detect repetition. When an agent calls the same tool with the same arguments twice, stop the run and hand it to a person.
  4. Cache the results of deterministic tool calls and of identical questions, so a repeated lookup costs nothing.
  5. Set a dollar cap per run as well as per month, so one bad run cannot use the month.

Our guide to token budgets for AI agents covers where to put those caps and what should happen when an agent reaches one.

TakeawayGive every run a limit it cannot pass, and stop any agent that repeats itself.

How to reduce Claude Code token usage.

Clear the session between unrelated tasks and use Sonnet for most coding, with as little loaded into context as the task allows. Anthropic's cost guide says Claude Code sends the full conversation with every request, so stale context costs money on every message.

  • Run /clear when you switch to unrelated work, and /compact with instructions on what to keep when you need continuity.
  • Use Sonnet for most coding and keep Opus for complex architecture and multi-step reasoning. Give simple subagents the Haiku model.
  • Lower /effort for simple tasks, because thinking tokens are billed as output.
  • Keep CLAUDE.md under about 200 lines, and move workflow instructions into skills that load only when used.
  • Disable MCP servers you are not using, and prefer command-line tools, which add no tool listings to context.
  • Use hooks to filter long test or log output down to the failures before Claude reads it.
  • Keep agent teams small. Anthropic says they use about seven times the tokens of a standard session when teammates run in plan mode.
  • Read the /usage breakdown, which recommends a change for any behaviour behind 10 percent or more of recent usage.

Anthropic puts the average across enterprise deployments at around US$13 per developer per active day. Spending limits for Claude Code depend on how developers sign in, and our Anthropic guide covers each route.

TakeawayClear stale context and match the model and effort to the task.

How to keep the savings once you have them.

Set a budget for each agent and team at the new, lower run rate, and review cost per outcome each month. Without a budget, a cheaper task usually means more tasks, and the bill returns to where it was.

  1. Record each agent's cost per task before and after a change, so the saving has a number and an owner.
  2. Lower that agent's budget to match, and set an alert well before the cap.
  3. Send any request for more budget to a named person, with a reason and an expiry.
  4. Report spend by team and by agent each month, so a creeping run rate shows up before the invoice.

Our guide to tracking LLM costs per team shows how to attribute spend to the people who can act on it, and our AI spend management guide covers the company-wide total.

TakeawayLower each budget to the new run rate, so the savings show up in the budget.

Common mistakes.

  • Optimising prompts before checking the model. A tier change usually saves more than any rewrite.
  • Putting a timestamp or user name at the top of a prompt, which breaks the cache on every call.
  • Assuming Anthropic caches automatically. The Messages API caches only when a request asks for it.
  • Setting max_output_tokens so low on a reasoning model that runs end with no answer, which pays for the reasoning and wastes it.
  • Running evaluations and backfills at full price when a batch would halve them.
  • Leaving agents without a turn limit, so one failing tool call repeats until someone notices the bill.
  • Counting a saving without lowering the budget, so new usage absorbs it.

How Novie Control does it

You can see what AI costs to build.Can you see what it costs to run?

See how Novie Control helps.

Sources

  1. OpenAI, Prompt caching (checked 29 October 2026)
  2. OpenAI, Batch API (checked 29 October 2026)
  3. OpenAI, Flex processing (checked 29 October 2026)
  4. OpenAI, Reasoning models (checked 29 October 2026)
  5. OpenAI, Cost optimization (checked 29 October 2026)
  6. OpenAI, Agents SDK: running agents (checked 29 October 2026)
  7. Anthropic, Pricing (checked 29 October 2026)
  8. Anthropic, Prompt caching (checked 29 October 2026)
  9. Anthropic, Batch processing (checked 29 October 2026)
  10. Anthropic, Extended thinking (checked 29 October 2026)
  11. Anthropic, Claude Code: manage costs effectively (checked 29 October 2026)

Other articles

Frequently asked questions

How do I reduce AI token costs?

Send each task to the smallest model that passes your own tests, cache the prompt prefix that repeats, and move work that can wait to a batch API, which OpenAI and Anthropic both bill at half price. Then cap output, reasoning effort and agent turns, and set a budget per agent so the savings hold.

How do I reduce LLM API costs without losing quality?

Build a small test set from real inputs for each task, then try cheaper models and settings against it and keep the cheapest one that passes. Re-run the test set when providers release new models. Quality falls when changes are made without a test, so the test set is the safeguard.

How much does prompt caching save?

OpenAI discounts cached input tokens by up to 95 percent. Anthropic bills a cache read at 0.1 times the base input price on most models and less on its newest ones, after a write at 1.25 times for five minutes or twice the price for an hour. The saving depends on how much of each prompt repeats and how often.

Is the batch API cheaper?

Yes. OpenAI's Batch API and Anthropic's Message Batches API both charge 50 percent of the standard price, in exchange for results within 24 hours. Anthropic says most batches finish within an hour, and its batch discount stacks with prompt caching.

What is model routing, and how does it cut cost?

Model routing sends each request or agent step to a model chosen for that job, usually the cheapest one that passes a test set. Simple steps such as classification go to a small model, and only planning or hard reasoning reaches a large one. Because list prices differ by up to a hundred times between tiers, routing is often the largest saving.

How do I reduce Claude Code token usage?

Clear the session between unrelated tasks and use Sonnet for most coding, with a lower effort level for simple work. Keep CLAUDE.md short by moving workflow instructions into skills, and disable MCP servers you are not using. The /usage command lists the habits behind your heaviest usage.

How do I manage AI token costs across teams?

Attribute spend to each team and agent by API key, project or workspace, and give each one a monthly budget with an alert before the cap. Review cost per outcome monthly and send budget increases to a named approver. That keeps the savings from one team's changes from being absorbed by new usage.

Build the intelligenceyour organisation compounds.