Skip to content

Cut your LLM API bill: caching, model choice and batch

Cut your LLM API bill with prompt caching, the right model for each step, shorter output and batch jobs, with official discounts dated and sourced.

Updated November 1, 2026Markdown version

An LLM API bill is input tokens plus output tokens, each times a price per million. To cut it, cache the parts of your prompt that repeat, send simple steps to a smaller model, keep answers and thinking short, batch work that can wait, and pay below list price for every token you still send.

Where does an LLM API bill come from?#

Every request is billed in tokens, priced per million, and each kind of token has its own rate:

  • Input: your instructions, tool definitions, documents and the conversation so far.
  • Cached input: the part of the input read from the provider's cache, at a fraction of the input price.
  • Output: the answer, plus any thinking the model does first. Anthropic, OpenAI and Google all bill thinking tokens as output, even when you never see them.

On the newest models from all three providers, output costs five times as much as input, and a chat or an agent resends the whole conversation on every turn, so long sessions are mostly input. The largest savings come from caching repeated input and keeping output short.

Which discounts do Anthropic, OpenAI and Google list?#

These are the caching, batch and speed rules as the three pricing pages showed them on November 1, 2026.

Official caching and batch discounts
ServiceItemValueNoteSource
OpenAICached input on the gpt-6 and gpt-6.1 modelsA tenth of the input priceA twentieth on gpt-6.1-sol and gpt-6.1-terra.developers.openai.com
OpenAICache write, 30 minutes1.25x the input priceA 12-hour write costs 2.5x.developers.openai.com
OpenAIBatch and Flex50%Half the Standard input and output price.developers.openai.com
OpenAIFast processing on the gpt-6 and gpt-6.1 models2x the Standard priceCalled Priority until July 30, 2026.developers.openai.com
OpenAIPrompts over 272K tokens2x input, 1.5x outputOn models with long-context prices; cached input doubles too.developers.openai.com
AnthropicCache write, 5 minutes1.25x the input priceA 1-hour write costs 2x.platform.claude.com
Anthropicclaude-opus-5.5: per 1M cache-hit tokens$0.205% of the input price.platform.claude.com
Anthropicclaude-fable-5.1: per 1M cache-hit tokens$0.252.5% of the input price.platform.claude.com
AnthropicBatch API50%Half the input and output price; it combines with the caching discount.platform.claude.com
AnthropicFast mode on claude-opus-5.52x the standard priceNot available with the Batch API.platform.claude.com
GoogleCached inputA tenth of the input priceA twentieth on gemini-4-argon.ai.google.dev
GoogleBatch and Flex50%Half the Standard input and output price.ai.google.dev
GooglePrompts over 200K tokens2x input, 1.5x outputOn gemini-3.1-pro-preview and gemini-2.5-pro; the cache price doubles too.ai.google.dev
Each row links to the page it comes from, checked November 1, 2026. These figures can change, so check the source before you buy.

How much does prompt caching save?#

A cache hit needs an exact match from the start of the request. Everything up to the first changed token can come from the cache, and everything after it is billed at the full input price. So order each request from the most stable part to the least stable:

  1. tool definitions,
  2. system instructions,
  3. reference documents,
  4. the conversation history,
  5. the new question, last.

A timestamp or a user name near the top changes the prefix on every request, which in practice turns caching off.

Writing to the cache can cost extra. At Anthropic, a write that lasts five minutes costs 1.25 times the input price and one that lasts an hour costs twice the input price, so the five-minute write pays for itself after a single cache read. On the newest GPT models, a 30-minute write costs 1.25 times the input price. Google adds no write premium: its implicit caching starts once a repeated prefix reaches 4,096 tokens on Argon, 3.8 Flash and 3.1 Pro, or 2,048 on 2.5 Pro, and only caches you create yourself add an hourly storage charge.

A worked example#

Say an agent on claude-opus-5.5 sends the same 40,000-token prefix 20 times within five minutes. Without caching, you pay for 800,000 input tokens at the full rate. With caching, you pay for one write at 1.25 times the input rate and 19 cache reads at a twentieth of it. In input-rate units that is 50,000 plus 38,000, or 88,000 instead of 800,000: about 89% less on that part of the bill. Output costs the same either way.

With Claude models, you mark the cached prefix with cache_control in the Messages format; Chat Completions and Responses have no field for it. GPT models cache long repeated prefixes on their own, and in Responses a stable prompt_cache_key helps similar requests share the cache, as GPT caching explains. For Gemini models there is no field to set: keep the stable part first, as Gemini caching says.

Which model should each step use?#

Prices inside one provider's range are far apart. At Anthropic, claude-fable-5.1 costs 2.5 times as much as claude-opus-5.5, Opus costs twice as much as claude-sonnet-5.5, and the newest Haiku costs a twentieth of Sonnet on prompts up to 100K tokens. At OpenAI, Astra costs five times as much as Sol 6.1, and Luna a twentieth of it. At Google, Argon costs about 2.7 times as much as 3.8 Flash today, and Gemini API pricing shows how that gap moves as both prices rise.

So send each step to the cheapest model that does it well:

  • Simple steps such as classifying, extracting fields or short rewrites: a small model such as the newest Haiku, Luna or a Flash model.
  • Most everyday work such as coding, writing and analysis: a balanced model such as claude-sonnet-5.5 or Sol 6.1.
  • The hardest steps such as planning, difficult debugging or a final review: claude-opus-5.5, claude-fable-5.1, Astra or Argon.

Judge a model by the cost of a finished task, not its price per token: a cheap model that needs three tries can cost more than a stronger one that gets it right the first time. For coding agents, the cheapest way to run Claude Code applies the same idea.

How do you keep output and thinking short?#

Output is the most expensive kind of token, and thinking counts as output. Three settings help:

  • Cap the length. Set max_tokens in Messages, max_output_tokens in Responses or maxOutputTokens in Gemini's generationConfig. Treat it as a ceiling, not a target: an answer cut off halfway must be asked for again. On Claude models, thinking counts toward max_tokens too.
  • Lower the effort on routine steps. A lower effort usually means fewer thinking tokens. Our references list output_config.effort in Messages, reasoning.effort in Responses and reasoning_effort in Chat Completions, each with low, medium and high. On Claude models, changing the thinking settings between turns makes the cached conversation miss, so keep one setting per conversation.
  • Ask for a fixed shape. A short list, a JSON object or a tool call with a schema stops the model from writing more than you need.

When is batch worth it?#

When nobody is waiting for the answer. All three providers charge half the standard price for batch requests, so evaluations, bulk classification or summaries, and backfills fit well. OpenAI completes a batch within 24 hours and Google targets the same turnaround, and both also offer a Flex tier at the same half price. At Anthropic, the batch discount combines with the caching discount.

Speed works the other way. OpenAI's Fast processing on the newest GPT models and Anthropic's fast mode on claude-opus-5.5 cost twice the standard price, and Google's Priority tier costs 1.8 times as much.

Our docs do not list Batch, Flex, Fast or Priority, so with 5abeer, plan around caching, model choice and shorter output, the levers that work on every request.

Do long prompts cost more?#

At OpenAI and Google, sometimes. Past 272K input tokens, OpenAI bills the models that list long-context prices at twice the input price and one and a half times the output price. Past 200K tokens, Google does the same on 3.1 Pro and 2.5 Pro. At Anthropic, current models such as claude-opus-5.5 and claude-sonnet-5.5 keep one price across their full context window; the newest Haiku is the exception and costs more past 100K tokens.

Even at one price, a long prompt is paid in full on every turn. Summarize or drop old turns, remove tool results you no longer need, and send the relevant parts of a document rather than the whole file.

What do the same models cost through 5abeer?#

5abeer sells Claude, GPT and Gemini models on the API below the official price, all from one balance. The lists below come from our live catalog.

per 1M tokens

Official price from the provider's page, checked October 19, 2026.

All models and prices
per 1M tokens

Official price from the provider's page, checked October 19, 2026.

All models and prices
per 1M tokens

Official price from the provider's page, checked October 19, 2026.

All models and prices

Every model, with its prices, is on the models page. The Claude, OpenAI and Gemini pages compare each family with its official price, and the API page covers the whole offer.

Give each project its own key with a spend limit, as API keys explains, so a runaway loop stops there, and check the cached-token count in the usage data. If you mostly work inside apps such as Claude Code, compare the plans on the apps page and pricing.

Questions#

Which lever saves the most?#

It depends on the workload. Caching wins when many requests share a long, stable prefix, as in agents and document chat. A smaller model wins when many steps are simple. Batch wins when results can wait, at the providers that offer it.

How do I know caching is working?#

Read the usage data of each reply: usage.cache_read_input_tokens in Messages, usage.prompt_tokens_details.cached_tokens in Chat Completions and usage.input_tokens_details.cached_tokens in Responses. A count that stays at zero means the start of your prompt changes between requests.

Do cache writes cost more?#

At Anthropic and on the newest GPT models, yes: a short-lived write costs 1.25 times the input price. Google adds no write premium, only hourly storage on caches you create yourself.

Are thinking tokens billed?#

Yes, as output, at Anthropic, OpenAI and Google. A task that makes the model think longer costs more even when the answer is short, so lower the effort where quality allows.

Do batch and caching discounts combine?#

At Anthropic, yes: its pricing page says the two can be combined. Our docs do not list batch, and caching works on regular requests.

Can I cap spending per key?#

Yes. Each key can have its own spend limit, expiry date and IP allow-list. API keys shows how. For the difference between paying per token and a plan, see AI subscription vs API.

Sources#

Checked on 2026-11-01:

Create an API keyPay per token from your balance, with a spend limit on each key.