Claude Code: Max Subscription or API Key, Which Costs Less

By Updated

How does a Claude Code subscription differ from API billing?

A Claude subscription (Pro, Max, Ultra) includes Claude Code at a fixed price, within usage limits shared with Claude chat. With an API key, every token is billed at list price and subscription limits don't apply. If ANTHROPIC_API_KEY is set and approved, Claude Code uses it instead of the subscription (Anthropic documentation, November 29, 2026).

TL;DR

  • -To find the break-even point, divide the plan price by the API equivalent of an active day. With 20 working days a month, Pro ($20) pays off from $1 a day, Max ($100) from $5, and Ultra ($200) from $10, if the plan's limits are enough.
  • -By the author's logs, the API equivalent for August-October 2026 was $3,054, $861, and $1,606, and for November 1-28 $587: from 5.9 to 30.5 times the price of Max. Together that's $6,108 against $400 for four months of Max. This is the list price of the tokens, not the bill the API would have produced.
  • -The daily mean and median differ by up to 4.7 times (November: $48.9 and $10.5). A few heavy days make the month, so don't calculate from a single day.
  • -The monthly API credits on Max ($100) and Ultra ($200) don't work in interactive Claude Code. They cover the API, the Agent SDK, and claude -p with a key from the linked Console organization, and they expire at the end of the billing cycle.
  • -Occasional work worth less than $20 a month is cheaper through the API, daily interactive work is cheaper on a subscription, and team CI and products for other people need an API key.

A Claude subscription includes Claude Code at a fixed price within limits; an API key bills every token. For daily interactive work the subscription is cheaper: with 20 working days a month, Pro at $20 pays off from $1 of list-price tokens a day, Max at $100 from $5, and Ultra at $200 from $10. The API is cheaper if you do less than $20 of work a month, and you need it where a subscription doesn’t fit: team CI, services for other people.

WorkloadStart withWhen to change
Occasional, a few sessions a monthAPI key with a spend limitMonthly spend reaches $20: Pro
About an hour a dayPro, $20You buy more than $80 of usage credits a month: Max
All day, long sessionsMax, $100You buy more than $100 a month or the pauses get in the way: Ultra
CI, scripts, automationConsole API key with its own budgetPersonal script on Max or Ultra: monthly API credits first
Product or agent for other peopleAPI key or cloud provider onlySubscription terms don’t allow it

This article shows how those thresholds were derived: the author’s usage for August-November 2026, the formula, the caveats, and a script that does the same calculation on your logs. Prices and rules follow Anthropic’s documentation as of November 29, 2026, before tax.

What Pro, Max, and Ultra include

Data from the pricing page and the Help Center (Max, Ultra).

PlanPrice per monthLimits relative to ProFableAPI credits per month
Pro$20 ($17 billed annually)1x, per 5 hours and per weekusage credits onlynone
Max$1005x every 5 hours and every weekup to half the weekly limit$100
Ultra$20010x per week, no 5-hour limit for verified accountsup to half the weekly limit$200

The free plan doesn’t include Claude Code. Limits are shared: chat, desktop, and Claude Code draw from one pool. Anthropic doesn’t publish them in tokens or dollars, and the pricing page says outright that there’s “no fixed message count”. So the math below answers “does the price pay off?”. Only your own work on the plan answers “are the limits enough?”.

Team and Enterprise aren’t covered here.

The measurement: four months of usage

The author counted local Claude Code transcripts on November 29, 2026. Each model response is multiplied by the API list price of the model that answered, including cache writes and reads. Duplicate records are removed. April-July is discarded because the logs for those months are incomplete. Completeness for August-November was checked against the desktop app’s session metadata. August, September, and October are full months; November covers the 1st through the 28th inclusive.

API equivalent here means the list price of the tokens used. An active day is a day with at least one model response.

Month, 2026API equivalentActive daysMean per dayMedian per dayMax per day5-hour limit hits
August$3,05424$127.3$62.2$4991
September$86121$41.0$31.6$2431
October$1,60627$59.5$16.9$2714
November (1-28)$58712$48.9$10.5$2210

The mean is the API equivalent divided by the number of active days; the median and maximum come from the measurement. They describe different things. In November the mean is 4.7 times the median: half the days cost no more than $10.5, while one day cost $221, or 37.6% of the total. The gap is 3.5 times in October, 2.0 in August, and 1.3 in September. In all four months, the most expensive day alone exceeded the price of Ultra.

All four months were on Max (5x); the logs don’t record the plan. They contain no weekly limit messages. Limit hits were counted from session limit messages, unique by day and reset time.

Cache reads made up more than half of the total: from 50.3% in November to 59.6% in August. One-hour cache writes took 20.6-31.1%, output 7.8-16.5%, and plain input was near zero. How cache writes and reads work is covered in prompt caching.

The break-even point

Notation: P is the plan price per month, C is the month’s API equivalent, N is the number of active days. You need two values:

multiple            K = C / P
days to pay off     D = P / (C / N)

The multiple from the measured data:

Month, 2026CC / Pro $20C / Max $100C / Ultra $200Days to pay off Max: by mean / by median
August$3,054152.730.515.30.8 / 1.6
September$86143.18.64.32.4 / 3.2
October$1,60680.316.18.01.7 / 5.9
November (1-28)$58729.45.92.92.0 / 9.5

The Pro column is arithmetic only: nothing shows that Pro’s limits would have been enough for that volume. “By median” means the median replaces the mean in the denominator, as if every day were ordinary.

Here’s a check without the heavy days: let every active day cost exactly the median. August gives 24 × 62.2 = $1,493, September 21 × 31.6 = $664, October 27 × 16.9 = $456, November 12 × 10.5 = $126. On those numbers Max is cheaper than list price in all four months, but in November the tokens cost only 1.26 times the plan, and Ultra already loses. Without the peaks, a light month leaves little margin, and the multiple of 5.9 doesn’t show that.

Model prices need a correction too. Most of the August and September total came from the previous Opus 5 ($5/$25, cache reads $0.50 per million tokens); Opus 5.5 is cheaper ($4/$20, reads $0.20). Repricing all August tokens at Opus 5.5 gives about $1,590, and September about $505. The Max multiple falls from 30.5 to 15.9 and from 8.6 to 5.1. The repricing is hypothetical: a different model would have used a different number of tokens.

How many days you need

The same formula for different day costs:

Cost of an active dayPro, $20Max, $100Ultra, $200
$36.7 days33.3 days, won’t pay off in a month66.7 days, won’t pay off
$10.5 (author’s November median)1.99.519.0
$13 (Anthropic’s average estimate)1.57.715.4
$300.73.36.7

The $13 row comes from the documentation: across enterprise deployments, average spend is about $13 per developer per active day and $150-250 per month, with 90% of users below $30 a day. Those deployments pay by the token and the estimate is undated, so treat it as a reference point for a personal subscription.

Why the API equivalent isn’t your API bill

The phrase “the API would have cost $587” would be wrong, for two reasons.

You’d run sessions differently. At a fixed price, it’s convenient to keep a long conversation going with MCP servers and subagents. If you paid by the token, sessions would be shorter. The logs can’t tell how many fewer tokens that would be.

The cache lives for a different time. On a subscription within the limit, Claude Code requests a one-hour TTL for the main conversation; with an API key and on usage credits it requests five minutes (documentation). A five-minute write costs 1.25 times the input price instead of 2, but after a pause longer than five minutes the prefix is written again. One bound can be computed: if every one-hour write were priced at the five-minute rate and not a single extra rewrite happened, the total would be C − 0.375 × W, where W is the cost of one-hour writes. That gives $2,698, $767, $1,421, and $542, or 7.7-11.7% less. Extra rewrites after pauses eat into that saving, and the sign of the final difference is unknown.

The author’s plan was Max (5x, $100) all four months; the logs don’t record it. The API equivalent adds up to $3,054 + $861 + $1,606 + $587 = $6,108, four months of Max cost $400, and the ratio is 15.3. This is the ratio of token list price to plan price. You can’t call it a $5,708 saving, for the two reasons above. The logs don’t show whether usage credits were bought in those months, and the measurement doesn’t separate such requests: if they were, the author paid more than $400.

A few more limits: this is one developer in the desktop app and the VS Code extension; claude.ai chats, cloud sessions, and web search aren’t counted; Sonnet 5.5 cache reads cost twice as much before October 7, a correction of at most $11 for October.

What remains after the caveats: for Max to lose to per-token billing in November, the real bill would have to be below 17% of the API equivalent, and in September below 11.6%. The author would have had to spend roughly six to nine times fewer tokens on the same work.

A rule by workload

Work out the API equivalent of your usual month, then compare it with the plan price.

Occasional. The API wins if days × cost per day is below $20. At $13 a day, that’s one active day ($13); two days already cost $26, and Pro is cheaper. A key also charges nothing in an empty month, and the Console lets you set a spend limit.

About an hour a day. With 20 working days, Pro pays off from $1 a day, and on price it wins for almost any noticeable workload. Its limits are the constraint. Start with Pro, turn on usage credits with a cap, and watch the extra charge. Max costs $80 more than Pro: if credits run higher than that, Max is cheaper, provided its 5x allowance covers the overrun. Fable on Pro works only with usage credits, which is a separate reason to move to Max.

All day. Max pays off from $5 a day. Moving to Ultra makes sense when extra charges on Max exceed $100 a month or when 5-hour window pauses interrupt your work. Ultra’s weekly multiplier is twice that of Max (10x and 5x). As a reference point for Max limits, the measurement shows that at an API equivalent of $3,054, $861, $1,606, and $587 a month, the 5-hour limit triggered 1, 1, 4, and 0 times, with no weekly limit messages. Most hits didn’t fall in the most expensive month, so the monthly total doesn’t predict them: the window depends on what you did in those five hours.

CI and automation. Budget it separately: number of runs × total_cost_usd of one run. For a shared secret, the GitHub Action documentation recommends a Console API key, because an OAuth token is tied to one person’s subscription. A key has two more advantages: a nightly run doesn’t consume the limit you need in the morning, and --bare mode, recommended for scripted calls that don’t need hooks, doesn’t read the subscription sign-in at all.

Mixed. If you already pay for the API, monthly credits lower the plan’s price. The effective price of Max is $100 minus the spend the credits cover, up to $100. With $60 of such spend a month, Max costs you $40. Without API projects the credits give you nothing: they expire.

What gets charged where

Claude Code uses the first credentials it finds. The order, shortened: cloud provider, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_API_KEY, apiKeyHelper, CLAUDE_CODE_OAUTH_TOKEN, Anthropic profiles, subscription sign-in through /login. The subscription comes last. In interactive mode you’re asked about a found key once and your answer is remembered; in -p mode the key is always used.

# is a key set (the value isn't printed)
echo "${ANTHROPIC_API_KEY:+key is set}"
# return to the subscription in this shell
unset ANTHROPIC_API_KEY

After that, /status inside a session shows the active sign-in method. Signing in itself is covered in how to install Claude Code.

How it runsWhat it draws on
Interactive Claude Code, subscription sign-inPlan limits, then usage credits if enabled
claude -p or Agent SDK, subscription sign-inPlan limits
claude -p or Agent SDK with a key from the organization linked to Max or UltraMonthly API credits, then purchased ones
GitHub Action with an OAuth tokenPlan limits of the token’s owner
GitHub Action with an API key, plus runs from an IDE extension and desktop with a keyPer-token billing, monthly credits don’t cover it
Interactive Claude Code with an API keyPer-token billing

Sources: Help Center on the Agent SDK and monthly credits. The rules have changed: on June 15, 2026, Anthropic paused its announced Agent SDK changes, and the October 7 entry confirms the current rules. Reread those pages before you set up automation.

”$100 a month in API credits” on Max

The line “$100 a month in API credits” on the Max card reads like a budget for Claude Code, but these are Claude Platform credits for your own apps. You have to claim them: Settings > Billing, the API credits section, link a Console organization. New subscribers can claim them after seven days on the plan. You can’t change the organization yourself later, and the unused balance expires at the end of the cycle. Pro has no such credits.

If an organization has only these credits and they don’t cover a request, Claude Code answers Credit balance too low.

Usage credits after the limit

Usage credits are a separate charge on top of the plan at standard API prices. Turn them on in Settings > Usage and set the monthly spend limit there. Under the rules on the snapshot date, purchases are generally non-refundable, and credits bought on or after December 7, 2026 generally expire after 12 months. Factor this into the comparison: on credits, the main conversation switches to the five-minute cache; the promptCacheTtl setting brings back one hour.

How to calculate your own usage

The /usage command in a session shows plan limit bars, a breakdown for 24 hours and 7 days (keys d and w), and a Session block that estimates the session at list prices. /cost and /stats are its aliases. The Session block is meant for API billing: for a subscriber it’s the API equivalent of one session and doesn’t go on the bill. The breakdown is built from this machine’s history; other devices and chat aren’t included.

For a monthly total, you need to count the transcripts. The script uses only the Python standard library, sends nothing anywhere, and prints aggregates only:

import collections, json, pathlib, statistics
# $ per 1M tokens on 2026-11-29: input, cache read, output (longer names before shorter ones)
P = {"fable-5-2": (8, .2, 40), "fable-5-1": (10, .25, 50), "fable-5": (10, 1, 50), "opus-5-5": (4, .2, 20),
     "opus-5": (5, .5, 25), "opus-4-8": (5, .5, 25), "sonnet-5-5": (2, .1, 10), "sonnet-5": (2, .2, 10)}
best, days, nop = {}, collections.Counter(), collections.Counter()
for f in (pathlib.Path.home() / ".claude/projects").rglob("*.jsonl"):
    for line in f.open(errors="replace"):
        try: o = json.loads(line)
        except ValueError: continue
        m = o.get("message") if isinstance(o, dict) and o.get("type") == "assistant" else None
        if not isinstance(m, dict) or not m.get("usage") or m.get("model") == "<synthetic>": continue
        u = collections.defaultdict(int, {k: v for k, v in m["usage"].items() if isinstance(v, int)})
        u["w1h"] = (m["usage"].get("cache_creation") or {}).get("ephemeral_1h_input_tokens") or 0
        key = (m.get("id"), o.get("requestId"))
        if key not in best or u["output_tokens"] > best[key][2]["output_tokens"]:
            best[key] = (o["timestamp"][:10], m.get("model") or "", u)
for day, model, u in best.values():
    i, r, out = P.get(next((k for k in P if model.startswith("claude-" + k)), None), (0, 0, 0))
    nop[model] += not i
    inp = u["input_tokens"] + 1.25 * (u["cache_creation_input_tokens"] - u["w1h"]) + 2 * u["w1h"]
    days[day] += (inp * i + u["cache_read_input_tokens"] * r + u["output_tokens"] * out) / 1e6
for mon in sorted({d[:7] for d in days}):
    v = [c for d, c in days.items() if d[:7] == mon]
    print(f"{mon} ${sum(v):.0f}, days {len(v)}, mean {sum(v)/len(v):.1f}, median {statistics.median(v):.1f}, max {max(v):.0f}")
print("no price, responses:", {k: n for k, n in nop.items() if n})

The cache formula inside: a 5-minute write costs 1.25 times the input price, a one-hour write 2. The author ran the script on November 29 with the same filter as the measurement (desktop and VS Code only): August, September, and October matched the table. November in the table is cut at the 28th, while the script counts through the last record. Without the filter, the total also includes other runs: terminal, claude -p, SDK.

What to look at in the result:

  • Terminal Claude Code transcripts are deleted after 30 days by default (documentation). To collect a full month, raise cleanupPeriodDays in advance.
  • The last line names models with no price in the dictionary. Their tokens count as $0, but their days count as active and lower the median, so add the price from the price list. Haiku 5.5 is left out on purpose: it has two prices depending on prompt size.
  • Days are counted in UTC; prices are current, not as of the response date.
  • Compare the median and the mean. If they differ several times over, use three months instead of one.

For programmatic runs it’s simpler: claude -p "..." --output-format json returns a total_cost_usd field, and --max-budget-usd stops the run based on estimated spend. With key billing, check the total on the Cost page in the Console.

What lowers usage under either billing

On a subscription, lower usage pushes the limit further away; with a key, it shrinks the bill. More than half of the author’s cost came from cache reads, meaning the accumulated context being sent again. Hence the obvious habit: new task, new session. The second lever is the model: Sonnet 5.5 input and output cost half as much as Opus 5.5 ($2/$10 against $4/$20), see Opus vs Sonnet. Subagents cost the author $221 and $220 of API equivalent in October and November; the subagent measurements show when they pay off. For budgets and routing in your own LLM products, see LLM cost optimization.

Where to start

  1. Check /status and the ANTHROPIC_API_KEY variable: you may already be paying the wrong way.
  2. Run the script and write down the month’s API equivalent and the mean and median per active day.
  3. Calculate D = P / (C / N) for Pro and Max. If D is larger than your number of active days, the plan doesn’t pay off.
  4. Choose the cheapest plan that pays off and turn on usage credits with a cap. Extra charges above $80 on Pro or $100 on Max mean it’s time to move up.
  5. Put automation on a separate key with a spend limit in the Console.
  6. Recalculate in a month: model prices and plan rules changed during the four months described here.

Frequently Asked Questions

Can I spend Max monthly API credits in Claude Code?
Not in interactive Claude Code: not in the terminal, IDE, desktop, or web. The credits cover claude -p and the Agent SDK when you run them yourself with an API key from the Console organization linked to your plan. Runs started by the Claude Code GitHub Action, an IDE extension, or the desktop app aren't covered (Anthropic Help Center, November 29, 2026).
Why is Claude Code charging the API when I pay for Max?
Check whether ANTHROPIC_API_KEY is set in your environment. It ranks above the subscription sign-in in the credential order, and in -p mode it's always used. The /status command shows the active sign-in method; unset ANTHROPIC_API_KEY returns the current shell to the subscription.
How much does Claude Code cost per month through the API?
Anthropic gives an estimate for enterprise deployments: about $13 per developer per active day on average and $150-250 per month, with 90% of users below $30 per active day. The estimate is undated and doesn't apply to personal subscriptions. Your local logs give a more reliable figure for you.
What happens when the subscription limit runs out?
You can wait for the reset, move to a higher plan, sign in through the Console, or turn on usage credits: requests continue at standard API prices as a separate charge. Usage credits have a monthly spend limit you set. By default, the main conversation's cache then drops from a one-hour TTL to five minutes.
How does Ultra differ from the old Max 20x?
According to Anthropic's Help Center, Max 20x is now called Ultra, and subscribers were moved automatically with no change to the $200 monthly price. Ultra gives 10x Pro per week, and verified accounts have no 5-hour limit. Max gives 5x Pro every five hours and every week.
Can I use a Claude subscription in CI or in my own product?
In your own CI, yes: the GitHub Action accepts a subscription OAuth token, and runs draw on its limits. The token is tied to the person who ran claude setup-token, so for a shared secret the documentation recommends a Console API key. You can't use a subscription in products for other people: Anthropic prohibits routing users' requests through plan credentials.