The Fastest Way to Get an Anthropic API Key
If you want to call Claude programmatically, you need an API key from Anthropic's developer console — not your regular claude.ai login. The short answer: go to console.anthropic.com, create an account (or sign in), add a payment method under billing, then generate a key from the API Keys page. That key, which starts with sk-ant-, gets passed in an x-api-key header on every request.
The part that trips people up isn't the sign-up itself — it's that the API console is a completely separate product from the Claude chat app you might already be paying for. A Claude Pro or Max subscription does not give you API access, and API usage is billed separately, per token, with no relationship to your chat subscription price. If you already have Claude access and just want to build something quickly without setting up a second billing account, there's a faster path covered further down.
Step 1: Create an Anthropic Console Account
- Go to
console.anthropic.com. - Sign up with an email address or Google account.
- Verify your email if prompted.
This console is distinct from claude.ai — different login system, different dashboard, different purpose. It's built for developers, not for chatting.
Step 2: Add a Payment Method
The API has no meaningful free tier for production use. You'll usually get a small amount of trial credit, but to send real traffic you need to:
- Open Settings → Billing in the console.
- Add a credit card.
- Optionally set a spend limit or usage alert so you don't get surprised by a bill.
Anthropic bills by tokens consumed, split between input and output, and the rate depends on which Claude model you use (Haiku, Sonnet, Opus). Larger context windows and longer conversations cost more because you're paying for every token sent and received, including system prompts and tool definitions.
Step 3: Generate the API Key
- Go to the API Keys section of the console.
- Click Create Key.
- Name it something identifiable, like
prod-serverorlocal-dev. - Copy the key immediately — you won't be able to view it again after you navigate away.
Store it as an environment variable, not hardcoded in source:
export ANTHROPIC_API_KEY="sk-ant-xxxxxxxxxxxxxxxx"
Step 4: Make Your First Request
A minimal 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-sonnet-4-5",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Say hello in one sentence."}]
}'
If you get a JSON response with a content array, your key works. Common failure points at this stage: forgetting the anthropic-version header, using the wrong header name (it's x-api-key, not Authorization: Bearer), or trying to call the API before billing is configured — you'll get a 400 or 403 instead of a real response.
Managing Keys, Limits, and Access
A few things worth knowing once the key is live:
- Rate limits scale with your usage tier, which increases automatically as you spend more over time. New accounts start with conservative limits.
- Multiple keys are useful for separating environments — one for local development, one for staging, one for production — so you can revoke a leaked key without breaking everything else.
- Team access requires inviting members to the console organization; keys aren't automatically shared, and each person or service typically gets its own.
- Usage dashboards in the console show token consumption and cost per day, broken down by model, which is the main way to catch a runaway loop before it becomes an expensive one.
When You Don't Want a Separate API Billing Setup
Setting up a standalone Anthropic API account makes sense if you're building a production product with its own budget and billing owner. But if you're a developer, freelancer, or small team that already has Claude access and just wants programmatic access — for a script, an internal tool, or a prototype — going through the full console-and-billing flow can feel like overhead for something you technically already pay for.
SubToAPI exists for that case: it turns your existing Claude access into a standard HTTPS API with its own application keys (sub_live_...), so you get streaming responses, tool use, and usage metadata without managing a separate Anthropic billing account. You generate a key from the dashboard and call it the same way you'd call any REST API:
curl https://api.subtoapi.app/v1/messages \
-H "Authorization: Bearer $SUBTOAPI_KEY" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-4-5",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Say hello in one sentence."}]
}'
Plans start at €9/month for solo use, with team seats at €19 and €49 for higher-usage tiers, and there's a free trial at /signup. If you're evaluating both routes, check /pricing and the /docs/quickstart guide to see how the request format compares to calling Anthropic directly — it's close enough that switching between them later is mostly a matter of changing the base URL and header.
Whichever path you take, the underlying model access is the same Claude models Anthropic runs. The decision is really about whether you want to own a separate API billing relationship or work through your existing access.
questions
Do I need a separate account from claude.ai to get an API key? Yes. The API key comes from console.anthropic.com, which is a different account system from the claude.ai chat app, even if you use the same email to sign up for both.
Is there a free Anthropic API key? New console accounts usually get a small amount of trial credit, but there's no ongoing free tier for production use — you need to add a payment method to send real traffic.
Can I use my Claude Pro subscription to call the API? No, a Claude Pro or Max subscription only covers the chat app and doesn't include API access. API usage is billed separately by tokens. Tools like SubToAPI offer a way to expose your existing Claude access as an API without a separate Anthropic billing setup.