How to Get an Anthropic API Key for Claude Access
If you want to build with Claude programmatically — in an app, a script, a backend service — you need an API key issued through the Anthropic Console. This is separate from your claude.ai chat login. A ChatGPT-style subscription to Claude Pro or Max does not automatically give you API access; the API is billed and provisioned independently, through its own account and its own credit balance.
This guide covers what "getting a key" actually involves: creating a developer account, setting up billing, generating the key, and the gotchas that trip people up (verification limits, org permissions, and the fact that your Claude.ai plan and your API account are two unrelated things). It also covers a shortcut for people who already pay for Claude and don't want to set up a second billing relationship.
The Anthropic account you need
There are two distinct Anthropic products:
- Claude.ai — the chat interface, billed via Free/Pro/Max subscriptions.
- Anthropic API (Console) — the developer platform at console.anthropic.com, billed by token usage, with no relation to your claude.ai subscription tier.
Signing up for Claude Pro doesn't create an API account, and having an API key doesn't give you Claude Pro features on the chat site. If your goal is "call Claude from my code," the API account is what you need, and it involves a separate signup and separate payment method.
Step-by-step: creating the key
- Create a Console account. Go to console.anthropic.com and sign up with an email address or Google account. This is independent of any claude.ai login you may already have, even if you use the same email.
- Verify your identity. New API accounts typically require phone number verification before you can generate a key. This is an anti-abuse measure and applies per account.
- Add a payment method. The API has no permanent free tier for production use — some accounts get a small trial credit, but ongoing usage requires a credit card on file and a positive balance. Go to the Billing section and add a card.
- Create an API key. Under Settings → API Keys, click to generate a new key. It will look like
sk-ant-...and is shown only once — copy it immediately into a password manager or secrets store.
- Set usage limits (optional but recommended). The Console lets you cap monthly spend so a runaway script or a bug in a retry loop doesn't produce a surprise bill.
- Test the key. A minimal request confirms everything is wired up correctly:
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-sonnet-4-5",
"max_tokens": 100,
"messages": [{"role": "user", "content": "Say hello in one sentence."}]
}'
If this returns a JSON response with a content array, your key works and billing is active.
Common blockers
Phone verification fails or is unavailable. Some regions have restrictions on which numbers Anthropic accepts. There's no official workaround beyond trying a different number or contacting support — this is one of the more common reasons people can't finish signup.
Card declined or region not supported for billing. Anthropic's billing coverage isn't universal. If your card or billing address is in a country the API doesn't currently support, you won't be able to add a payment method, which blocks key generation for real usage.
Org vs. personal accounts. If you're added to a company's Console organization, you may not have permission to create keys yourself — that's often reserved for admins. Check with whoever set up the org.
Rate limits on new accounts. Freshly created accounts usually start on lower rate and spend limits than established ones. These increase over time based on usage history, not something you can request upfront in most cases.
If you already pay for Claude and just want API access
A lot of people search for "how to get an Anthropic API key" because they're already paying for Claude Pro or Max and assumed that included API access — then discover it doesn't. Setting up a second account, going through phone verification again, and adding a second payment method just to make a few API calls is friction that isn't always worth it, especially for smaller projects or prototypes.
SubToAPI is built for exactly that gap: it turns your existing Claude access into a normal HTTPS API without opening a separate Anthropic Console account. You sign up, generate an application key (sub_live_...), and start making requests — no phone verification flow, no separate billing setup for the underlying model access.
const response = await fetch("https://api.subtoapi.app/v1/messages", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.SUBTOAPI_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "claude-sonnet-4-5",
max_tokens: 200,
messages: [{ role: "user", content: "Summarize this in two sentences." }]
})
});
Streaming and tool use work the same way you'd expect from a Claude-compatible API — see /docs/streaming and /docs/tools for details. Plans start at Solo €9/month, with Team (€19/seat) and Scale (€49/seat) tiers adding multi-user dashboards and shared usage tracking — see /pricing. There's a free trial at /signup, and /docs/quickstart walks through your first authenticated request in a few minutes.
Whether you go through the Anthropic Console directly or through a layer like SubToAPI depends on your situation: if you're building a production product at scale with dedicated infrastructure budget, the direct Console route gives you the most control. If you're prototyping, building an internal tool, or already paying for Claude and don't want a second billing relationship, the faster path is worth considering.
questions
Does a Claude Pro or Max subscription include API access? No. Claude.ai subscriptions and the Anthropic API are billed and provisioned separately. You need a Console account with its own payment method to get an API key, or a service like SubToAPI that connects to your existing Claude access instead.
Is the Anthropic API key free to use? Some new accounts receive a small trial credit, but there's no ongoing free tier for production use — you need a card on file and pay per token once the trial credit runs out.
Why can't I finish signing up for an API key? The two most common blockers are failed phone verification and unsupported billing regions. Both are account-level restrictions with no direct workaround beyond retrying with different details or contacting Anthropic support.