Skip to content

How to get an Anthropic API key

Create a Claude API key from the Anthropic console, set workspace limits, and verify it in seconds.

Published 1/15/2026

Getting an Anthropic API key takes about as long as making a coffee. The interesting part is what you do with workspaces and spend limits before you hand the key to your code.

Sign in

Go to console.anthropic.com. If you've used Claude.ai for chatting, that's a separate product — you'll still need to authenticate the developer console with the same email, but billing and rate limits live here, not there.

Anthropic gives new accounts a small block of starter credits. They expire on a clock, not on usage, so don't sit on them.

Create a workspace

Workspaces are Anthropic's mechanism for isolating environments. The default workspace is fine for tinkering, but for anything production-grade you want at least dev and prod, with their own keys, spend limits, and rate-limit ceilings.

From the sidebar pick Settings → Workspaces → Create workspace. Give it a clear name. Set a monthly spend cap right then; you can change it later, but having a number in place from minute one prevents accidents.

Generate the key

Switch into the new workspace, then open API Keys. Click Create Key, name it (kf-prod-2026 works), and copy it. The format is sk-ant-api03-.... As with every API key on every platform, this is the one and only chance you'll get to see the full value.

Drop the key straight into your secret manager. Do not paste it into Slack, even your private DMs to yourself, even if you trust your team — Slack message history is searchable by anyone with admin access and many companies surface DMs in legal holds.

Verify

Paste the key into the Anthropic tester. We hit /v1/models through a stateless proxy, return the list of Opus / Sonnet / Haiku variants you have access to, and time the call. A typical response from a US-deployed account is under 250ms.

If you get back a 403, your workspace probably needs model access enabled. From the workspace settings, toggle on the model families you want.

Headers, not Bearer

One detail that trips people up: Anthropic uses an x-api-key header, not Authorization: Bearer. The Anthropic SDK handles this for you. If you're calling raw HTTP, remember to also send anthropic-version: 2023-06-01 (the date is a header value, not a path version).

Prompt caching is the cheap trick

If your prompts have a long static prefix — a system prompt, a tool spec, a long retrieval context — turn on prompt caching. Cached input tokens cost ~10% of normal input price. The savings on a real workload are usually 60–80% off the bill.

What to do next

Read the security best practices and the OpenAI vs Anthropic pricing guide if you're choosing between the two. Then go ship.

Related guides