Claude API Token: What It Means and How to Use One
"Claude API token" gets searched for two genuinely different reasons, and mixing them up wastes time. Sometimes people mean an authentication token — the secret string you put in an Authorization header to prove your requests are yours. Other times they mean tokens as in the unit Claude uses to measure text — the thing you're billed on and the thing that determines whether your prompt fits in the context window.
This article covers both, because you'll eventually need to understand each one: the token that gets you into the API, and the tokens that make up everything you send and receive once you're in.
Authentication tokens: how you access the Claude API
To call Claude's API directly through Anthropic, you generate an API key in the Anthropic Console. It looks like sk-ant-api03-... and functions as a bearer token — anyone who has it can make requests billed to your account, so it's treated like a password, not a public identifier.
A typical authenticated request looks like this:
curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "claude-opus-4-5",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Summarize this in one sentence: ..."}]
}'
Notice the header is x-api-key, not the more common Authorization: Bearer. That's a small but frequent source of confusion — copy-pasting boilerplate from an OpenAI integration and expecting it to work with Claude will fail silently or return a 401.
If you're building a product on top of Claude rather than calling Anthropic directly, you'll usually want application-scoped tokens instead of one shared secret. This is where a proxy layer like SubToAPI is useful: it takes your existing Claude access and issues you sub_live_... API keys per app or environment, so you're not passing your root credential around to every service, script, and teammate.
curl https://api.subtoapi.app/v1/messages \
-H "Authorization: Bearer $SUBTOAPI_KEY" \
-H "content-type: application/json" \
-d '{
"model": "claude-opus-4-5",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Summarize this in one sentence: ..."}]
}'
Standard Authorization: Bearer header, standard JSON body, and you can revoke a single sub_live_ key without touching anything else. See /docs/quickstart for the full setup and /docs/messages for the request schema.
Usage tokens: what Claude is actually counting
The other meaning of "token" is the unit Claude's tokenizer breaks text into — roughly three to four characters of English on average, though it varies by language and content. Every request has two token counts that matter:
- Input tokens — your system prompt, message history, tool definitions, and any documents or images you send
- Output tokens — what Claude generates in response
Both count toward your context window limit and both are billed, usually at different rates (output tokens typically cost more per token than input tokens).
Why this matters practically
- Context window limits: if your conversation history plus your prompt exceeds the model's context window, the request fails. Long-running chat apps need to trim or summarize history before this happens.
- Cost: usage tokens are the billing unit. A request with a 5,000-token document attached costs meaningfully more than a short question, even with the same output length.
- Latency: more input tokens means more processing before the first output token appears, which matters for streaming UX. See /docs/streaming if you're building anything interactive.
Estimating token counts before you send a request
You won't always want to send a request just to find out how many tokens it costs. A rough rule of thumb — roughly 4 characters or 0.75 words per token for English text — gets you close enough for budgeting and UI warnings ("this document is too long"). For exact counts, check the usage field returned in every response:
{
"id": "msg_01...",
"usage": {
"input_tokens": 342,
"output_tokens": 128
}
}
If you're using SubToAPI, this same usage object comes back on every call, and it's aggregated across your team in the dashboard so you can see which app, key, or teammate is driving usage without reconstructing it from raw logs.
Putting both together
In practice, a well-built integration handles both kinds of tokens deliberately: an auth token that's scoped and revocable per use case, and a usage-token budget that's tracked so nobody gets surprised by a bill or a truncated context window. Neither is hard on its own, but conflating them — for example, hardcoding one shared auth token across five services and then wondering why usage tracking is a mess — is a common early mistake.
If you want application-level API keys, usage visibility, and streaming/tool support without building the auth and metering layer yourself, /pricing has the current plans — Solo at €9, Team at €19/seat, Scale at €49/seat — all with a free trial at signup.
FAQ
Is a Claude API token the same as an API key?
When people say "token" they usually mean the API key used as a bearer credential in requests. It's a different concept from "tokens" as the text-counting unit used for billing and context limits — same word, two meanings.
How many tokens is a typical prompt?
Roughly 4 characters or 0.75 words per token for English text is a workable estimate. For exact numbers, use the usage field returned in the API response rather than guessing.
Do input and output tokens cost the same?
No. Output tokens are typically priced higher per token than input tokens, since generation is more compute-intensive than processing existing text. Check current model pricing before estimating costs for high-output use cases.