# 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: 2026-11-01

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

| Service | Item | Value | Note | Source |
| --- | --- | --- | --- | --- |
| OpenAI | Cached input on the gpt-6 and gpt-6.1 models | A tenth of the input price | A twentieth on gpt-6.1-sol and gpt-6.1-terra. | https://developers.openai.com/api/docs/pricing |
| OpenAI | Cache write, 30 minutes | 1.25x the input price | A 12-hour write costs 2.5x. | https://developers.openai.com/api/docs/pricing |
| OpenAI | Batch and Flex | 50% | Half the Standard input and output price. | https://developers.openai.com/api/docs/pricing |
| OpenAI | Fast processing on the gpt-6 and gpt-6.1 models | 2x the Standard price | Called Priority until July 30, 2026. | https://developers.openai.com/api/docs/pricing |
| OpenAI | Prompts over 272K tokens | 2x input, 1.5x output | On models with long-context prices; cached input doubles too. | https://developers.openai.com/api/docs/pricing |
| Anthropic | Cache write, 5 minutes | 1.25x the input price | A 1-hour write costs 2x. | https://platform.claude.com/docs/en/about-claude/pricing |
| Anthropic | claude-opus-5.5: per 1M cache-hit tokens | $0.20 | 5% of the input price. | https://platform.claude.com/docs/en/about-claude/pricing |
| Anthropic | claude-fable-5.1: per 1M cache-hit tokens | $0.25 | 2.5% of the input price. | https://platform.claude.com/docs/en/about-claude/pricing |
| Anthropic | Batch API | 50% | Half the input and output price; it combines with the caching discount. | https://platform.claude.com/docs/en/about-claude/pricing |
| Anthropic | Fast mode on claude-opus-5.5 | 2x the standard price | Not available with the Batch API. | https://platform.claude.com/docs/en/about-claude/pricing |
| Google | Cached input | A tenth of the input price | A twentieth on gemini-4-argon. | https://ai.google.dev/gemini-api/docs/pricing |
| Google | Batch and Flex | 50% | Half the Standard input and output price. | https://ai.google.dev/gemini-api/docs/pricing |
| Google | Prompts over 200K tokens | 2x input, 1.5x output | On gemini-3.1-pro-preview and gemini-2.5-pro; the cache price doubles too. | https://ai.google.dev/gemini-api/docs/pricing |

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`](https://5abeer.ai/en/models/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](https://5abeer.ai/en/docs/api/caching.md#claude); 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](https://5abeer.ai/en/docs/api/caching.md#gpt) explains. For Gemini models there is no field to set: keep the stable part first, as [Gemini caching](https://5abeer.ai/en/docs/api/caching.md#gemini) says.

## Which model should each step use?

Prices inside one provider's range are far apart. At Anthropic, [`claude-fable-5.1`](https://5abeer.ai/en/models/claude-fable-5.1) costs 2.5 times as much as [`claude-opus-5.5`](https://5abeer.ai/en/models/claude-opus-5.5), Opus costs twice as much as [`claude-sonnet-5.5`](https://5abeer.ai/en/models/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](https://5abeer.ai/en/guides/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`](https://5abeer.ai/en/models/claude-sonnet-5.5) or Sol 6.1.
- **The hardest steps** such as planning, difficult debugging or a final review: [`claude-opus-5.5`](https://5abeer.ai/en/models/claude-opus-5.5), [`claude-fable-5.1`](https://5abeer.ai/en/models/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](https://5abeer.ai/en/guides/claude-code-cheapest-way) 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](https://5abeer.ai/en/docs/api/messages.md#params), `reasoning.effort` in [Responses](https://5abeer.ai/en/docs/api/responses.md#params) and `reasoning_effort` in [Chat Completions](https://5abeer.ai/en/docs/api/chat-completions.md#params), 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`](https://5abeer.ai/en/models/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`](https://5abeer.ai/en/models/claude-opus-5.5) and [`claude-sonnet-5.5`](https://5abeer.ai/en/models/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.

| Model | Id | Input (ours) | Output (ours) | Context |
| --- | --- | --- | --- | --- |
| Claude Sonnet 5.5 | `claude-sonnet-5.5` | $0.60 | $3 | 1M |
| Claude Opus 5.5 | `claude-opus-5.5` | $1.20 | $6 | 1M |
| Claude Fable 5.1 | `claude-fable-5.1` | $3 | $15 | — |

| Model | Id | Input (ours) | Output (ours) | Context |
| --- | --- | --- | --- | --- |
| GPT-6.1 Sol | `gpt-6.1-sol` | $0.60 | $3 | 922K |
| GPT-6 Astra | `gpt-6-astra` | $3 | $15 | — |
| GPT-6 Sol | `gpt-6-sol` | $0.60 | $3 | 922K |
| GPT-6 Luna | `gpt-6-luna` | $0.03 | $0.15 | 922K |
| GPT-5.6 Luna | `gpt-5.6-luna` | $0.06 | $0.36 | 400K |

| Model | Id | Input (ours) | Output (ours) | Context |
| --- | --- | --- | --- | --- |
| Gemini 4 Argon | `gemini-4-argon` | $0.60 | $3 | — |
| Gemini 2.5 Pro | `gemini-2.5-pro` | $0.38 | $3 | 1M |
| Gemini 3.8 Flash | `gemini-3.8-flash` | $0.23 | $1.13 | — |
| Gemini 3 Flash | `gemini-3-flash` | $0.15 | $0.90 | 1M |
| Gemini 3.1 Pro | `gemini-3.1-pro` | $0.60 | $3.60 | 1M |

Every model, with its prices, is on the [models page](https://5abeer.ai/en/models). The [Claude](https://5abeer.ai/en/api/claude), [OpenAI](https://5abeer.ai/en/api/openai) and [Gemini](https://5abeer.ai/en/api/gemini) pages compare each family with its official price, and [the API page](https://5abeer.ai/en/api) covers the whole offer.

Give each project its own key with a spend limit, as [API keys](https://5abeer.ai/en/docs/start/keys.md) explains, so a runaway loop stops there, and check the cached-token count in the [usage data](https://5abeer.ai/en/docs/api/caching.md#usage). If you mostly work inside apps such as [Claude Code](https://5abeer.ai/en/apps/claude-code), compare the plans on [the apps page](https://5abeer.ai/en/apps) and [pricing](https://5abeer.ai/en/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](https://5abeer.ai/en/docs/start/keys.md) shows how. For the difference between paying per token and a plan, see [AI subscription vs API](https://5abeer.ai/en/guides/ai-subscription-vs-api).

## Sources

Checked on 2026-11-01:

- [Pricing](https://platform.claude.com/docs/en/about-claude/pricing), Claude API docs
- [Extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking), Claude API docs
- [Pricing](https://developers.openai.com/api/docs/pricing), OpenAI API docs
- [Prompt caching](https://developers.openai.com/api/docs/guides/prompt-caching), OpenAI API docs
- [Reasoning models](https://developers.openai.com/api/docs/guides/reasoning), OpenAI API docs
- [Batch API](https://developers.openai.com/api/docs/guides/batch), OpenAI API docs
- [Pricing](https://ai.google.dev/gemini-api/docs/pricing), Gemini API docs
- [Context caching](https://ai.google.dev/gemini-api/docs/caching), Gemini API docs
- [Batch API](https://ai.google.dev/gemini-api/docs/batch-api), Gemini API docs

> 5abeer is an independent service, not affiliated with Anthropic, OpenAI or Google.
