Home › Claude Code › Pricing & limits
OverviewInstallCLI referencePricing & limitsAgent SDKSkills & pluginsGitHubWeb, desktop & IDEModelsErrorsOpen source?TutorialFor studentsQA automationvs Cursorvs Codex & OpenCodeSubagentsHooksMCPEcosystemVS CodeOpenRouterRate limits中文指南
Last updated: November 06, 2026

Claude Code pricing and limits, explained

Claude Code has no price of its own. What you pay is whatever sits underneath it: an API balance billed per token, or a Claude subscription with a usage ceiling. Understanding which one you are on — and why the tool is so token-hungry — is most of the answer to "why was that so expensive?"

TLDR

  • On the API you pay list price per million tokens for whichever model is active; the models guide has the current rates.
  • Long sessions can consume more input tokens as context grows. Actual cost also depends on the model, output tokens, prompt-cache usage and compaction; use the usage tools and your billing dashboard to check it.
  • Pro and Max bundle usage with a rolling cap; heavy agentic sessions hit it fast.
  • On this gateway: credits at 7.69231× face value ($13 buys $100 of usage, 87% off), or a flat-rate unlimited plan from $0.80.

Is Claude Code free?

The program is free — install it from npm or the native installer and nothing is charged. What is not free is the model behind it: every turn is an API call, billed per token, or drawn from a Claude Pro/Max allowance. There is no free tier of Claude Code usage, and a Claude.ai free account does not unlock it. People asking "how to use Claude Code for free" usually end up at one of three answers: a subscription they already pay for, a small API balance, or a gateway that sells the same usage below face value.

How much is Claude Code?

Three price tags depending on the route. Claude Pro is $20 a month and Max $100 or $200 a month, each with a rolling usage cap that agentic sessions reach quickly. On the API there is no monthly fee: a focused hour on the Sonnet tier typically costs a few dollars at list price, and Opus roughly two and a half times that — a long autonomous refactor without /compact can cost more than a day of a subscription. On this gateway the same API usage is bought at 7.69231× face value ($13 for $100 of usage), or as a flat-rate unlimited plan from $0.80 for the period.

How the meter runs

Long conversations can increase the context processed on later requests. Prompt caching, compaction and tool-result handling affect how that context is processed and billed. Subagents also consume tokens. Compare input, output and cache usage for a representative task in Claude Code and check the provider billing dashboard for the authoritative charge. See Anthropic’s cost-management guide for current behavior.

Three ways to pay

1. Anthropic API (pay per token)

Use an Anthropic Console API key for metered API billing. Charges depend on the model and billable token categories, including cache usage. Account balance, spend limits and API rate limits still apply. Compare actual workload costs with the other options rather than assuming one route is always the most expensive.

2. Claude Pro or Max subscription

Sign in with /login and Claude Code draws on the subscription's usage allowance instead of an API balance. The allowance is a rolling cap, and Max exists in tiers precisely because Claude Code users exhaust Pro. It is a good fit for moderate daily use, and a frustrating one for long autonomous sessions, where the cap arrives mid-task.

3. This gateway

Same models, same API, billed against a balance you bought below face value: $13 of payment becomes $100 of usage at list rates, i.e. 87% off. For heavy use there are flat-rate unlimited plans with no per-token billing at all:

PlanDurationPrice
Unlimited 1 Hour1 hour$0.80
Unlimited 24 Hours24 hours$8
Unlimited 1 Week1 week$37
Unlimited 15 Days15 days$67

All unlimited plans →

Point Claude Code at it with ANTHROPIC_BASE_URL=https://aiprimetech.io and a gateway key. Nothing else in your setup changes — /compact, subagents, MCP, skills and hooks all keep working.

Claude Code Max: what the Max plan changes

Claude Max is the subscription built for Claude Code: the $100 tier carries roughly five times Pro's usage and the $200 tier about twenty times, on the same rolling-window cap. For an individual running a few agentic sessions a day it is the simplest answer and often the cheapest.

If a plan limit interrupts your work, compare the subscription, metered API and gateway options using a representative workload. Model choice, context length, output size, cache reuse and parallel agents can change the cost substantially. There is no universal two- or three-hour break-even point. Check current plan limits and your measured usage before choosing a route.

Rate limits

Three limits apply at once: requests per minute, tokens per minute and concurrent requests. Claude Code trips the third one first, because streaming responses hold a slot for their whole duration and subagents run in parallel. A 429 means back off; a 529 means the model is saturated for everyone. The errors guide covers both. New gateway accounts start with conservative concurrency that is raised on request.

Cutting the bill without changing tools

  • Run /compact at every change of direction; run /clear between unrelated tasks.
  • Keep the default on the Sonnet tier and switch to Opus only for the hard step (/model).
  • Write a good CLAUDE.md so the agent stops re-discovering the project every session.
  • Use --allowedTools in scripts so it never burns turns asking for permission.
  • Check /cost before a long task and decide whether the session is worth compacting first.

Frequently asked questions

Is Claude Code included in Claude Pro?

Yes — sign in with /login and it uses the subscription's usage allowance, subject to the rolling cap. API-key use bills separately.

Why did one Claude Code session cost so much?

Session cost depends on the selected model, input and output tokens, context length, prompt-cache usage and parallel agents. Review the usage breakdown and billing dashboard before attributing the cost to a single cause.

Is there a free way to run Claude Code?

The tool is free; usage is not. There is no permanent free tier here — when a welcome code for new accounts is running it is shown in the box on this page, and your first crypto top-up is doubled (+50%) — and the cheapest sustained option is the hourly unlimited plan.

What is the cheapest way to run Claude Code all day?

A flat-rate unlimited plan: a fixed price for the period, no per-token billing, fair-use limits only.

Run Claude Code on the gateway

Same models, two environment variables, credits at 7.69231× face value — or a flat-rate unlimited plan.

Get an API key See unlimited plans

AI Prime Tech is an independent API gateway and is not affiliated with, endorsed by, or sponsored by Anthropic. “Claude” and “Claude Code” are trademarks of Anthropic. Claude Code features described here follow Anthropic’s public documentation at the time of writing and change frequently; prices and model lists on this page are read from this gateway’s live settings.

More Claude Code guides

Claude Code: the complete guideHow to install Claude CodeClaude Code CLI documentation: commands and flagsThe Claude Code SDK, now the Claude Agent SDKClaude Code skills and pluginsClaude Code in GitHub: the App, the Action and @claudeDoes Claude Code have a web interface? Web, desktop and IDE explainedWhich model Claude Code uses, and how to change itClaude Code errors and how to fix themIs Claude Code open source?Claude Code tutorial: your first real sessionClaude for students: Claude Code, the API and what education actually gets youHow to use Claude Code for QA automationClaude Code vs Cursor: which one, when — and how to run bothClaude Code vs Codex vs OpenCode: the terminal agents comparedClaude Code subagents: how they work, how to define them, and agent teamsClaude Code hooks: deterministic control over what the agent doesClaude Code MCP: connecting servers, scopes, remote MCP and real examplesThe Claude Code ecosystem: routers, frameworks, plugins and the lists that track themClaude Code in VS Code: the extension, the terminal route, and the errorsHow to use OpenRouter in Claude Code (and when not to)Claude rate limit error: what "API error: rate limit reached" means and how to fix itClaude Code 怎么用:从安装到日常使用