Claude API vs Claude Pro: Why Your Subscription Doesn't Include It
Why Claude Pro doesn't include the Claude API: they are two products with two bills. A plan (Free, Pro, Max, Ultra) pays a flat monthly price for the Claude apps and Claude Code, signed in as you, with usage limits; the API is for your own code, needs an API key from the Console (platform.claude.com) and prepaid credits, and bills every token. We run a small Python script with no key and with a made-up key, send the same request through Claude Code on a Pro plan, and work out what one email summary and 6,000 a month cost on Haiku, Sonnet and Opus. Plus the exception: Max and Ultra include monthly API credits, and how Claude Code fits on both sides.

Paid for Pro, and still an error
You pay for Claude Pro, so why does your own script that calls Claude fail? Ana runs a small coffee shop, Kettle & Bean, and pays twenty dollars a month for Pro. She writes a short Python script to summarize her support emails, runs it, and gets this: could not resolve authentication method. Pro isn't broken. Her script is knocking on a different door: the Claude API, which Pro doesn't include. Here's why, and what each one really costs.
cat emails/torn-bag.txtHi Kettle & Bean, My order #4471 arrived today, but the bag of Ethiopia Guji was torn and half the beans spilled into the box. Could you send a new bag? The grinder in the same order is fine, so I'd like to keep it. Thanks, Priya
python3 summarize.py emails/torn-bag.txtTraceback (most recent call last): File "/Users/chris/api-lab/summarize.py", line 6, in <module> reply = client.messages.create( model="claude-sonnet-5-5", ...<3 lines>... "content": "Summarize in one sentence:\n" + email}], ) File "/opt/homebrew/lib/python3.14/site-packages/anthropic/_utils/_utils.py", line 294, in wrapper return func(*args, **kwargs) File "/opt/homebrew/lib/python3.14/site-packages/anthropic/resources/messages/messages.py", line 1070, in create return self._post( ~~~~~~~~~~^ "/v1/messages", ^^^^^^^^^^^^^^^ ...<30 lines>... stream_cls=Stream[RawMessageStreamEvent], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/opt/homebrew/lib/python3.14/site-packages/anthropic/_base_client.py", line 1679, in post return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)) ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.14/site-packages/anthropic/_base_client.py", line 1230, in request return self._request(cast_to, options, stream=stream, stream_cls=stream_cls) ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.14/site-packages/anthropic/_base_client.py", line 1264, in _request response, prepared = self._attempt_request( ~~~~~~~~~~~~~~~~~~~~~^ model_copy(input_options), stream=stream, retries_taken=retries_taken, call=call ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/opt/homebrew/lib/python3.14/site-packages/anthropic/_base_client.py", line 1419, in _attempt_request request = self._build_request(options, retries_taken=retries_taken) File "/opt/homebrew/lib/python3.14/site-packages/anthropic/_base_client.py", line 628, in _build_request headers = self._build_headers(options, retries_taken=retries_taken) File "/opt/homebrew/lib/python3.14/site-packages/anthropic/_base_client.py", line 573, in _build_headers self._validate_headers(headers, omitted) ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.14/site-packages/anthropic/_client.py", line 423, in _validate_headers raise TypeError( '"Could not resolve authentication method. Expected one of api_key, auth_token, or credentials to be set. Or for the `Authorization` header to be explicitly omitted"' ) TypeError: "Could not resolve authentication method. Expected one of api_key, auth_token, or credentials to be set. Or for the `Authorization` header to be explicitly omitted"
Two products, one name
Claude is one name for two products. The first is the Claude apps: the website, the desktop and phone apps, and Claude Code, Anthropic's coding assistant for the terminal. You sign in with your account, and a plan like Pro pays for them. The second is the Claude API: an address on the internet that your own code sends requests to. It doesn't know your account. It wants an API key, and it bills for every use. Behind both doors are the same Claude models.
Anthropic's help center says it plainly: paid plans and the Claude Console are separate products, and the Claude API is billed separately. The Console, now at platform.claude.com, is where API keys and API billing live. A Pro subscription gives you no API key and no API balance.

Here's Ana's script. It uses Anthropic's official Python library. This line makes the client, and the client looks for a key in an environment variable named Anthropic API key: a setting the terminal hands to every program it starts, kept outside the code. Then it asks Claude Sonnet 5.5 for a one-sentence summary of the email, and prints it. Her Pro login lives in her browser and in the Claude apps. The script has no way to use it.
cat summarize.pyimport sys import anthropic email = open(sys.argv[1]).read() client = anthropic.Anthropic() # looks for ANTHROPIC_API_KEY reply = client.messages.create( model="claude-sonnet-5-5", max_tokens=300, system="You summarize customer emails for a small coffee shop.", messages=[{"role": "user", "content": "Summarize in one sentence:\n" + email}], ) print(reply.content[0].text)
Here's what that request does when it works. The script sends it to the API, with the key in a header. The API checks the key, and the account behind it. It passes the email to the model, and sends the summary back, with a count of the tokens used. Ana's script had no key at all, so the library stopped before sending anything.

So let's give it a key. The export command sets that environment variable in this terminal. Not to a real key, though: a made-up one, in the right shape. This time the request reaches Anthropic, and the API answers: error 401, invalid x-api-key. Only a key made in the Console works, and every key belongs to an API account with its own balance.
export ANTHROPIC_API_KEY=sk-ant-api03-FAKE0
python3 summarize.py emails/torn-bag.txtTraceback (most recent call last): File "/Users/chris/api-lab/summarize.py", line 6, in <module> reply = client.messages.create( model="claude-sonnet-5-5", ...<3 lines>... "content": "Summarize in one sentence:\n" + email}], ) File "/opt/homebrew/lib/python3.14/site-packages/anthropic/_utils/_utils.py", line 294, in wrapper return func(*args, **kwargs) File "/opt/homebrew/lib/python3.14/site-packages/anthropic/resources/messages/messages.py", line 1070, in create return self._post( ~~~~~~~~~~^ "/v1/messages", ^^^^^^^^^^^^^^^ ...<30 lines>... stream_cls=Stream[RawMessageStreamEvent], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/opt/homebrew/lib/python3.14/site-packages/anthropic/_base_client.py", line 1679, in post return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)) ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.14/site-packages/anthropic/_base_client.py", line 1230, in request return self._request(cast_to, options, stream=stream, stream_cls=stream_cls) ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.14/site-packages/anthropic/_base_client.py", line 1333, in _request raise self._make_status_error_from_response(response) from None anthropic.AuthenticationError: Error code: 401 - {'type': 'error', 'error': {'type': 'authentication_error', 'message': 'invalid x-api-key'}, 'request_id': 'req_011CgcbTPYj3HbtpaikxyMsE'}
What a plan pays for
So what does a plan pay for? A flat monthly price to use the Claude apps. Free costs nothing. Pro is twenty dollars a month, Max is a hundred, and Ultra is two hundred, each with more usage than the one before. Claude Code is included from Pro up.

A flat price isn't unlimited. Pro and Max have a five-hour session limit, and a weekly limit. And they're shared: chatting on the website and coding in Claude Code draw from the same allowance. Reach a limit, and you wait for it to reset.

Claude Code shows what a plan covers. Everything in this video is a real run, on our own laptop. We sent Ana's request through Claude Code instead: on-plan is a tiny script of ours that hands it the same model, instructions and email, signed in with a Pro plan, and no API key anywhere. It works: a one-sentence summary of Priya's torn bag. Claude Code also reports the size: 800 tokens in, including some of its own, and 61 out.
unset ANTHROPIC_API_KEY
./on-plan emails/torn-bag.txtPriya received order #4471 with a torn bag of Ethiopia Guji that spilled half its beans, and she's asking for a replacement bag while keeping the undamaged grinder. (tokens in: 800 · tokens out: 61) (signed in with: claude.ai · plan: pro)
What the API charges for
The API bills by the token. A token is a small piece of text, often part of a word. Each request has tokens in, everything you send, and tokens out, what the model writes back. Output costs five times more. Claude Haiku 5.5 is ten cents per million tokens in. Sonnet 5.5 is two dollars in, and ten out. Opus 5.5 is four in, and twenty out.

And the API is prepaid. In the Console, you buy credits first, and each request takes its cost out of that balance. Auto-reload can buy more when the balance gets low. When the credits run out, the API stops answering until you add more. Credits expire a year after you buy them.

Worried about a runaway bill? Prepaid credits are the first guard. In the Console's billing page, you can also set your own monthly spend limit: reach it, and the API refuses requests until next month, or until you raise it. Rate limits are a different guard: they cap how fast an account can send requests, not how much it spends. New accounts start with lower limits, which rise as they use the API.

What one email costs
So what would one summary cost on the API? Our little calculator uses the published list prices. 800 tokens in, at two dollars per million, 61 out, at ten dollars per million. One summary: about a fifth of a cent.
./price sonnet-5.5 800 61input 800 tokens x $2.00 per million = $0.001600 output 61 tokens x $10.00 per million = $0.000610 one request on sonnet-5.5: $0.002210
Say Kettle & Bean gets two hundred emails a day. That's 6,000 a month. On Sonnet 5.5, summarizing all of them comes to about thirteen dollars a month.

The model matters most. The same 6,000 summaries cost sixty-six cents on Haiku 5.5, about thirteen dollars on Sonnet, and about twenty-seven dollars on Opus.

Side by side, for Ana's job. Pro is twenty dollars a month for her own use, with usage limits. The API is pay as you go, about thirteen dollars on Sonnet for this job, limited by her credit balance and the API's rate limits. Pro is built for a person using Claude. The API is built for software calling Claude.

So why isn't the API simply part of Pro? Think about who's on the other end. A person can only type so fast, and a plan's limits keep one person's use inside a flat price. Software has no such ceiling. Her script might send 6,000 requests a month, or a copy of it on a busy website, six million. A flat price can't cover that, so the API charges for exactly what's used, token by token.

Max, Ultra and API credits
Now, one exception to the title. Pro includes no API credits. But Max includes a hundred dollars of API credits a month, and Ultra two hundred. Team plans get some too. It's still a separate balance: after seven days on the plan, you link a Console organization, which is your API account, in your plan's billing settings. And unused credits don't roll over: they expire at the end of each billing cycle.

Claude Code sits on both sides. Signed in with your Claude account, it uses your plan's limits. Given an API key instead, every request is paid per token from your credits. Those monthly Max and Ultra credits don't cover Claude Code used interactively, which already runs on the plan. Not sure which one it's using? Type slash status inside Claude Code: it shows how you're signed in.
Which one you need
So which one do you need? If you're the one using Claude, chatting, writing, or coding in Claude Code, a plan is simpler: one price, every month. If your own code calls Claude, a script, an app, anything that runs without you, you need the API: a key, and credits. Ana does both. She keeps Pro for herself, and her email script gets its own key, with a small balance.

Getting her script running takes four steps. Make a Console account at platform.claude.com. Buy a few dollars of credits. Create an API key. And put it in that environment variable, then run the script again.

One habit for that key: treat it like a password. Keep it in an environment variable, the way her script reads it. Never paste it into the code, and never commit it to Git. Anyone who has it can spend her credits.

Recap
Let's recap. Claude Pro pays for the Claude apps and Claude Code, signed in as you, for a flat price, with usage limits. The Claude API is a separate product for your own code: it needs an API key and prepaid credits, and it bills every token. Pro includes no API credits; Max and Ultra include some each month. And one of Ana's email summaries cost about a fifth of a cent on Sonnet.
If this cleared up where your Claude money goes, subscribing helps a small channel make the next one.
Every error and every token count here came from a real run, with a made-up key. Thanks for watching Cloud Explainers.
Sources
Demos: real runs on our own laptop with a made-up API key; the shop, its customers and orders are invented. Watch the full video on YouTube.