Skip to the workspace
Pebellslearn by building
Ways to Use Claude  ›  Lesson

Subscription or API?

Subscription 12 minA subscription gives a person a predictable usage allowance, while API billing charges per token and suits unattended scripts and jobs, whose keys must be kept out of code.

claude code / Subscription or API?

Explore each scene at your own pace.

01 · The rule

The rule

Subscription or API?

There are two main ways to pay for Claude Code, and picking the wrong one gives you either a surprise bill or a "limit reached" message halfway through a task. The choice comes down to who is using it and how steadily.

The rule

A subscription buys an allowance; an API key pays for every token.

Subscription. You sign in with a Claude account on a plan that includes Claude Code. You pay a fixed monthly price and get usage limits that refill over time. When you run out, you wait for the refill or move to a larger plan. It suits a person who codes most days, because the cost is predictable.

API (pay as you go). You sign in with an Anthropic API account, or supply an API key, and every request is billed by the tokens going in and coming out. There is no allowance to run out of, only a bill, so set a spending limit on the account. It suits automation, scripts, scheduled jobs and company billing. Some organisations reach the same models through their cloud provider's billing instead.

Why tokens matter either way. A token is a small chunk of text, often part of a word. Every request carries the conversation so far — your messages, the files Claude has read, command output — so a long session full of big files sends more tokens per request. Fresh, focused sessions are cheaper on both routes.

Inside a session, /cost reports what the session has spent, which matters most on API billing, and /usage shows how much of a plan's allowance you have used. /status shows which account the session is signed in with. Command names shift a little between versions, and /help lists yours.

A classic surprise: an API key left in your shell's environment can end up being used instead of your subscription. If the bills look wrong, check /status.

Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.