What Is My Anthropic API Key? How to Find It
If you're searching "what is my Anthropic API key," you're probably staring at a script or config file that expects a value like ANTHROPIC_API_KEY=sk-ant-... and you don't know what to put there. The short answer: your Anthropic API key is a unique secret string, generated in the Anthropic Console, that authenticates your requests to Claude's API. It is not the same as your claude.ai login password, and it is not something Anthropic emails you — you have to generate it yourself.
This article walks through exactly what that key is, where to find or create it, and what to do if you can't locate one.
Your API key is not your account login
A common source of confusion: people who use Claude at claude.ai assume that account automatically gives them API access, or that their password is the key. It doesn't work that way.
- claude.ai is the consumer chat app, tied to your email/password or SSO login.
- console.anthropic.com is a separate developer account (sometimes linked to the same email) where you manage billing, usage, and API keys.
- An API key is a credential generated inside the console, scoped to a specific organization/workspace, used only for programmatic access.
So if you've only ever used Claude through the website, you don't have an API key yet — you need to create one.
What the key actually looks like
Anthropic API keys follow this pattern:
sk-ant-api03-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Key characteristics:
- It's shown to you once, at creation time. After that, the console only shows a truncated version (e.g.,
sk-ant-...ab12). - It's tied to a workspace inside your organization, which determines billing and rate limits.
- It has no built-in expiration, but you can revoke it manually at any time.
- Anyone with the key can make billed requests as you — treat it like a password, not a username.
Where to find (or create) it
- Go to
console.anthropic.comand sign in. - Open the API Keys section (usually under Settings or a dedicated left-nav item).
- If you already generated one earlier, you'll see a list of key names with truncated values — the full string is not retrievable again.
- If there's no key listed, click Create Key, give it a name (e.g., "local-dev" or "prod-server"), and copy the full value immediately into a secure place.
If you can't find the API Keys section at all, check that you're in the right organization — consoles can have multiple orgs/workspaces attached to one email, and keys are scoped per workspace.
Using it correctly
Once you have the key, the standard way to use it is as an environment variable, not hardcoded in source:
export ANTHROPIC_API_KEY="sk-ant-api03-your-real-key"
const response = await fetch("https://api.anthropic.com/v1/messages", {
method: "POST",
headers: {
"x-api-key": process.env.ANTHROPIC_API_KEY,
"anthropic-version": "2023-06-01",
"content-type": "application/json"
},
body: JSON.stringify({
model: "claude-sonnet-4-20250514",
max_tokens: 1024,
messages: [{ role: "user", content: "Hello Claude" }]
})
});
Notice the header is x-api-key, not Authorization: Bearer — a detail that trips people up if they're used to other APIs.
If you have team access but no console access
Sometimes "what is my Anthropic API key" comes from a different angle: you're on a team plan, a coworker set up Claude access, and you need to build something that calls Claude on the company's behalf — but you don't have console admin rights to generate your own key.
In that situation, a few options:
- Ask a console admin to create a key scoped to a workspace you're allowed to bill against, and share it securely (never over chat/email in plaintext).
- Use per-user keys with per-key spend limits, if your org has that set up, so usage is attributable.
- If your team wants each developer or app to have its own manageable key without everyone touching the raw Anthropic console, a layer like SubToAPI sits on top of a Claude subscription and issues its own application keys (
sub_live_...) per app or team member, with usage and seat management in one dashboard. It's a different key from your Anthropic key — you generate it at/signupand use it the same way you'd use a normal API key in your code, pointed athttps://api.subtoapi.app/v1/messages.
curl https://api.subtoapi.app/v1/messages \
-H "Authorization: Bearer $SUBTOAPI_KEY" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-4-20250514",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Hello Claude"}]
}'
Full request/response shapes are in the docs and the quickstart.
Keeping your key safe
Whichever key you end up using:
- Never commit it to a public repo.
- Rotate it immediately if it leaks — old keys can be revoked instantly in the console without affecting other keys.
- Use separate keys per environment (dev/staging/prod) so a compromised dev key doesn't touch production billing.
- Store it in a secrets manager or
.envfile excluded from version control, not in code.
FAQ
Is my Anthropic API key the same as my claude.ai password? No. Your claude.ai login authenticates the chat app. Your API key is a separate secret generated in the Anthropic Console specifically for programmatic access, and the two are not interchangeable.
Why can't I see my full API key anymore after creating it? Anthropic only displays the complete key value once, at creation time, for security. Afterward the console shows a truncated version. If you lost the full string, generate a new key and revoke the old one.
I don't have console access — how do I get an API key for my team's Claude account? Ask your organization's console admin to generate a key for you, or use a service like SubToAPI that issues per-user application keys tied to a shared Claude subscription, without giving everyone raw console access.