Pricing Overview
Claude Code is free to install. You pay for the AI model usage through one of two methods:
- Claude Pro/Team/Enterprise subscription — monthly fee with included usage limits
- 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
- Limited Claude Code usage
- Sonnet model only
- Standard rate limits
- Good for trying it out
- Generous Claude Code usage
- Access to Opus, Sonnet, Haiku
- Higher rate limits
- Priority access during peak
- Web + mobile + CLI access
- Everything in Pro
- Higher usage limits
- Admin controls
- Team billing
- Data not used for training
- 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 |
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:
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)
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 |
$ claude --model claude-haiku-4-5 "what does this function do?"
Reduce Token Usage
- Use /compact frequently — compresses conversation history, reducing token costs on subsequent messages
- Be specific in prompts — "fix the auth bug in src/auth.ts" uses fewer tokens than "something is broken, can you look?"
- Keep CLAUDE.md concise — every line is sent with every message
- Start fresh sessions for unrelated tasks rather than continuing long conversations
- Use one-shot mode for quick tasks:
claude "explain this error"vs interactive mode
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.