← Blog

What Is My Anthropic API Key? How to Find It

2026-09-03 · 4 min read · SubToAPI Team

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.

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:

Where to find (or create) it

  1. Go to console.anthropic.com and sign in.
  2. Open the API Keys section (usually under Settings or a dedicated left-nav item).
  3. If you already generated one earlier, you'll see a list of key names with truncated values — the full string is not retrievable again.
  4. 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:

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:

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.

Turn your Claude access into an HTTPS API

SubToAPI gives you application API keys, streaming, tool use and usage insights on top of your existing Claude access — set up in minutes.

Start free  Read the quickstart →