What Claude Code Really Costs - Anthropic Plan or a Prepaid Token Balance
Claude Code cost compared: Anthropic Pro or Max plan versus pay per token from a prepaid balance. Estimate a session, set it up, cap spending per key.
Installing Claude Code costs nothing. The model behind it is what you pay for, and there are two routes: an Anthropic subscription, where Pro starts at $20 monthly and Max at $100 (Claude Code is absent from the Free tier), or an API key billed per token. With a Kadraris key the per-token rates are $3.24 / $16.20 per 1M tokens for Claude Sonnet 5, $3.78 / $18.90 per 1M tokens for Claude Opus 5.5 and $1.35 / $6.75 per 1M tokens for Claude Haiku 4.5, deducted from money you load in advance, with nothing billed monthly. This guide starts with the decision, then shows how to measure a session, the setup, and how to keep spending under control.
Plan or tokens: a quick decision
If Claude Code is open in your terminal for hours every working day, an Anthropic Max plan will usually give you more for the money than paying per token. Flat rates are designed for heavy users. Paying per token fits better when:
- you open the agent a few times a week, and quiet months should cost you zero,
- a plan limit tends to hit you in the middle of a task, and you would rather pay for the extra than wait for the reset,
- Claude Code runs in CI or scripts, where logging in with a subscription is clumsy,
- a team needs a separate key per person, each with its own cap, on one balance,
- the same account already pays for image, video or other chat models.
A mixed setup is common too: Pro for everyday work, and a per-token key ready for when the plan says you have hit your limit.
What each option includes
Anthropic plans
What Anthropic listed on its pricing page at the start of October 2026:
| Tier | Monthly cost, USD excl. tax | Claude Code |
|---|---|---|
| Free | $0 | not included |
| Pro | $20/month, or $17/month paid yearly | included |
| Max | from $100/month, 5x and 20x tiers | included |
| Team (standard) | $25 per seat, $20 if paid yearly | included |
Plans change, so check that page before paying. Developers should know one detail: on a plan, Claude Code draws from the same usage allowance as everything else on the account, chat on claude.ai included. On Pro, an intense afternoon of coding can run into a usage notice, after which you sit idle until the allowance refills.
A per-token key on Kadraris
Claude Code accepts an API key instead of a subscription login. Give it the address of a service that speaks the Anthropic API, and every call is billed by its token count. With Kadraris:
- you prepay from $10, with no monthly fee and no minimum commitment,
- unused balance stays on the account and does not expire,
- rates per token are published in advance and are the same for every account,
- a request that fails costs nothing,
- one key covers Claude plus image, video, audio and other chat models.
| Model | Id to use | Per 1M tokens (in / out) | Good for |
|---|---|---|---|
| Claude Opus 5.5 | claude-opus-5.5 | $3.78 / $18.90 per 1M tokens | big refactors, design, nasty bugs |
| Claude Sonnet 5 | claude-sonnet-5 | $3.24 / $16.20 per 1M tokens | daily edits, tests, features |
| Claude Haiku 4.5 | claude-haiku-4.5 | $1.35 / $6.75 per 1M tokens | background calls, quick lookups |
Measuring a session
Any session costs:
cost = input_M × input_rate
+ output_M × output_rateCoding agents read far more than they write. Each step resends everything it has gathered: opened files, terminal output, earlier messages. So input tokens are usually many times higher than output. To illustrate with invented but plausible numbers: 2M tokens in and 50k tokens out means paying 2 × the input rate and 0.05 × the output rate. Your own numbers will swing with repository size and how much the agent explores, which is why measuring beats guessing:
curl https://kadraris.com/v1/balance \
-H "Authorization: Bearer sk-kd-..."Check the balance before you start and again when you finish. The gap is the price of that session.
Setting it up in four steps
1. Install the CLI
The official script for Mac, Linux and WSL:
curl -fsSL https://claude.ai/install.sh | bashOn Windows PowerShell:
irm https://claude.ai/install.ps1 | iexThrough npm (needs Node.js 22 or newer):
npm install -g @anthropic-ai/claude-codeIn a fresh terminal, claude --version should print a version number.
2. Make a key with a monthly cap
- Register and load your balance. The preset amounts are $10, $25, $50, $100 and $250.

- In the dashboard, go to API keys, give the key a name such as "claude-code", and set a monthly cap.
- Copy the
sk-kd-...value straight away, because it is displayed once.

3. Point Claude Code at Kadraris
macOS and Linux:
export ANTHROPIC_BASE_URL=https://kadraris.com
export ANTHROPIC_AUTH_TOKEN=sk-kd-...
export ANTHROPIC_MODEL=claude-sonnet-5 # optional
claudeWindows PowerShell:
$env:ANTHROPIC_BASE_URL = "https://kadraris.com"
$env:ANTHROPIC_AUTH_TOKEN = "sk-kd-..."
$env:ANTHROPIC_MODEL = "claude-sonnet-5" # optional
claudeLeave /v1 off the base URL, because Claude Code adds the path on its own. To keep the setup across terminals, write it into ~/.claude/settings.json:
{
"env": {
"ANTHROPIC_BASE_URL": "https://kadraris.com",
"ANTHROPIC_AUTH_TOKEN": "sk-kd-...",
"ANTHROPIC_MODEL": "claude-sonnet-5",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4.5"
}
}ANTHROPIC_DEFAULT_HAIKU_MODEL decides which model handles Claude Code's small background requests; setting it to Haiku 4.5 keeps them on a low rate. Never place the key in the repository copy of .claude/settings.json, since that file is usually committed. Use .claude/settings.local.json or the file in your home directory.
4. Check that it works
Run /status in Claude Code and look for https://kadraris.com as the base URL, then type any prompt. If something fails:
| Code | Likely reason |
|---|---|
401 | wrong key, or an older key still in ANTHROPIC_API_KEY |
402 | balance too low |
403 | the key hit its monthly cap |
404 on some calls | a model id outside the catalog; set ANTHROPIC_MODEL and ANTHROPIC_DEFAULT_HAIKU_MODEL |
For the VS Code extension, GitHub Actions and more error cases, read the base URL guide. Every variable is documented in the Claude Code docs.
Six ways to spend less
- One key per agent, with a cap. Hitting the cap produces
403responses, which halts a looping agent long before your balance hits zero. - Mind the cache rate when picking a default. Sonnet 5 has a lower input and output rate than Opus 5.5, but no cache rate on Kadraris, while Opus 5.5 reads cached context at a twentieth of its input rate. In long sessions that resend the same context, Opus 5.5 can end up cheaper, so compare two real sessions by balance before settling. Switch models with
/model. - Send background calls to Haiku.
ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-4.5. - Run
/clearbetween tasks. Old history is resent as input on every step. - Run
/compactwhen a long thread is worth keeping but its context has grown heavy. - Keep
CLAUDE.mdshort. A few lines on folder layout and how to run tests spare the agent a tour of the codebase.
Try the models in the browser first
Curious how the three Claude models handle your typical prompt before touching the terminal? Then open the Chat and code tab in Kadraris Studio. Its rates per token show under the model menu as soon as you select one.

Outside Claude Code, the key plugs into tools built for the OpenAI API (Cursor, Cline, n8n) via https://kadraris.com/v1, and then any catalog chat model is available. That side is covered in using the OpenAI SDK with any model.
Questions
Is there any way to use Claude Code for free?
Not really. Downloading is free, yet Anthropic only lets paid plans or API accounts use Claude Code, so the Free tier is out. Kadraris gives no starter credit and starts at a $10 top-up. The saving with tokens is that idle months cost you nothing.
Can I keep my Pro plan and use a Kadraris key only when I hit the limit?
Yes. Keep the variables in a separate shell profile or settings file and switch to it when the plan limit appears. While ANTHROPIC_AUTH_TOKEN is set, requests are billed to your balance instead of the plan.
Which Claude models can I pick in Claude Code with a Kadraris key?
The main ones are claude-opus-5.5, claude-sonnet-5 and claude-haiku-4.5, and other Claude models from the catalog work as well. The Anthropic-compatible endpoint serves Claude models only.
What happens when the monthly cap on a key is reached?
That key gets 403 answers and spends no more until the calendar month turns over or you lift the cap. Other keys on the same balance carry on normally.


























