How Much Does Claude Code Cost?

Claude Code uses token-based pricing via the API, or is included with Anthropic's Max plan at $100/mo or $200/mo. Pro plan users get limited access at $20/mo.

claude-code-pricing.sh

$ claude --pricing 2026

# Quick summary

Pro Plan ............ $20/mo (usage-capped)

Max Plan ........... from $100/mo (higher limits)

API Direct ......... pay per token (no cap)

# Typical costs

Avg session ........ $0.50 - $5.00

Avg dev month ...... $30 - $200

How Claude Code Pricing Works

Token-based billing

Every prompt you send and every response you receive consumes tokens. Tokens are roughly 3/4 of a word, so a 1,000-word response uses about 1,333 tokens.

Input and output are priced separately

You pay one rate for input tokens (your prompts plus context from files Claude reads) and a higher rate for output tokens (Claude's responses and code).

Context window accumulates

When Claude Code reads your files, those tokens count as input. Longer conversations accumulate more context, so later messages in a session cost more than early ones.

Subscription plans cap usage, not cost

On Pro and Max plans, you pay a flat monthly fee. When you hit your usage limit, Claude Code slows down or pauses until the limit resets. You are never charged overage fees.

Pricing by Access Method

Three ways to use Claude Code, each with different trade-offs.

Subscription

Pro Plan

$20/mo

  • + Claude Code access included
  • + Sonnet 4 by default
  • + Good for occasional use
  • - Usage-capped (a few sessions/day)
  • - Rate-limited during peak times
Most Popular

Subscription

Max Plan

$100 - $200/mo

  • + $100: 5x Pro usage limits
  • + $200: 20x Pro limits + Opus 4
  • + Priority access, no throttling
  • + Best for daily heavy usage
  • - Higher monthly commitment

Pay per token

API Direct

$0/mo base

  • + No monthly fee
  • + All models: Sonnet, Opus, Haiku
  • + No usage caps
  • + Full control over spend
  • - Cost varies with usage
ModelInput (per 1M tokens)Output (per 1M tokens)
Claude Sonnet 4$3.00$15.00
Claude Opus 4$15.00$75.00
Claude Haiku 3.5$0.80$4.00

Real-World Cost Examples

What actual Claude Code sessions cost on API pricing with Sonnet 4.

Quick bug fix

15 minutes

Describe a bug, paste an error, Claude reads 2 files and suggests a fix.

~5K in / ~2K out

$0.05Sonnet
$0.23Opus

Feature build

1 hour

Multi-turn conversation, Claude reads 8-10 files, writes code, iterates on tests.

~80K in / ~20K out

$0.54Sonnet
$2.70Opus

Large refactor

2-3 hours

Reads dozens of files, plans architecture changes, rewrites multiple modules.

~300K in / ~60K out

$1.80Sonnet
$9.00Opus

Full-day heavy use

8 hours

Multiple sessions, large codebase, frequent back-and-forth throughout the day.

~800K in / ~150K out

$4.65Sonnet
$23.25Opus

Monthly Cost Projections

Estimated monthly spend on API pricing across usage levels (22 working days).

Usage LevelMonthly (Sonnet)Monthly (Opus)
Light (casual help)$15 - $40$60 - $180
Moderate (daily coding)$40 - $100$180 - $500
Heavy (primary tool)$100 - $250$500 - $1,200
Team (5 devs, moderate)$200 - $500$900 - $2,500

Usage Cost Estimator

Estimate your monthly Claude Code spend based on usage patterns.

Daily tokens

500K in / 120K out

Daily cost (API)

$3.30

Estimated monthly cost (API, 22 working days)

$72.60

Plan comparison

Pro Plan
$20.00
Usage-capped
Max $100
$100.00
5x Pro limits
Max $200
$200.00
20x Pro limits + Opus
API (estimated)
$72.60
Pay per token

Recommendation: At your usage level, the Max $100 (flat rate) would be cheaper than API pricing.

Claude Code vs Cursor vs Copilot vs Windsurf

Head-to-head pricing and feature comparison for AI coding tools.

Claude CodeCursorGitHub CopilotWindsurf
Starting pricefrom $20/mo$20/mo$19/mo$15/mo
Power user price$100-$200/mo$40/mo (Pro)$39/mo (Business)$30/mo (Pro)
Pay-per-token optionYes (API)NoNoNo
Pricing modelFlat or per-tokenFlat + limitsFlatFlat + limits
Models availableSonnet, Opus, HaikuGPT-4o, Claude, etc.GPT-4o, ClaudeGPT-4o, Claude
InterfaceTerminal (CLI)IDE (VS Code fork)IDE extensionIDE (VS Code fork)
Agentic codingFull (file edit, shell, git)Composer agentCopilot WorkspaceCascade agent
Cost predictabilityHigh (subscription) / Low (API)HighHighHigh
Best forTerminal-native devsIDE-focused editingAutocomplete workflowsIDE-focused editing

How to Reduce Your Claude Code Costs

Practical strategies ranked by impact, from biggest savings to smallest.

1

Use Sonnet instead of Opus for routine tasks

Up to 80% savings

Sonnet is 5x cheaper than Opus and handles most coding work with similar quality. Reserve Opus for complex architecture decisions and hard debugging problems.

2

Keep conversations short

30-50% savings

Start fresh sessions rather than extending long ones. Context accumulation is the biggest cost driver. Each message in a long conversation sends all previous context as input tokens.

3

Use /compact to compress context

20-40% savings

The /compact command summarises the conversation so far, reducing the token count for subsequent messages. Use it whenever you notice a conversation getting long.

4

Be specific in your prompts

15-25% savings

Vague prompts lead to longer back-and-forth exchanges, each one adding more tokens. Tell Claude exactly which files to look at and what outcome you want.

5

Add a .claudeignore file

10-20% savings

Prevent Claude from reading irrelevant files like node_modules, build artifacts, logs, and large data files. Less file reading means fewer input tokens.

6

Enable prompt caching (API mode)

Up to 90% on cached content

Repeated system prompts and file reads can be cached when using the API directly, reducing input costs by up to 90% for cached content.

7

Batch non-urgent work (API mode)

50% on batched work

The API batch mode offers a 50% discount for asynchronous processing. Queue up code reviews, documentation generation, or test writing for batch execution.

Which Plan Should You Choose?

A quick decision framework based on how you use Claude Code.

Hobbyist

Pro ($20/mo)

Use Claude Code fewer than 2 hours/day for side projects and learning. Usage limits rarely matter at this level.

Best for: Occasional coding help

Daily Developer

Max ($100/mo)

Claude Code is part of your daily workflow. You need reliable access without peak-time throttling or worrying about limits.

Best for: 3-5 hours/day

Power User

Max ($200/mo)

Claude Code is your primary development tool. You need Opus 4 for complex architecture work and the highest usage limits.

Best for: 6+ hours/day, needs Opus

Team / Builder

API Direct

You need granular control, no caps, or you are building tools on top of Claude Code. API is the only option for programmatic access.

Best for: Custom tooling, teams

Billing and Usage Monitoring

Check your usage

Visit dashboard.anthropic.com to see your current token consumption, spending trends, and remaining plan limits in real time.

Set up spend alerts

Configure budget caps and email alerts in the Anthropic dashboard. Get notified before you hit a spending threshold you set.

Understand rate limiting

On Pro and Max plans, hitting your usage limit results in throttling (slower responses) or temporary pausing. You will never be charged overage fees on subscription plans.

API billing cycle

API usage is billed monthly in arrears. You can set a hard spending cap so your account is never charged beyond a limit you choose.

Frequently Asked Questions

How much does Claude Code cost per month?
Claude Code is included with Anthropic's Pro plan at $20/mo (usage-capped), Max plans at $100/mo (5x limits) or $200/mo (20x limits + Opus 4), or via API where you pay per token with no monthly fee. A typical developer using Sonnet 4 via API spends $40-$100/month.
Is Claude Code free?
Claude Code is not free, but it is included with every Anthropic subscription plan. The cheapest option is the Pro plan at $20/month. There is no separate charge for Claude Code on top of your subscription.
How does Claude Code token pricing work?
When using Claude Code via API, you pay per token. Every prompt you send and response you receive consumes tokens (roughly 3/4 of a word each). Input tokens (prompts + file context) and output tokens (Claude's responses) are priced separately. Sonnet 4 costs $3/$15 per million input/output tokens.
Is Claude Code cheaper than Cursor?
It depends on usage. Both start at $20/mo. For heavy users, Claude Code Max at $100/mo offers more capability than Cursor Pro. Claude Code's advantage is terminal-native agentic workflows, while Cursor focuses on IDE integration.
What is the difference between Pro and Max plans?
Pro ($20/mo) gives standard usage limits with Sonnet 4. Max $100 provides 5x Pro limits with priority access. Max $200 provides 20x Pro limits plus Opus 4 access for complex work. Neither charges overage fees.
How can I reduce my Claude Code costs?
Use Sonnet instead of Opus for routine tasks (5x cheaper), keep conversations short, use /compact to compress context, add a .claudeignore file, and be specific in prompts. On API, enable prompt caching and use batch mode for non-urgent work.
How much does a typical Claude Code session cost?
On API pricing with Sonnet 4: a quick bug fix (15 min) costs roughly $0.05, a feature build (1 hour) costs $0.50-$0.60, a large refactor (2-3 hours) costs $1.50-$2.00, and a full day of heavy usage costs $4-$5. Opus 4 is roughly 5x more.
Can I use Claude Code with my own API key?
Yes. Claude Code supports direct API access with your own Anthropic API key. This gives you pay-per-token pricing with no monthly subscription, no usage caps, and access to all Claude models. Set your key with the ANTHROPIC_API_KEY environment variable.