Get a key from Anthropic, step by step
- Sign in to the Claude Console at platform.claude.com, or create an account. The Console is Anthropic's site for developers, separate from the Claude chat app.
- Add credits. The API is prepaid: on the Billing page, click Buy credits and enter an amount. Until there's a balance, requests fail with "Your credit balance is too low to access the Anthropic API". Credits expire a year after purchase and aren't refundable.
- Create the key. On the API keys page, click Create key, name it, pick an expiration and set Linked account to yourself, or to a service account for anything shared, such as a server or CI. You can also scope the key to a workspace.
- Copy it now. The full key starts with
sk-ant-and is shown only once. Store it in a password manager or your secrets manager. If you lose it, you can't view it again: create a new one.
If Create key is greyed out, your role in the organization can't create keys; ask an admin.
Test the key
Set it as ANTHROPIC_API_KEY, which the Anthropic SDKs read on their own, and send one short message:
export ANTHROPIC_API_KEY="sk-ant-..."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-opus-5-5", "max_tokens": 64, "messages": [{"role": "user", "content": "Say hello"}]}'A JSON reply with Claude's text means the key works. A key that isn't scoped to a workspace also needs the anthropic-workspace-id header on every request, so scoping it to a workspace when you create it is simpler.
What a Claude API key costs
The key itself is free. Each request is billed per token from your credit balance, at these list prices per 1M tokens:
| Model | Input | Output | On Zurelay (in / out) |
|---|---|---|---|
| Claude Fable 5.1 | $10.00 | $50.00 | $3.50 / $17.50 |
| Claude Opus 5.5 | $4.00 | $20.00 | $1.40 / $7.00 |
| Claude Sonnet 5.5 | $2.00 | $10.00 | $0.90 / $4.50 |
| Claude Haiku 5.5 | $0.10 | $0.50 | $0.04 / $0.20 |
Anthropic also caps what an organization can spend each month by usage tier: $500 on Start, $1,000 on Build and $200,000 on Scale. New organizations may begin on a lower Evaluation tier, and limits rise as you use the API, or sooner with Request tier increase on the Console's Rate limits page. At the cap, requests stop until the first of the next month.
Do Claude Pro or Max include an API key?
Claude Pro doesn't include any API use: the API is a separate product, billed through the Console. Max and Team do include monthly API credits:
| Plan | API credit each month |
|---|---|
| Free, Pro, Enterprise | None |
| Max 5x | $100 |
| Max 20x | $200 |
| Team | $20 per Standard seat, $100 per Premium seat, up to $500 |
To claim them, open Settings → Billing on claude.ai and link a Console organization, at least seven days after subscribing. They expire at the end of each billing cycle, and they cover the API, the Agent SDK and the Console playground but not Claude Code.
Claude Code and API keys
- With a Pro or Max plan you don't need a key. Run
claudeand log in with your claude.ai account; usage counts against your plan's limits. - If
ANTHROPIC_API_KEYis set, Claude Code uses it once you approve it, ahead of your subscription, and every token is billed at API rates. To go back to your plan, unset the variable and check/status. - For CI and scripts,
claude setup-tokenmakes a one-year token for your subscription, or use an API key and pay per token.
How the plans and the API compare for Claude Code is on Claude Code pricing.
Is there a free Claude API key?
Not from the Console: Anthropic's billing help mentions no free credits for new accounts, and the free claude.ai plan is chat only. The only included API credit is the monthly allowance on Max and Team. Be wary of sites handing out "free Claude keys": shared keys get revoked, and some cheap endpoints serve a different model under Claude's name (how to check is in what cheap AI APIs are really selling).
Keep the key safe
- Keep it on the server. A key in front-end code, a mobile app or a public repository is visible to anyone.
- Give each project its own workspace with a spend limit, so one leak or loop can't drain the whole balance.
- Set an expiration and rotate keys you've shared.
- If a key leaks, delete it on the API keys page and create a new one.
Another way: one key for Claude and every other model
A Zurelay key works where an Anthropic key does, through the same Messages API, and costs less per token (65% below Anthropic's list on Opus 5.5). Sign up, add credit from $10 and create a key; it starts with zr_live_. Then point the request at Zurelay:
curl https://api.zurelay.com/v1/messages \ -H "x-api-key: $ZURELAY_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -H "content-type: application/json" \ -d '{"model": "claude-opus-5-5", "max_tokens": 64, "messages": [{"role": "user", "content": "Say hello"}]}'The same key reaches GPT, Gemini, DeepSeek and the rest through an OpenAI-compatible endpoint, so one balance covers every model. Zurelay serves the Messages API itself, not Anthropic's Batches or Files APIs; if you need those, or an agreement with Anthropic, go direct. The Anthropic API alternative page compares the two.
Steps, credits and plan rules read from Anthropic's API key docs, rate limits, API credits for Max and Team and Claude Code authentication on October 28, 2026.