# Claude Code: API key or subscription?

> Pro and Max are flat-priced with 5-hour and weekly limits; an API key bills every token with no plan limits. How to compare with your own numbers.

Source: https://shuriken.sh/guides/claude-code-api-vs-subscription

Pro and Max are flat-priced with 5-hour and weekly limits; an API key bills every token with no plan limits. How to compare with your own numbers.

By Shuriken Updated 27 October 2026 6 min read

**Contents**

Short answer: Pro costs $20 a month and Max $100 or $200, each with a 5-hour and a weekly limit. An API key for Claude Code has neither limit and bills every token, at $4 in and $20 out per million on Opus 5.5. If you use Claude Code most days, a subscription usually costs less. To check, price one normal week of your own usage at API rates.

## What each option costs (October 2026) #

All prices in US dollars, from [claude.com/pricing](https://claude.com/pricing) and Anthropic's [API pricing](https://platform.claude.com/docs/en/about-claude/pricing), read on 2026-10-22. Subscriptions include Claude Code, and its usage counts against the same limits as Claude chat:

| Plan | Price | Usage |
| --- | --- | --- |
| Pro | $20 a month, or $17 a month billed yearly | Baseline, with a 5-hour and a weekly limit |
| Max 5x | $100 a month | 5x Pro per session, plus a weekly limit |
| Max 20x | $200 a month | 20x Pro per session, plus a weekly limit |

The API is priced per million tokens (MTok):

| Model | Input | Output | Cache hits |
| --- | --- | --- | --- |
| Claude Opus 5.5 | $4 | $20 | $0.20 |
| Claude Sonnet 5.5 | $2 | $10 | $0.10 |
| Claude Haiku 5.5 (prompts up to 100K tokens) | $0.10 | $0.50 | $0.01 |

Multiplying tokens by the input price overshoots. Claude Code leans hard on prompt caching, so in a long session most of the input is billed at the cache-hit rate: $0.20 per MTok on Opus 5.5, not $4.

## What you get with each #

A subscription is a flat bill with two limits: a session limit that resets every five hours, and a weekly limit. When you hit one, Anthropic's [help page](https://support.claude.com/en/articles/11145838-use-claude-code-with-your-pro-or-max-plan) gives four options:

- Wait for the reset.
- Turn on usage credits, pay as you go on top of the plan.
- Switch to a Claude Console account with API credits.
- Upgrade.

An API key has no 5-hour or weekly window. You pay for every token, and the only ceilings are per-minute rate limits and whatever spend limit you set on your Console workspace. Nothing stops you at 3pm; nothing stops the bill either.

If ANTHROPIC_API_KEY is set in your environment, Claude Code uses that key and bills the API, even if you pay for Max. Anthropic's help page says so in as many words. An odd Console bill usually starts there: [the fix for Claude Code using your API key instead of your plan](https://shuriken.sh/guides/claude-code-using-api-key-instead-of-subscription) begins with /status. If the key's organisation has no credits, you get a [Credit balance is too low error](https://shuriken.sh/guides/claude-code-credit-balance-too-low) instead, while your plan sits unused.

Anthropic's [legal and compliance page](https://code.claude.com/docs/en/legal-and-compliance) also says developers building products or services on Claude, including with the Agent SDK, should use API key authentication. Subscription sign-ins are for your own ordinary use. The same page decides whether a Pro or Max sign-in may be used in OpenCode, Cline or another tool ([what it allows, quoted](https://shuriken.sh/guides/claude-subscription-in-other-tools)).

## How to estimate your API cost #

You want one number: what would a normal month of my Claude Code cost at API rates? Three ways to get it, from free to easiest.

### 1. Use Anthropic's averages as a sanity check #

Anthropic's [cost docs](https://code.claude.com/docs/en/costs) put Claude Code at around $13 per developer per active day and $150 to $250 per developer per month across enterprise deployments, and 90% of users stay under $30 per active day. Those are many people's numbers, not a prediction for you. They tell you which part of the chart below to look at.

### 2. Measure a week #

Run a normal week on a Claude Console key with a workspace spend limit, then read the Console's usage page. It's the most accurate method because it's your real bill. In Claude Code, /usage also shows a session's token counts and a cost figure computed at list price; Anthropic notes that for subscribers that figure isn't a bill.

By hand, one turn on Sonnet 5.5 with made-up but typical proportions comes to 17 cents:

| Part of the turn | Tokens | Price per MTok | Cost |
| --- | --- | --- | --- |
| Context read from cache | 200,000 | $0.10 | $0.020 |
| Fresh input | 50,000 | $2 | $0.100 |
| Output | 5,000 | $10 | $0.050 |
| Turn total | | | $0.17 |

The token counts are an illustration, not a measurement. They leave out cache writes, which cost a little above the input price, to keep the sum readable. Multiply your own per-turn cost by turns per day and active days per month, or let our [Claude plan vs API calculator](https://shuriken.sh/tools/claude-plan-vs-api-calculator) do it for Opus 5.5, Sonnet 5.5 and Haiku 5.5.

### 3. Let a tool add it up #

In Shuriken, the [Analytics page](https://shuriken.sh/features/fuel) prices your Claude Code and Codex turns at API list prices, by day, source, project and model, across every computer you've linked. On a subscription that figure isn't a bill, and that what-if is the number this page is after. Shuriken 5.1 adds live cost: every chat shows what its turn costs while it runs, for Claude Code, Codex and other agents that report usage as they go.

Shuriken shows what every plan you hold has left in one figure, and what each turn costs as it runs.

[Download](https://shuriken.sh/download)

## Where the lines cross #

The chart draws the prices above and nothing else. The API line rises a dollar for every dollar of tokens. Pro, Max 5x and Max 20x stay flat at $20, $100 and $200 until their limits stop you, and Anthropic doesn't publish those limits in dollars, so we can't draw where each flat line ends.

Plan against key, it shows:

- Under about $20 a month of usage, an API key is cheaper than Pro.
- Above $20, Pro beats the key, if Pro's limits hold up for how you work.
- Above $100 or $200, Max 5x or Max 20x beats the key too, again only if your work fits inside their limits.
- Anthropic's own average, $150 to $250 a month, sits where Max starts to pay for itself.

## Which one to pick #

- A few sessions a week: an API key or Pro. Pay-as-you-go wins if you'd use less than $20 of tokens.
- Most days: Pro, then Max once the 5-hour limit is a daily event. Our [Pro vs Max guide](https://shuriken.sh/guides/claude-pro-vs-max-for-claude-code) lists the signs.
- All day, with parallel agents: Max, plus a plan for what happens when it runs out.
- Scripts, CI, or a product other people use: an API key, per Anthropic's rules above.

## Mixing both: subscription first, key as a capped fallback #

For heavy use we'd put the subscription first and keep a key behind it. The plan carries the flat-rate work and the key covers the gaps.

By hand, in a terminal:

- Stay signed in with your subscription.
- When you hit a limit, set ANTHROPIC_API_KEY for that terminal only and carry on.
- When the window resets, unset ANTHROPIC_API_KEY and run /login.
- Put a spend limit on the Console workspace, so a forgotten variable can't run all weekend.

Or skip the key and turn on Anthropic's usage credits, with a monthly spend limit on the plan itself.

In Shuriken, add the key as a source and turn on Switch to API keys under Sources › Switch settings (it's off by default). Keys then take chats only once every subscription is out, and you can add several. A spend cap per fallback run, on by default at $25, stops the run ("Past this, chats wait for a subscription"). It counts everything the run spends with that provider, across all your keys, not per key. Chats go back to a subscription as soon as one has room, and the next run starts from a fresh cap. [API keys as a last resort, with a spend cap](https://shuriken.sh/blog/api-keys-last-resort) has the reasoning.

Either way, the provider bills your key directly. Shuriken never bills model usage, and [we explain why here](https://shuriken.sh/blog/we-dont-bill-model-usage). To see your own numbers before you choose, [download Shuriken](https://shuriken.sh/download) and watch what a week of turns would cost.

Try the free tool: [Claude limit reset tracker](https://shuriken.sh/tools/limit-resets/claude)

Share

[X](https://x.com/intent/post?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-api-vs-subscription&text=Claude%20Code%3A%20API%20key%20or%20subscription%3F)[LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-api-vs-subscription)[Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-api-vs-subscription&t=Claude%20Code%3A%20API%20key%20or%20subscription%3F)[Reddit](https://www.reddit.com/submit?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-api-vs-subscription&title=Claude%20Code%3A%20API%20key%20or%20subscription%3F)[E-mail](mailto:?subject=Claude%20Code%3A%20API%20key%20or%20subscription%3F&body=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-api-vs-subscription)

## Sources

- [Claude pricing](https://claude.com/pricing) (accessed 22 October 2026)
- [Claude API docs: Pricing](https://platform.claude.com/docs/en/about-claude/pricing) (accessed 22 October 2026)
- [Claude Help Center: What is the Max plan?](https://support.claude.com/en/articles/11049741-what-is-the-max-plan) (accessed 22 October 2026)
- [Claude Help Center: Use Claude Code with your Pro or Max plan](https://support.claude.com/en/articles/11145838-use-claude-code-with-your-pro-or-max-plan) (accessed 22 October 2026)
- [Claude Code docs: Manage costs effectively](https://code.claude.com/docs/en/costs) (accessed 22 October 2026)
- [Claude Code docs: Legal and compliance](https://code.claude.com/docs/en/legal-and-compliance) (accessed 22 October 2026)

## Frequently asked questions

**Is Claude Max cheaper than the API for Claude Code?**

If your month of Claude Code would cost more than $100 at API rates and fits inside Max 5x's limits, Max 5x is cheaper; the same goes for Max 20x above $200. Price a normal week of your own usage to know which side you're on.

**How much does Claude Code cost per day on the API?**

Anthropic's cost docs give an average of about $13 per developer per active day, $150 to $250 a month, with 90% of users under $30 per active day. Those are enterprise averages; your own use can be far above or below.

**Can I use a subscription and an API key together?**

Yes. Sign in with your subscription and keep a key for when you hit a limit. By hand you switch with /login or an environment variable; in Shuriken, turn on Switch to API keys and the key takes chats only once every subscription is out, with a $25 spend cap per fallback run by default.

**Does an API key have a 5-hour limit?**

No. The 5-hour and weekly limits belong to Pro, Max, Team and Enterprise seats. API usage is billed per token and is subject to rate limits per minute, not to usage windows.

**Why is Claude Code billing my API key when I pay for Max?**

Anthropic's help page says that if an ANTHROPIC_API_KEY environment variable is set, Claude Code uses that key and bills API usage instead of your subscription. Unset it and run /login.

Fuel

All your plans, in one fuel gauge.

Shuriken adds up what your subscriptions have left, one figure per provider and per limit, in the top bar.

[Download](https://shuriken.sh/download)

[Other platforms](https://shuriken.sh/download#main)

## Keep reading

- [Claude Code 1M context window: when it helps, what it costs: Guide 27 Oct 2026 4 min read Opus 4.7+, Sonnet 5+, Haiku 5.5 and Fable run with a 1M context in Claude Code by default. Why a huge session costs more every turn, and when /clear wins.](https://shuriken.sh/guides/claude-code-1m-context-window)
- [What Claude Code costs per developer, per month: Guide 27 Oct 2026 5 min read Claude Code cost per developer per month: Anthropic's average is $150 to $250 at API rates. How it compares with Pro, Max and Team seats, with the maths.](https://shuriken.sh/guides/claude-code-cost-per-developer)
- [Claude Max 5x vs 20x (2026): what you really get: Guide 27 Oct 2026 6 min read Claude Max 20x gives 20 times Pro's 5-hour allowance and Max 5x five. Anthropic publishes no weekly multiplier; users report 20x at 1.5 to 2 times 5x.](https://shuriken.sh/guides/claude-max-vs-max-20x)
- [Claude Team seats for Claude Code, explained: Guide 27 Oct 2026 5 min read Team Standard seats get 1.25x Pro's usage per session, Premium 6.25x, each with a 5-hour and weekly limit. Prices, Team vs Max, and a personal plan.](https://shuriken.sh/guides/claude-team-seats-for-claude-code)
- [Opus vs Sonnet for coding: which Claude model to use: Guide 27 Oct 2026 6 min read Opus vs Sonnet for coding: Sonnet 5.5 for well-scoped work, Opus 5.5 for long or open-ended jobs. Opus costs twice as much per token; judge it per task.](https://shuriken.sh/guides/opus-vs-sonnet-for-coding)
- [Prompt caching in Claude Code, explained simply: Guide 27 Oct 2026 7 min read Claude Code caches the start of every request so re-reading your chat is cheap. What is cached, how long it lasts, and what makes it go cold.](https://shuriken.sh/guides/prompt-caching-in-claude-code)

## Free tools

- [Claude limit reset tracker](https://shuriken.sh/tools/limit-resets/claude)
- [Codex limit reset tracker](https://shuriken.sh/tools/limit-resets/codex)
