Contents
- 1. Why your AI bill quietly balloons
- 2. Cost breakdown — input, output, cache, batch
- 3. Plan choice and its savings impact
- 4. Prompt caching — the lever that pays off most
- 5. Context management — /compact and splitting
- 6. Model selection — task-based routing
- 7. Managing your output budget
- 8. Batch processing — half price for work that can wait
- 9. The multi-agent trap — 15x tokens
- 10. Monitoring and billing alerts
- 11. Seven common wasteful patterns
- Summary
- FAQ
- Corrections to the earlier version
Updated September 26, 2026: We removed the figures in the title and the opening graphic — "compress to 20-30% of unoptimized cost," "-60 to 90% from caching," "$30K/month down to $6-9K," "eight out of ten jobs are fine on a cheaper model" — because we could not point to a source for them. In their place are worked examples you can calculate from the unit prices and multipliers on Anthropic's and OpenAI's official pricing pages, with the formulas shown. We also corrected the cache break-even point (one read pays off on the 5-minute cache, two on the 1-hour cache) and the output price (5x input), and added a chapter on batch processing. What changed is listed at the end of the article.
Move from a flat-rate plan like ChatGPT Plus ($20 a month) to per-token billing — Claude Code on an API key, or an AI app you built yourself — and your bill can change by an order of magnitude depending on how you use it. Usage-based billing has no ceiling.
The good news is that the measures that matter most come down to three: prompt caching, model selection, and an output budget. Each one's effect is set by multipliers printed in the official price lists, so you can calculate it for your own workload. This article uses Anthropic's and OpenAI's official documentation to lay out those multipliers and how to do the math.
You can calculate the savings from official prices
— from Anthropic's and OpenAI's official price lists as of September 26, 2026
Worked example: send the same 100,000-token prefix to Opus 5.5 ten times, less than 5 minutes apart, and the input cost goes from $4.00 without caching to $0.68 with the 5-minute cache (one write, $0.50, plus nine reads, $0.18).
Work that can wait costs half, on both input and output, through the Batch API — and the cache multipliers stack on top.
Sources: Claude Platform Docs, "Pricing" and OpenAI API Pricing (checked September 26, 2026; calculations are ours)
1. Why your AI bill quietly balloons
AI tools come in two billing tracks: personal plans (flat rate) and API billing (usage-based). The bill that explodes is mainly the latter.
- Personal plans: ChatGPT Plus $20/mo, Claude Pro $20/mo ($17/mo billed annually), Max from $100/mo. Fixed cost, so even heavy use has a ceiling (with usage limits).
- API billing: per-token, usage-based. Claude Code on an API key and AI apps you build yourself fall here. The monthly total can swing widely depending on how you use them.
Usage-based bills balloon because (1) output tokens cost 5x as much as input, (2) the longer your context grows, the more you resend in full on every request, (3) sub-agents get invoked again and again behind the scenes, and (4) once something loops, it doesn't stop — and these compound. Once you understand the mechanics, every one of them is fixable.
2. Cost breakdown — input, output, cache, batch
Using the API pricing of Claude Opus (Opus 5.5 as of September 2026 — the tier below the top-end Fable, and the one Anthropic recommends as the starting point) as an example, here's where the money goes.
| Item | Unit price (per 1M tokens) | Description |
|---|---|---|
| Input tokens | $4 | What you send: prompt + conversation history + files, etc. |
| Output tokens | $20 | What the AI returns. 5x input. |
| Cache write (5 min) | $5 (1.25x input) | Storing a prefix in the cache. Each read within 5 minutes extends it at no extra cost. |
| Cache write (1 hour) | $8 (2x input) | Survives gaps longer than 5 minutes, at a higher write price. |
| Cache read | $0.20 (0.05x input) | 0.1x on most models, 0.05x on Opus 5.5. This is the star of the savings show. |
| Batch processing | $2 input, $10 output (half price) | Asynchronous processing of requests that can wait. Stacks with the cache multipliers. |
| Tool calls | Counted as input | Tool definitions are part of the context. Passing any tool also adds a tool-use system prompt (286 tokens on Opus 5.5). |
In short, a prefix sitting in the cache reads for a tenth of the input price or less. The write multipliers (1.25x for 5 minutes, 2x for 1 hour) and output at 5x input are the same on every current Claude model; only the read multiplier varies by model (0.025x on Fable 5.1). Note also that Claude Opus 4.7 and later use a newer tokenizer that, per Anthropic, produces about 30% more tokens for the same text — worth remembering when you compare prices across generations. Source: Claude Platform Docs, "Pricing" (checked September 26, 2026).
3. Plan choice and its savings impact
The moment you can predict how you'll use it, switch to the right plan first.
| Usage | Recommended plan | Monthly target | Caveats |
|---|---|---|---|
| Hobby, learning, a few times a week | Claude Free / ChatGPT Free | $0 | Usage limits; not for work data. |
| Personal, a few hours daily | Claude Pro / ChatGPT Plus | $20 | Personal plan; not for work data. |
| Heavy personal use | Claude Max | From $100 | 5x or 20x the usage of Pro; for people who run Claude Code for long stretches. |
| Team work | Claude Team / ChatGPT Business | Claude Team standard seat $20 (annual) to $25/user | OK for work data; data not used for training. |
| Large organization | Enterprise | Sales quote | SSO, audit logs, SLA. |
| AI-embedded development | Direct API (Anthropic / OpenAI) | Usage-based | Use caching and batch. |
Sources: Claude pricing page and OpenAI Help, "What is ChatGPT Plus?" (checked September 26, 2026).
If you use Claude Code for long hours every day and keep hitting Pro's limits, consider the Max plan. Because it's flat rate, the bill can't run away the way it can on an API key. Cursor's individual Pro plan starts at $20 a month, with Pro+ and Ultra above it.
4. Prompt caching — the lever that pays off most
If you call the API directly and resend the same prefix again and again, there's almost no reason not to use prompt caching. Reads from the cache are billed at a small fraction of the base input price.
How it works
When you reuse the same system prompt or same documents across multiple requests, the first call writes them to the cache (1.25x input for the 5-minute cache). Every later call reads from the cache at 0.1x input (0.05x on Opus 5.5, 0.025x on Fable 5.1). A prefix that is too short won't be cached, though: the minimum is 512 tokens on Opus 5.5, 1,024 on Sonnet 5, and 4,096 on Haiku 4.5 (Claude Platform Docs, "Prompt caching").
Break-even — one read on the 5-minute cache, two on the 1-hour cache
Taking the input price as 1, compare the cost of sending the same prefix (calculated from Anthropic's official multipliers):
- 5-minute cache: write 1.25 + one read 0.1 = 1.35. Sending it twice without caching costs 2, so a single read pays for the write.
- 1-hour cache: write 2 + two reads 0.2 = 2.2. Sending it three times without caching costs 3, so two reads pay for the write (with just one read it's 2.1, slightly above the uncached 2).
Anthropic's pricing page says the same: caching pays off after one cache read for the 5-minute duration and after two for the 1-hour duration. Opus 5.5 reads at 0.05x, so the gap widens further for the same number of reads.
Worked example — a 100,000-token prefix sent 10 times
| Model | No cache | 5-minute cache | Difference |
|---|---|---|---|
| Claude Opus 5.5 (input $4, write $5, read $0.20) | 0.1 × $4 × 10 = $4.00 | 0.1 × $5 + 0.1 × $0.20 × 9 = $0.68 | About 83% less |
| Claude Sonnet 5 (input $2, write $2.50, read $0.20) | 0.1 × $2 × 10 = $2.00 | 0.1 × $2.50 + 0.1 × $0.20 × 9 = $0.43 | About 79% less |
Only the input for the prefix (system prompt, reference documents, etc.) is counted; 100,000 tokens = 0.1 in units of one million. Assumes all ten requests arrive less than 5 minutes apart, the first writes the cache and the other nine read it. Prices from Claude Platform Docs, "Pricing" (checked September 26, 2026). Output and the part of each request that changes are not included.
OpenAI's GPT-6 models work much the same way. Cached input costs 0.1x and cache writes 1.25x, and OpenAI's guide runs the same arithmetic: writing a prefix once and reusing it once costs 1.35x, versus 2x for processing it twice without caching. The cache lasts 30 minutes after its last use and is on by default for supported models (OpenAI, "Prompt caching").
The default lifetime is 5 minutes
On Anthropic's API, the prompt cache's lifetime (TTL) is 5 minutes by default. Each read refreshes it at no extra cost, but after a gap of more than 5 minutes it expires and the next request writes it again (1.25x input). You can choose a 1-hour lifetime instead, but writes then cost 2x input (source: Claude Platform Docs, "Prompt caching").
Claude Code runs on the same mechanism. Within a Claude subscription's included usage it gives the main conversation the 1-hour lifetime, but with an API key, or once you go past your plan's limit onto usage credits, it drops to 5 minutes. From v2.1.242 you can pick 5m or 1h yourself with the promptCacheTtl setting (source: Claude Code Docs, "Prompt caching", checked September 26, 2026). If you work with breaks in between, which of the two applies changes how often the cache gets rewritten.
Choosing between 5 minutes and 1 hour
The official documentation's guidance:
- A prefix reused more often than every 5 minutes: keep the 5-minute cache. Each read refreshes it for free, so you don't need the pricier 1-hour write.
- A prefix reused with gaps of 5 minutes to an hour (waiting for a user's reply, a call that follows a task running longer than 5 minutes): the 1-hour cache fits.
- Mixing the two: put the 1-hour cache before the 5-minute cache — the same order as putting the unchanging system prompt and tool definitions first.
To confirm caching is working, look at cache_read_input_tokens (reads) and cache_creation_input_tokens (writes) in the response's usage. If reads stay at zero, the prefix is changing somewhere on every request or hasn't reached the minimum token count.
5. Context management — /compact and splitting
Use Claude Code or Cursor for a while, and mid-way through a long conversation you'll find you're resending a large amount of past conversation every turn. It's not the output that swells — it's the input (= past conversation).
Tactic 1: actively use /compact
Claude Code has a /compact command. It summarizes the conversation so far to free up context (Claude Code Docs, "Commands"), and you can pass instructions on what the summary should keep. Use it at natural breaks in the work.
Tactic 2: split sessions per task
Don't do "implement Feature A," "fix Bug B," and "generate Doc C" in one long conversation — start fresh sessions. Close the session when each task wraps. If you need long-term memory, write it out to a memory file.
Tactic 3: trim noise with Hooks
Claude Agent SDK / Claude Code provide Hooks, which let you transform tool output before it reaches the AI. Example: compress a long npm install log down to just "success/failure" via a Hook. The longer the log, the lighter every turn's input becomes.
6. Model selection — task-based routing
"Always Opus" is a millionaire's strategy. Routine work like classification and extraction is often fine on Sonnet or Haiku. Price is set by the model's tier (upper, middle, lightweight); official prices as of September 26, 2026 (per million tokens) are below. Across versions, the relationship — higher tiers cost more, and the lightweight tier costs a fraction of the upper one — has not changed.
| Model | Input | Output | Best at |
|---|---|---|---|
| Claude Opus 5.5 (upper) | $4 | $20 | Complex design, reasoning, long autonomous tasks |
| Claude Sonnet 5 (middle) | $2 | $10 | Daily coding, analysis, summarization |
| Claude Haiku 4.5 (lightweight) | $1 | $5 | Classification, extraction, short conversion, real-time response |
| GPT-6 Sol (OpenAI's balanced model) | $2 | $10 | Complex coding and agentic work |
| GPT-6 Luna (OpenAI's low-cost model) | $0.10 | $0.50 | Focused, high-volume light work |
Sources: Claude Platform Docs, "Pricing" and OpenAI API Pricing (checked September 26, 2026; OpenAI short-context prices). Above these sit Anthropic's Fable 5.1 ($10 / $50) and OpenAI's flagship GPT-6 Astra ($10 / $50). Each vendor's current models are in the list of current models and knowledge cutoffs.
Switching from the upper-tier Opus to the lightweight Haiku cuts the per-token price to a quarter (as of September 2026). For a classification job that uses 2 million input and 200,000 output tokens a day, the official prices give:
- Opus 5.5: 2 × $4 + 0.2 × $20 = $12
- Sonnet 5: 2 × $2 + 0.2 × $10 = $6
- Haiku 4.5: 2 × $1 + 0.2 × $5 = $3
- Haiku 4.5 through batch: $3 × 0.5 = $1.50 (chapter 8)
Whether the quality holds up depends on the job, so compare results on the same input before switching to a cheaper model (FAQ Q4). Rules of thumb:
- Use Opus for: complex refactors, designs spanning many files, deep reasoning, exploring an unfamiliar domain
- Use Sonnet for: daily coding, analysis, summarization, review, adding tests
- Use Haiku for: classification, extraction, format conversion, real-time suggestions, generating commit messages
7. Managing your output budget
Output tokens cost 5x as much as input — true of the current Claude models and of GPT-6 Astra, Sol and Luna alike. A response on Opus 5.5 with 2,000 input and 1,000 output tokens costs $0.008 + $0.020 = $0.028. Cap the output at 500 tokens and it's $0.018, about 36% less (calculated from the official prices).
Three approaches
- Size
max_tokensto the job: in Anthropic's Messages API,max_tokensis a required parameter, and the number you put there is the ceiling on output (API reference, "Messages"). Don't leave a large value in place; set one that fits the use, such asmax_tokens: 1000. - Add "answer briefly" or "five bullets" to your prompt: the AI listens. Suppress redundant intros, summaries, and signoffs.
- Structured output (JSON mode): JSON is shorter than prose. If your app consumes the result, this is the way.
For situations where you don't need a "long, beautiful answer" (classification, extraction, decisions), cutting hard ends up more cost-efficient.
8. Batch processing — half price for work that can wait
Work that doesn't need an answer right away — overnight bulk classification, mass summarization, evaluation runs — costs half, on both input and output, through a Batch API. Anthropic's Message Batches API accepts up to 100,000 requests per batch; most finish within an hour, but a batch can take up to 24 hours (Claude Platform Docs, "Batch processing"). OpenAI's Batch API is also 50% off, with a 24-hour completion window (OpenAI, "Batch API").
According to Anthropic's pricing page, the cache multipliers stack with the batch discount. A cache read on Haiku 4.5 inside a batch, for example, works out to $1 × 0.1 × 0.5 = $0.05 per million tokens.
9. The multi-agent trap — 15x tokens
The 2026 trend, multi-agent setups (orchestrator + parallel sub-agents), is powerful, but Anthropic has published data from its own Research feature: agents use about 4x the tokens of ordinary chat, and multi-agent systems about 15x (Anthropic, "How we built our multi-agent research system", June 2025). The 15x is measured against chat, not against a single agent.
Decision criteria for savings
- Clear, sequential tasks (single-file edit, summarization, code review) → single agent suffices
- Parallelism that meaningfully reduces wall-clock time → multi-agent is justified
- "Multi-agent by default" is economically wrong. Start with a single agent and split only the bottlenecks you can actually see.
Details: see What is a multi-agent?
10. Monitoring and billing alerts
To keep a usage-based bill from surprising you, routine monitoring + alerts are essential.
API users
- Check daily token consumption in the Claude Console / OpenAI Dashboard
- Set a usage limit: stop when you exceed $200/month, for example. No limit = danger.
- Billing alerts: email at $50, Slack at $100 — staged thresholds.
Claude Code users
- Use
/usageto check the current session's cost and your plan usage (/costis now an alias for/usage) - Make checking
/usageat the end of each day a habit
Org administrators
- Per-user usage reports (Anthropic Team / Enterprise admin console)
- Anomaly detection (flag people using far more than usual)
- Quarterly company-wide share-out of "wasteful patterns"
11. Seven common wasteful patterns
| Pattern | What's wrong | Fix |
|---|---|---|
| Re-attaching all files every turn | Cache doesn't kick in; input balloons | Put unchanging docs in the prefix and cache them |
| Asking the same question in both ChatGPT and Claude | Paying twice for the same input on separate plans | Pick one |
Continuing a long conversation without /compact | Full history sent every turn | /compact at natural breaks |
| Using Opus for simple classification or extraction | Paying 4x what Haiku costs for the same result | Match model to task |
| Repeating "more polished" / "a bit longer" | Output tokens stack up | State the desired length up front |
| Defining many unnecessary tools | Tool definitions ride in the context | Define only what you'll use |
| Reaching for multi-agent casually | About 15x the tokens of chat (a single agent is about 4x) | Only when you have a clear need |
Summary
- The three levers of AI cost optimization: prompt caching, model selection, output budget. Each one's effect is set by official multipliers, and the multipliers compound.
- Cache reads = 0.1x input (0.05x on Opus 5.5). The 5-minute cache pays off after one read, the 1-hour cache after two. A 100,000-token prefix sent ten times to Opus 5.5 goes from $4.00 to $0.68.
- Model choice: Opus 5.5 to Haiku 4.5 cuts the per-token price to a quarter; Sonnet 5 to half (as of September 2026).
- Output budget: output costs 5x input. Set
max_tokensexplicitly and ask for "brief." - Batch processing: work that can wait costs half on both input and output, and stacks with the cache discount.
- Context management:
/compactat natural breaks, split per task, compress output with Hooks. - Multi-agent trap: about 15x the tokens of chat. Use only with a clear need.
- Monitoring: usage limits, billing alerts, and a
/usagecheck should all be habits.
FAQ
Q1. I use Claude Code daily — is Pro at $20 or Max the better deal?
If you keep hitting Pro's limits, consider Max. Anthropic's help center tells Pro users who consistently hit limits and need more capacity for larger repositories to consider upgrading to Max 5x (Claude Help Center, "Using Claude Code with your Pro or Max plan"). If you don't hit the limits, stay on Pro.
Q2. Do I need special configuration to use prompt caching?
On Anthropic's API you have to specify cache_control — either once at the top level of the request (automatic caching) or on individual blocks (explicit breakpoints). On OpenAI it's on by default for supported models. Claude Code uses caching automatically. See Anthropic's official docs for details.
Q3. ChatGPT vs. Claude — which is more cost-efficient?
Depends on the use case. On unit price alone, the mid-tier Claude Sonnet 5 and GPT-6 Sol are level at $2 input and $10 output. For short Q&A and high-volume routine work, OpenAI's low-cost model (GPT-6 Luna as of September 2026, $0.10 input) costs a tenth of Haiku 4.5 ($1 input). For long jobs that resend the same prefix, cache reads matter, which puts Opus 5.5 (0.05x) in contention too. "Subscribe to both and pick the right tool" is also practical.
Q4. How do I judge "Haiku is enough"?
Run a three-step experiment. (1) Get it working on Opus. (2) Send the same prompt to Sonnet and compare quality. (3) If Sonnet looks comparable, try Haiku too. The more routine the task, the smaller the gap tends to be. Reserve Opus for cases that genuinely need deep judgment or reasoning.
Q5. Should individual users hit the API directly?
It depends. If most of your work is interactive coding, the Max plan keeps the bill flat and is easier. For embedding AI in your own app, batch processing, or automation, you need the API directly. Plenty of people do both.
Q6. What threshold should I set for billing alerts?
There's no single right answer, but one way to stage it is a first alert at 1.5x your typical monthly spend and a stop at 3x. If you usually spend $30/month, alert at $50 and stop at $100. Early on, set small daily alerts to get a feel for your usage, then loosen them.
Q7. We were told "the company AI budget has gotten too big." What should we do first?
Three things in order. (1) Look at per-user usage and see where consumption concentrates. (2) Talk to the heaviest users about their workflow and identify wasteful patterns. (3) Distribute an internal guide on "caching, model selection, output budget" company-wide and report monthly on progress.
Corrections to the earlier version
On September 26, 2026, we corrected the following.
| Earlier version | Now |
|---|---|
| Three levers compress cost to 20-30% of unoptimized (title, opening, image) | Removed because we could not cite a source. Replaced with examples calculated from official prices and multipliers. |
| -60 to 90% from caching, -50 to 80% from model choice, -30 to 60% from output budget, $30K/month down to $6-9K | Same as above. Replaced with worked examples such as "a 100,000-token prefix sent ten times: $4.00 → $0.68." |
| Eight out of ten jobs are fine on a cheaper model | Removed; no source. |
| The 5-minute cache breaks even after two reads | It pays off after one read (write 1.25 + read 0.1 = 1.35 < 2). |
| The 1-hour cache breaks even after five reads | It pays off after two reads (2 + 0.2 = 2.2 < 3). |
| Output tokens cost 5-6x more than input | 5x (every current Claude model and all three GPT-6 models). |
| A cache hit rate under 60% leaves room to optimize; aim for 80%+ in production | Removed; no source. Replaced with checking the read and write token counts in usage. |
/compact shrinks 200k tokens to 5,000 | Figures removed; no source. |