PL Log inOpen Studio
Preview version. Model catalog, prices, calculator and docs are live. Generation goes live at launch.

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:

TierMonthly cost, USD excl. taxClaude Code
Free$0not included
Pro$20/month, or $17/month paid yearlyincluded
Maxfrom $100/month, 5x and 20x tiersincluded
Team (standard)$25 per seat, $20 if paid yearlyincluded

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.
ModelId to usePer 1M tokens (in / out)Good for
Claude Opus 5.5claude-opus-5.5$3.78 / $18.90 per 1M tokensbig refactors, design, nasty bugs
Claude Sonnet 5claude-sonnet-5$3.24 / $16.20 per 1M tokensdaily edits, tests, features
Claude Haiku 4.5claude-haiku-4.5$1.35 / $6.75 per 1M tokensbackground calls, quick lookups

Measuring a session

Any session costs:

text
cost = input_M × input_rate
     + output_M × output_rate

Coding 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:

bash
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:

bash
curl -fsSL https://claude.ai/install.sh | bash

On Windows PowerShell:

powershell
irm https://claude.ai/install.ps1 | iex

Through npm (needs Node.js 22 or newer):

bash
npm install -g @anthropic-ai/claude-code

In a fresh terminal, claude --version should print a version number.

2. Make a key with a monthly cap

  1. Register and load your balance. The preset amounts are $10, $25, $50, $100 and $250.
Dashboard screen for adding funds with preset amounts and a field for your own sum
One top-up lasts until you use it, with nothing charged monthly
  1. In the dashboard, go to API keys, give the key a name such as "claude-code", and set a monthly cap.
  2. Copy the sk-kd-... value straight away, because it is displayed once.
Dashboard form for a new key with an optional cap on monthly spending
Every key can carry its own monthly cap, which I always set for a coding agent

3. Point Claude Code at Kadraris

macOS and Linux:

bash
export ANTHROPIC_BASE_URL=https://kadraris.com
export ANTHROPIC_AUTH_TOKEN=sk-kd-...
export ANTHROPIC_MODEL=claude-sonnet-5   # optional
claude

Windows PowerShell:

powershell
$env:ANTHROPIC_BASE_URL = "https://kadraris.com"
$env:ANTHROPIC_AUTH_TOKEN = "sk-kd-..."
$env:ANTHROPIC_MODEL = "claude-sonnet-5"   # optional
claude

Leave /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:

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:

CodeLikely reason
401wrong key, or an older key still in ANTHROPIC_API_KEY
402balance too low
403the key hit its monthly cap
404 on some callsa 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

  1. One key per agent, with a cap. Hitting the cap produces 403 responses, which halts a looping agent long before your balance hits zero.
  2. 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.
  3. Send background calls to Haiku. ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-4.5.
  4. Run /clear between tasks. Old history is resent as input on every step.
  5. Run /compact when a long thread is worth keeping but its context has grown heavy.
  6. Keep CLAUDE.md short. 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.

Chat and code tab in Studio, Sonnet 5 selected, two token rates shown underneath
Claude Sonnet 5 in Kadraris Studio, with input and output rates per 1M tokens under the model menu

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.