Last updated · 8 min read

Plans and limits change often. Numbers here were checked on the dates listed under Sources; always confirm on the provider’s own pages.

The two ways to pay

There are two ways to pay for Claude when you use it as a coding agent:

  • A subscription with a usage allowance. You pay a fixed price each month for a Claude plan and sign in to Claude Code with that account. Claude Code is included in all paid plans4. Instead of a bill that grows, you get usage limits: an allowance that is used up as you work and refills at set times.
  • Metered API billing. You create an API key in the Claude Console and pay for every token Claude Code sends and receives. On the Claude Console, Claude Code usage is billed per token to your organization5. There is no allowance to run out of, only a bill that grows with use.

Both run the same Claude Code CLI and the same models. What changes is how cost behaves: fixed with limits, or unlimited and metered.

One detail catches people out. If the ANTHROPIC_API_KEY environment variable is set, Claude Code uses that key instead of your subscription, resulting in API usage charges rather than using your subscription’s included usage6. If you mean to use your subscription, check that variable is not set in your shell.

What you get with a subscription

These are the individual plans that include Claude Code:

  • Pro7: $201 a month billed monthly, or $178 a month on an annual subscription ($2009 billed up front).
  • Max 5x10: $10011 a month.
  • Max 20x12: $20013 a month. Anthropic notes for both Max tiers: These prices are for web subscriptions only14.

The price does not change with use; the limits do the rationing. Every plan has usage limits that reset on a rolling five-hour session window, and paid plans add weekly limits on top15. These limits are shared across Claude and Claude Code16. Plans differ in how much fits in each window: Max 5x offers five times and Max 20x offers 20 times the Pro plan’s per-session usage allowance17.

What Anthropic does not publish is the size of an allowance in tokens or messages. No message counts are published; Max allowances are described only relative to Pro’s per-session allowance18. A limit is therefore a percentage that resets, not a bill. When you reach one you wait for the reset or choose to pay more, as described in the usage windows guide.

Max also comes with $100 to $200/month in API credits to build on the Claude Platform19, but these do not pay for Claude Code: Monthly API credits included with Max plans can’t be used in Claude Code or the Claude apps, including for usage credits20.

What the API costs

On the API you pay per million tokens (MTok), at a different price for each model and for input and output. These are the list prices for the models you are most likely to pick in Claude Code:

ModelInput / MTokOutput / MTok
Claude Fable 5.1$1021$5022
Claude Opus 5.5$423$2024
Claude Sonnet 5.5$22$103
Claude Haiku 5.5$0.1025$0.5026

The Haiku prices are for shorter prompts: Prompts over 100,000 tokens pay higher prices27. Repeated context is much cheaper when it comes from the prompt cache (Claude Code caches automatically): a cache hit costs $0.1028 per MTok on Sonnet 5.5 and $0.2029 on Opus 5.5.

Worked example: computing a bill

The token counts below are hypothetical, chosen to show the arithmetic. They are not a measurement or an Anthropic figure. Suppose one day of work sends 500,000 new input tokens, reads 4,000,000 tokens from the cache and produces 150,000 output tokens. Cost is millions of tokens times the price per million, added up:

ModelMillions of tokens × priceDay total
Claude Sonnet 5.5 0.5 × $22 + 4 × $0.1028 + 0.15 × $103 $2.90
Claude Opus 5.5 0.5 × $423 + 4 × $0.2029 + 0.15 × $2024 $5.80

Cache writes are left out to keep the sums short; the pricing page lists them too. At the Sonnet figure, the Pro monthly price would buy about 7 such days of API use. That is not a break-even point, because nobody outside Anthropic knows how many of those days a Pro allowance would cover before its limits stop you.

For a real-world reference, Anthropic says: Across enterprise deployments, the average cost is around $13 per developer per active day and $150-250 per developer per month, with costs below $30 per active day for 90% of users30. It also notes that Per-developer costs vary widely based on model selection, codebase size, and usage patterns such as running multiple instances or automation31.

When each one is the better fit

A subscription fits when

  • You want a predictable cost. The monthly price is the most you pay unless you opt into extra usage. You can set a monthly spending cap on usage credits, or choose unlimited spending32.
  • You work interactively, most days. Steady daily use spreads across the session and weekly windows, and the price stays the same however many days you work.
  • You also use the Claude apps. Chat and Claude Code draw on the same allowance, so one plan covers both.

The API fits when

  • Your usage is elastic. If you only use Claude Code now and then, paying per token can cost less than a plan that sits idle, and there is no weekly window to hit on a heavy day.
  • You run automation. CI jobs, scheduled agents and scripts are easier to budget and attribute per key. The Batch API helps for work that can wait: The Batch API processes requests asynchronously with a 50 percent discount on both input and output tokens33.
  • You need team billing. An organisation can pay centrally with the Console usage page for spend, workspace spend limits to cap it, and the Console dashboard or Claude Code Analytics API for per-user reporting34.

The API has limits too, but they are rate limits rather than allowances: Rate limits vary by usage tier (Start, Build and Scale) and affect how many requests you can make35. They cap how fast you can go, not how much you can spend.

You do not have to pick one forever. Subscribers who hit a limit can keep going at API prices: With usage credits enabled, requests switch to pay-as-you-go pricing on usage credits and keep working, billed at standard API rates36. For how the plans compare with each other, read Claude plans compared.

Tracking each one

Subscription limits: Agent Tank. Agent Tank reads the limits the Claude Code CLI reports (the session window, the weekly window and, on Max, the weekly Fable window) and shows each one with the percentage used and a countdown to its reset. It runs on your machine, on a local dashboard and a local JSON API, so you can see how close you are to a limit before Claude Code tells you. The Claude Code usage limit tracker page explains how it reads them, and getting started takes a few minutes.

API spend: Anthropic’s tools. Agent Tank is not an API spend tracker. It does not see what an API key costs. For that, Anthropic provides the Console usage page for spend, workspace spend limits to cap it, and the Console dashboard or Claude Code Analytics API for per-user reporting34. Inside Claude Code, the cost figure in /usage is an estimate computed for API users. The Session cost block in /usage shows API token usage and is intended for API users; Pro and Max usage is included in the subscription, so that cost figure isn’t relevant for billing, and subscribers see plan usage bars instead37.

Quick answers

Is a subscription cheaper than the API?

It depends on how much you use. The subscription price is fixed, while an API bill scales with tokens, and Anthropic does not publish how many tokens a plan allowance covers. Work out what your own usage would cost at API prices using the arithmetic above, and compare that with the plan price.

Can I use both?

Yes. Claude Code uses whichever you sign in with, and an ANTHROPIC_API_KEY in your environment takes precedence over the subscription. Subscribers can also turn on usage credits, which bill extra usage at API rates after a limit.

Do the API credits that come with Max pay for Claude Code?

No. Anthropic says they cannot be used in Claude Code or the Claude apps; they are for building on the API.

Does Agent Tank show my API bill?

No. Agent Tank tracks subscription usage limits reported by the CLI. Use the Claude Console for API spend.

Sources

Every plan name, number and limit behaviour above links to one of these official pages.

  1. Claude Pro price per month, billed monthly (USD): claude.com/pricing (checked )
  2. Claude Sonnet 5.5 base input price per million tokens (USD): platform.claude.com/docs/en/about-claude/pricing (checked )
  3. Claude Sonnet 5.5 output price per million tokens (USD): platform.claude.com/docs/en/about-claude/pricing (checked )
  4. Claude Code included in paid Claude plans: claude.com/pricing (checked )
  5. Claude Code on the Console is billed per token: code.claude.com/docs/en/costs (checked )
  6. ANTHROPIC_API_KEY takes precedence over a Pro or Max subscription: support.claude.com/en/articles/11145838-use-claude-code-with-your-pro-or-max-plan (checked )
  7. Claude plan name: Pro: claude.com/pricing (checked )
  8. Claude Pro price per month with an annual subscription (USD): claude.com/pricing (checked )
  9. Claude Pro annual subscription, billed up front (USD): claude.com/pricing (checked )
  10. Claude plan name: Max 5x: support.claude.com/en/articles/11049741-what-is-the-max-plan (checked )
  11. Claude Max 5x price per month (USD, web): support.claude.com/en/articles/11049741-what-is-the-max-plan (checked )
  12. Claude plan name: Max 20x: support.claude.com/en/articles/11049741-what-is-the-max-plan (checked )
  13. Claude Max 20x price per month (USD, web): support.claude.com/en/articles/11049741-what-is-the-max-plan (checked )
  14. Claude Max prices apply to web subscriptions: support.claude.com/en/articles/11049741-what-is-the-max-plan (checked )
  15. Claude session and weekly limits by plan: claude.com/pricing (checked )
  16. Claude and Claude Code share limits: support.claude.com/en/articles/11145838-use-claude-code-with-your-pro-or-max-plan (checked )
  17. Claude Max allowance relative to Pro: support.claude.com/en/articles/11049741-what-is-the-max-plan (checked )
  18. Claude message counts per plan: support.claude.com/en/articles/11049741-what-is-the-max-plan (checked )
  19. Claude Max monthly API credits: claude.com/pricing (checked )
  20. Claude Max API credits do not cover Claude Code: support.claude.com/en/articles/11145838-use-claude-code-with-your-pro-or-max-plan (checked )
  21. Claude Fable 5.1 base input price per million tokens (USD): platform.claude.com/docs/en/about-claude/pricing (checked )
  22. Claude Fable 5.1 output price per million tokens (USD): platform.claude.com/docs/en/about-claude/pricing (checked )
  23. Claude Opus 5.5 base input price per million tokens (USD): platform.claude.com/docs/en/about-claude/pricing (checked )
  24. Claude Opus 5.5 output price per million tokens (USD): platform.claude.com/docs/en/about-claude/pricing (checked )
  25. Claude Haiku 5.5 base input price per million tokens, prompts up to 100,000 tokens (USD): platform.claude.com/docs/en/about-claude/pricing (checked )
  26. Claude Haiku 5.5 output price per million tokens, prompts up to 100,000 tokens (USD): platform.claude.com/docs/en/about-claude/pricing (checked )
  27. Claude Haiku 5.5 long-prompt pricing: platform.claude.com/docs/en/about-claude/pricing (checked )
  28. Claude Sonnet 5.5 cache hit price per million tokens (USD): platform.claude.com/docs/en/about-claude/pricing (checked )
  29. Claude Opus 5.5 cache hit price per million tokens (USD): platform.claude.com/docs/en/about-claude/pricing (checked )
  30. Anthropic’s reported average Claude Code cost on enterprise deployments: code.claude.com/docs/en/costs (checked )
  31. Claude Code per-developer costs vary: code.claude.com/docs/en/costs (checked )
  32. Claude usage credits monthly spending cap: support.claude.com/en/articles/12429409-manage-usage-credits-for-paid-claude-plans (checked )
  33. Claude API Batch discount: platform.claude.com/docs/en/about-claude/pricing (checked )
  34. Claude Console tools for API spend: code.claude.com/docs/en/costs (checked )
  35. Claude API rate limits by usage tier: platform.claude.com/docs/en/about-claude/pricing (checked )
  36. Claude usage credits after a limit: support.claude.com/en/articles/12429409-manage-usage-credits-for-paid-claude-plans (checked )
  37. Claude Code /usage cost figure vs plan usage bars: code.claude.com/docs/en/costs (checked )