Claude Code Pricing & Cost Guide

Understand Claude Code pricing, compare Pro subscription vs API pay-per-token, see real session costs, and learn how to optimize your spend.

Updated Feb 2026 6 min read Beginner

Pricing Overview

Claude Code is free to install. You pay for the AI model usage through one of two methods:

  1. Claude Pro/Team/Enterprise subscription — monthly fee with included usage limits
  2. Anthropic API key — pay per token (input and output separately)

Most individual developers use the Claude Pro subscription. Teams and CI/CD pipelines typically use API pricing for precise cost control.

Plans & Subscriptions

Free
$0
Basic access with limits
  • Limited Claude Code usage
  • Sonnet model only
  • Standard rate limits
  • Good for trying it out
Claude Team
$30 /user/month
Best for dev teams
  • Everything in Pro
  • Higher usage limits
  • Admin controls
  • Team billing
  • Data not used for training
Enterprise
Custom
Best for organizations
  • Everything in Team
  • SSO / SAML authentication
  • Custom usage limits
  • Dedicated support
  • SLA guarantees

API Token Pricing

If you use an API key instead of a subscription, you pay per token. Tokens are sub-word units — roughly 4 characters per token, or ~750 tokens per page of English text.

Model Input (per 1M tokens) Output (per 1M tokens) Speed
Opus 4.6 $15.00 $75.00 Slower, most capable
Sonnet 4.6 $3.00 $15.00 Fast, great for daily use
Haiku 4.5 $0.25 $1.25 Fastest, cheapest
Sonnet is the default

Claude Code uses Sonnet 4.6 by default. It offers the best balance of speed, capability, and cost for everyday coding. Use --model claude-haiku-4-5 for simple tasks to save money.

Real Session Costs

Here's what typical coding tasks cost with API pricing using Sonnet 4.6:

Quick question
"What does this function do?" with a small file
~2K tokens
~$0.01
Bug fix
Find and fix a bug in a single file
~15K tokens
$0.05-$0.15
Feature implementation
Add a new feature touching 3-5 files
~50K tokens
$0.15-$0.50
Code review
Review a medium PR (200-500 line diff)
~30K tokens
$0.10-$0.30
Multi-file refactor
Refactor across 10+ files with tests
~200K tokens
$0.50-$2.00
Full-day heavy usage
8 hours of continuous coding assistance
~1M+ tokens
$3-$10

For most developers, a full day of heavy Claude Code usage costs $3-$10 with API pricing. Light usage (a few questions per day) costs well under $1.

Pro vs API: Which Should You Choose?

Factor Pro Subscription ($20/mo) API Key (Pay-per-token)
Best for Daily individual use CI/CD, teams, sporadic use
Cost predictability Fixed monthly cost Variable, usage-based
Usage limits Generous but capped Unlimited (pay as you go)
Model access All models included All models, priced differently
Includes web/mobile Yes (claude.ai) No (CLI only)
GitHub Actions Not supported in CI Supported
Break-even point ~$20/month API usage (varies by model)

Rule of thumb: If you use Claude Code at least a few times per week, Pro is likely cheaper. If you only use it occasionally or need CI/CD integration, go with API pricing.

Cost Control & Optimization

Set Spending Limits (API)

# Set a monthly spending cap
export ANTHROPIC_MAX_SPEND=50 # $50 limit

# Or set per-session via the Console
# console.anthropic.com → Settings → Spending Limits

Use the Right Model

Task Recommended Model Why
Complex architecture Opus 4.6 Worth the cost for hard problems
Daily coding Sonnet 4.6 (default) Best speed/quality/cost ratio
Quick questions Haiku 4.5 12x cheaper than Sonnet
CI/CD reviews Haiku 4.5 High volume, lower cost
# Switch models on the fly
$ claude --model claude-haiku-4-5 "what does this function do?"

Reduce Token Usage

Frequently Asked Questions

Is Claude Code free to try?

Yes. You can install Claude Code for free and use it with a free Anthropic account. The free tier has limited usage but is enough to evaluate whether Claude Code works for your workflow.

Do I need a credit card to use Claude Code?

For the free tier and Claude Pro subscription, you can start with just an Anthropic account. For API usage, you need a credit card linked to your Anthropic account with prepaid credits.

Can I use Claude Code with my company's API account?

Yes. Set the ANTHROPIC_API_KEY environment variable to your organization's API key. You can also use --api-base-url to point to a custom proxy or gateway for centralized billing and access control.

How do I check my current spending?

For API users, check your usage at console.anthropic.com/usage. For Pro subscribers, your usage is included in the subscription.

What happens if I exceed my Pro limits?

Claude Code will notify you when you're approaching your limit. Once reached, you can wait for the monthly reset, upgrade to Team, or switch to API pricing for the remainder of the billing period.

Are there student or open-source discounts?

Check anthropic.com/pricing for the latest offers. Anthropic has offered credits for open-source projects and academic research in the past.

Next Steps