Claude Code Usage Limits: Model Choice and API vs Plan
How to stretch Claude Code usage limits by matching models to tasks, and when paying per token on an API key costs less than a Pro or Max plan.
The fastest way to make your Claude Code usage limits last longer is to stop using Opus for every task. Haiku 5.5 costs 2.5% of Opus 5.5's input price, and a large category of coding work, file reads, boilerplate, formatting, quick lookups, doesn't need Opus at all. For teams and developers whose usage outgrows a plan entirely, an Anthropic API key with pay-per-token billing removes the five-hour and weekly caps that govern Pro and Max subscriptions, though the economics only favor that path at specific usage levels.
Why Model Choice Matters More Than You Think
Claude Code's usage limits on Pro and Max plans are measured in tokens, not prompts. Every turn in a session carries the full conversation context, so a long agentic loop running on Opus 5.5 consumes limit at a very different rate than the same loop on Haiku 5.5. The model you pick on a plan determines how much of your five-hour window each task burns.
The current active lineup you can use in Claude Code, with pricing from Anthropic's pricing page:
| Model | API ID | Input / Output (per 1M tokens) | Cached input | Best suited for |
|---|---|---|---|---|
| Claude Haiku 5.5 | claude-haiku-5-5 | $0.10 / $0.50 (up to 100K tokens) | $0.01 | File reads, formatting, extraction, routing, boilerplate |
| Claude Sonnet 5.5 | claude-sonnet-5-5 | $2.00 / $10.00 | $0.10 | Everyday development, test writing, routine fixes |
| Claude Opus 5.5 | claude-opus-5-5 | $4.00 / $20.00 | $0.20 | Complex debugging, architecture decisions, large refactors |
| Claude Fable 5.1 | claude-fable-5-1 | $10.00 / $50.00 | $0.25 | Long autonomous tasks, demanding reasoning across many files |
Note that for prompts over 100,000 tokens, Haiku 5.5 costs more: $0.50 per million input tokens and $2.50 per million output tokens. Keep that in mind for large-context sessions.
The price spread is not subtle. An Opus 5.5 output token costs 40x what a Haiku 5.5 output token costs. If a task only needs pattern matching, file reading, or generating boilerplate, running it on Opus doesn't improve the result. It just shrinks your remaining session budget faster.
Matching Models to Task Types
A useful mental framework is to ask what could go wrong if the model gets it slightly wrong. For high-stakes decisions, that cost is high. For mechanical tasks, it's low.
Use Haiku 5.5 when the task is narrow and the output is easy to verify: reading a file and summarizing it, reformatting code, writing commit messages, generating config boilerplate, or running extraction on well-defined text. These tasks have one right answer. Using Opus for them is paying a premium for headroom you won't use.
Use Sonnet 5.5 for the bulk of active development: writing tests for existing code (you can inspect the tests immediately), implementing a feature from a clear spec, fixing a known bug, iterating on UI components. This is the right default for most coding sessions. It costs one-fifth of Fable 5.1 and handles the majority of professional development work.
Use Opus 5.5 when the cost of choosing the wrong approach is high: architectural decisions, debugging a subtle issue in an unfamiliar codebase, planning a cross-file refactor, or understanding a complex dependency interaction. The difference between Opus and Sonnet on a well-specified implementation task is often small. The difference on an ill-defined exploratory task can be significant.
Use Fable 5.1 for long autonomous sessions where the agent needs to reason across many files, make interdependent decisions, and run for extended periods without guidance. It's the right tool for the hardest work, not for delegating ordinary tasks to something that feels powerful.
The opusplan Pattern
Claude Code has a built-in alias called opusplan that handles a common case cleanly. When you start a task, it uses Opus 5.5 to build the plan. Once you approve the plan and execution begins, it switches to Sonnet 5.5 automatically. You get Opus's planning quality and Sonnet's cost and speed for the implementation, without having to remember to switch manually.
This is worth building as a habit. Plan with the most capable model you need; execute with the cheapest model that handles the resulting well-defined steps.
Switching Models Mid-Session
You can switch models mid-session in Claude Code without losing context. The /model command takes effect on the next turn:
/model haiku # switch to Haiku 5.5
/model sonnet # switch to Sonnet 5.5
/model opus # switch to Opus 5.5
You can also set a starting model for a session at launch: claude --model claude-haiku-5-5.
A practical pattern for getting the most out of a plan limit: start planning and architectural work in Opus or with opusplan, then explicitly switch to Haiku or Sonnet once the approach is settled and you're in routine implementation. Teams can restrict which models are selectable in settings to prevent accidental Opus sessions on tasks that don't warrant them.
Let each request use the cheapest model that's just as good
PromptUnit checks each request your app sends. When a cheaper model is just as good for that request, it uses it; otherwise your model answers. Free until it has saved you money.
Try it free →Plan Limits vs. API Key: When Each Makes Sense
Claude Code on a Pro or Max plan draws usage from the same rolling five-hour window and weekly cap that governs your Claude chats. Anthropic doesn't publish exact token counts per tier, but the usage scales from Pro at 1x through Max 5x at five times Pro's session capacity, and Max 20x at twenty times Pro's capacity.
An Anthropic API key (set via ANTHROPIC_API_KEY in your terminal) works differently: each token is billed at list rates and there are no interactive-session caps. The same ANTHROPIC_BASE_URL environment variable lets you route through a proxy if needed. The two variables together are the full setup.
The plan is usually cheaper for heavy daily interactive use. At anything approaching full Max 20x capacity, the equivalent API cost would be dramatically higher. But the API wins in specific situations:
Choose the API key when:
- Usage is spiky or unpredictable, with heavy weeks followed by quiet ones. A flat monthly fee you don't earn back is waste.
- Claude Code runs unattended in CI pipelines, scheduled jobs, or bots. A subscription that hits a session wall is frustrating and invisible; an uncapped API key will generate a bill, but you can configure a spend limit to control it.
- You need per-project cost attribution. API billing gives you a line-item invoice; a subscription doesn't.
- Your actual monthly API-equivalent spend is below roughly $3.33 per day ($100/month). Below that threshold, Max 5x costs more than what you'd pay on the API for the same usage.
Stick with a plan when:
- You use Claude Code most workdays for interactive development. The session caps are rarely a problem for typical engineering work, and the flat rate is predictable.
- You'd otherwise hit the API equivalent of hundreds of dollars per month. At that volume, $100 or $200/month is a substantial discount.
- You want natural throttling on runaway sessions. A session limit is an annoying but free speed bump; an uncapped API key with a runaway agent loop can produce a real bill before you notice.
One important note: if you have both an Anthropic subscription and an ANTHROPIC_API_KEY set in your environment, Claude Code uses the API key and bills per token, even while you're logged in with a Pro or Max account. Anthropic's official support documentation says to keep ANTHROPIC_API_KEY unset if you want to use your subscription's included usage. Check your environment variables if you're unsure which path your sessions are taking.
Caching Cuts Costs Whether You're on API or Plan
If you're on an API key, prompt caching is worth understanding because it compounds with model selection. When Claude Code reads a large codebase repeatedly across turns in a session, those previously-processed tokens can be served from cache at a fraction of the standard input price: $0.01 per million for Haiku 5.5, $0.10 for Sonnet 5.5, $0.20 for Opus 5.5. For long agentic sessions with a stable context, the effective cost of repeated context can drop substantially.
This is part of why the per-request cost of agent loops is often higher than expected: context grows with each turn, and without caching, every new turn re-pays the full input cost of everything that came before. On the API, you can inspect this directly. On a plan, you just see the usage counter move.
For a broader look at how model choice affects API costs across providers and task types, the Claude Haiku vs Sonnet routing guide has worked token math. And if you're managing Claude costs across an application rather than a personal Claude Code session, the five-step guide to reducing Claude API costs covers caching, batching, and model selection together.
A Note on Cost Routing for API Key Users
If you're running Claude Code on an Anthropic API key, a tool like PromptUnit checks each request: when a cheaper model is just as good for it, PromptUnit uses it; otherwise the request goes to the model you asked for. Setup is in ~/.claude/settings.json, inside "env": set ANTHROPIC_BASE_URL to your personal PromptUnit address and keep ANTHROPIC_API_KEY as your own Anthropic API key. PromptUnit never asks for that key and does not store or log it, and requests are still billed to your own Anthropic account. This only works with an Anthropic API key paid per use, not a Pro or Max subscription login, since plan-based usage isn't billed per request and can't be routed or reduced this way.
The cleaner path for most individual developers is still model discipline on your own: use the /model command actively, default to Sonnet 5.5, escalate to Opus 5.5 when the work calls for it, and reach for Haiku 5.5 on mechanical tasks. The token math rewards that habit whether you're on a plan or paying per token.