Claude Code Max Plan vs API Cost: Break-Even Guide
Claude Code max plan vs api cost, decided by math. A Max 5x subscription beats an API key once you spend about $3.33/day; Max 20x breaks even at $6.67/day.
設定をやめて、構築を始めよう。
AIオーケストレーション付きSaaSビルダーテンプレート。
If you use Claude Code and want to know whether the Claude Code max plan vs api cost question favors a subscription or a raw API key, the answer is a dollar break-even. A Max 5x subscription ($100/month) beats pay-as-you-go the moment your API-equivalent spend would top about $3.33/day, and Max 20x ($200/month) breaks even around $6.67/day. Below those lines an API key is cheaper. Above them the subscription is effectively unlimited value until you hit a rate limit.
設定をやめて、構築を始めよう。
AIオーケストレーション付きSaaSビルダーテンプレート。
The short answer (break-even at a glance)
The decision rule is one inequality. Let S be your flat subscription fee and C_api be what the same work would cost at API rates.
If C_api > S → subscription is cheaper
If C_api < S → API key (pay-as-you-go) is cheaperSpread each flat fee across a 30-day month and you get a daily threshold you can sanity-check against your own habits.
| Plan | Monthly fee | Daily break-even |
|---|---|---|
| Pro | $20 | ~$0.67/day of API-equivalent usage |
| Max 5x | $100 | ~$3.33/day |
| Max 20x | $200 | ~$6.67/day |
If your measured API spend would exceed those figures most days, subscribe. If it sits below, an API key wins. Anthropic no longer publishes exact message-per-window counts, so this dollar model is the honest way to decide, not a claim about how many messages you get.
How Claude Code billing actually works
There are two billing modes, and which one you are in is decided by a single environment variable.
Subscription auth (the default)
By default, Claude Code authenticates against your Claude subscription. Interactive sessions draw on your plan's rolling-window allowance, not a dollar meter. You are not charged per token. You consume usage against a window, and when the window resets you get your allowance back.
This is the mode most people are in without thinking about it. You log in, you build, the meter you watch is "am I close to a rate limit," not "how many dollars did that cost."
API-key billing (the override)
Set an ANTHROPIC_API_KEY environment variable and everything changes. Claude Code then bills pay-as-you-go at API rates regardless of which plan you hold. The subscription is ignored.
# bill against your subscription's rolling window (default)
unset ANTHROPIC_API_KEY
# bill pay-as-you-go at API rates instead
export ANTHROPIC_API_KEY="sk-ant-..."This is the lever the whole comparison turns on. If you want the API path, you opt into it with a key. If you want the subscription path, you make sure that variable is not set.
The June 15, 2026 change (Agent SDK credit pool)
There is a wrinkle that took effect the day this post went up. As of June 15, 2026, non-interactive usage (the Agent SDK, claude -p, GitHub Actions, third-party apps) draws from a separate monthly credit pool, not your interactive 5-hour window.
The pool is $20 on Pro, $100 on Max 5x, and $200 on Max 20x. It does not roll over. When it is exhausted, usage flows to API-rate credits if you have enabled them, otherwise the requests stop. If you run a lot of headless or CI automation, budget for that pool on top of your interactive work, and read the June 2026 billing change before you wire Claude Code into a pipeline.
What you actually pay per token on the API
When you are in API-key mode, these are the rates the bill is built from. They are the per-million-token prices for the models you run inside Claude Code.
| Model | Context | Input $/MTok | Output $/MTok | Cache write (5-min) | Cache read |
|---|---|---|---|---|---|
| Opus 4.8 | 1M | $5.00 | $25.00 | ~$6.25 | ~$0.50 |
| Sonnet 4.6 | 1M | $3.00 | $15.00 | ~$3.75 | ~$0.30 |
| Haiku 4.5 | 200K | $1.00 | $5.00 | ~$1.25 | ~$0.10 |
| Fable 5 | 1M | $10.00 | $50.00 | ~$12.50 | ~$1.00 |
Two things to read from this table. Output is five times the input rate on every model, so output length, not input size, is what moves your bill. And the cache columns matter: cache writes cost 1.25x the input rate for the default 5-minute TTL, while cache reads cost about 0.1x. The cache-write and cache-read figures above are derived from those multipliers, not separately published per cell. For the full per-model breakdown, see the Claude Code pricing guide.
The break-even math (with worked examples)
The formula has one job: turn token volume into a dollar figure you can compare to your flat fee.
The formula
C_api = (input_tokens_uncached / 1e6 × input_rate)
+ (input_tokens_cache_write / 1e6 × input_rate × 1.25)
+ (input_tokens_cache_read / 1e6 × input_rate × 0.10)
+ (output_tokens / 1e6 × output_rate)Run that for a month, compare C_api to your subscription fee, and you have your answer. To make it concrete, the next two tables walk a realistic session through the math.
Cost per session, uncached
Take a "session" as 100K input tokens plus 20K output tokens, a realistic mid-size Claude Code turn carrying context. With no caching, here is the cost per session and how many sessions it takes to break even on each Max tier.
| Model | Input (100K) | Output (20K) | $/session | Sessions to hit $100 (Max 5x) | Sessions to hit $200 (Max 20x) |
|---|---|---|---|---|---|
| Haiku 4.5 | $0.10 | $0.10 | $0.20 | 500 | 1,000 |
| Sonnet 4.6 | $0.30 | $0.30 | $0.60 | ~167 | ~333 |
| Opus 4.8 | $0.50 | $0.50 | $1.00 | 100 | 200 |
| Fable 5 | $1.00 | $1.00 | $2.00 | 50 | 100 |
Read the Opus row. Doing about 100 Opus sessions a month puts you at $100 of API value, which is the Max 5x line. At 200 sessions a month you cross the Max 20x line. Heavy daily Opus users blow past both, and the subscription wins decisively.
Cost per session, with caching
That uncached table overstates real cost, because Claude Code caches aggressively. It reuses a large stable prefix (system prompt, file context) across turns, so most of your input is cache reads at about 0.1x. Take the same 100K input but assume 90K of it is a cache read and 10K is fresh, with 20K output, on Sonnet 4.6.
fresh input : 10,000 / 1e6 × $3.00 = $0.030
cache read : 90,000 / 1e6 × $3.00 × 0.10 = $0.027
output : 20,000 / 1e6 × $15.00 = $0.300
-------------------------------------------------
per turn = $0.357That is $0.357 versus $0.60 fully uncached, about a 40% cut, and almost all of it comes from cache reads on the input. The morphllm source measures an 81% cut on the input portion alone. Notice what dominates once caching is on: output, at $0.30 of a $0.357 turn. Model choice and output length matter more than input size. If you are below break-even and want to stay on an API key longer, read how prompt caching works and lean on it.
Break-even token volumes by plan and model
Putting it together, here is the monthly token volume at which the subscription beats an API key, by model, uncached. If your sessions are heavily cached, divide the input portion by roughly 10.
| Plan | Opus 4.8 | Sonnet 4.6 | Haiku 4.5 |
|---|---|---|---|
| Pro ($20) | ~2M in + 0.4M out/mo | ~3.3M in + 0.7M out | ~10M in + 2M out |
| Max 5x ($100) | ~10M in + 2M out/mo | ~17M in + 3.3M out | ~50M in + 10M out |
| Max 20x ($200) | ~20M in + 4M out/mo | ~33M in + 6.7M out | ~100M in + 20M out |
These figures are illustrative. They assume the 100K-in / 20K-out session ratio above and are derived from the verified API rates, not published caps. The honest takeaway: most daily-driver Opus users on Claude Code cross the Max 5x line within the month.
The catch: rate limits cap the subscription's value
The dollar break-even is only half the decision. A subscription is "cheaper" only up to the point where you hit a rate limit and get throttled.
All consumer plans reset usage on a roughly 5-hour rolling window, which was doubled permanently for Pro and Max on May 6, 2026. Max adds two weekly caps on top, one across all models and one for Sonnet-only, raised about 50% as a promo running through July 13, 2026. Anthropic does not publish exact numbers for any of these, so treat any specific count you see as an estimate.
Here is the trade-off in one sentence. A subscription is a flat fee with a soft ceiling (rate limits), and an API key is uncapped spend with no throttle. Heavy Opus users on long agentic runs can hit the 5-hour or weekly cap, and at that point the effective value of the subscription stops rising. If you cannot afford to be throttled mid-run, the uncapped API key is worth its higher cost. If you can absorb the occasional pause, the flat fee almost always wins on price.
So which should you pick?
Map your usage pattern to the row that fits.
| Your usage | Pick | Why |
|---|---|---|
| Light or occasional, a few sessions a week | Pro or API key | You will not cross $20/mo of API value; pay the lower of the two |
| Daily Opus driver | Max 5x | Daily Opus use crosses $3.33/day fast; flat fee beats per-token |
| All-day agentic, multiple sessions | Max 20x | You need the headroom; $6.67/day is easy to exceed at this volume |
| Spiky or unpredictable, often very low | API key | Pay exactly for what you use instead of a flat fee you may not earn back |
| Headless / CI heavy | Watch the credit pool | As of June 15, 2026, non-interactive usage bills from a separate pool |
If you are below break-even today and want to push that line further out, the fastest win is to cut your token costs with caching and tighter context, then optimize your usage against the rate-limit windows. When the cheapest-model question comes up, Haiku 4.5 at $1/$5 is the floor.
Frequently asked questions
Is the Claude Max plan worth it for Claude Code?
Yes, if your projected API-equivalent spend would exceed the flat monthly fee. Max 5x ($100/month) pays for itself once your API usage would top about $3.33/day, and Max 20x ($200/month) breaks even around $6.67/day. Below that, an API key is cheaper.
What is the difference between Max 5x and Max 20x for Claude Code?
Both are the same Claude Max plan at different usage multipliers. Max 5x costs $100/month and gives roughly five times Pro's usage allowance. Max 20x costs $200/month and gives roughly twenty times. The models and features are identical, only the rate-limit headroom changes.
Does using an API key in Claude Code override my subscription?
Yes. Setting an ANTHROPIC_API_KEY environment variable switches Claude Code to pay-as-you-go API billing and ignores your Pro or Max subscription entirely. Unset the variable to go back to billing against your subscription's rolling-window allowance.
How much does Claude Code cost per token on the API?
On the Anthropic API, Opus 4.8 costs $5 per million input tokens and $25 per million output tokens. Sonnet 4.6 is $3/$15, Haiku 4.5 is $1/$5, and Fable 5 is $10/$50. Cache reads are billed at roughly 10% of the input rate.
At what usage does the Claude subscription beat the API?
The dollar break-even is about $3.33/day of API-equivalent usage for Max 5x ($100/month) and about $6.67/day for Max 20x ($200/month). For Pro ($20/month) it is about $0.67/day. If your measured API spend would exceed those figures most days, the subscription is cheaper.
Do Claude Code Max plans have weekly limits?
Yes. Max 5x and Max 20x carry two weekly caps: one across all models and one for Sonnet-only usage. Anthropic does not publish exact numbers, and these caps were raised about 50% as a promo running through July 13, 2026. Pro has no separate weekly cap, only the rolling window.
Can I run Claude Code headlessly on my subscription?
Yes, but as of June 15, 2026 non-interactive usage (the Agent SDK, claude -p, and GitHub Actions) draws from a separate monthly credit pool rather than your interactive 5-hour window. The pool is $20 on Pro, $100 on Max 5x, and $200 on Max 20x, and it does not roll over.
Is Claude Code included in Claude Pro?
Yes. Claude Code is included in Pro ($20/month) with the lowest rate limits. The Max tiers include the same Claude Code access with five times or twenty times the usage allowance, which matters if you run Opus on long agentic sessions.
How does prompt caching change Claude Code costs?
Prompt-cache reads are billed at about 10% of the normal input rate, so a heavily-cached coding session costs a fraction of its raw token count. Because Claude Code reuses a large stable prefix across turns, most input becomes cache reads, which can cut the input portion of the bill by around 80%.
Should a solo developer pick Pro, Max 5x, or an API key for Claude Code?
Pick Pro for light or occasional use, Max 5x if you drive Opus daily, and Max 20x for all-day agentic work across multiple sessions. Choose an API key only for low or spiky volume you cannot predict, where you would rather pay exactly for what you use than a flat fee.
設定をやめて、構築を始めよう。
AIオーケストレーション付きSaaSビルダーテンプレート。
Claude Code Headless Mode: The Definitive Guide to claude -p
How to run Claude Code non-interactively with claude -p — output formats, jq parsing, stdin piping, permission flags, and when to reach for the Claude Agent SDK instead.
Claude Code Prompt Caching: The Token Discount Most People Never Turn On
Claude Code prompt caching is automatic and bills cached tokens at ~10% of normal input. Here's how to stop leaking the 90% discount, with real cost math.