// Models · API key guide
Anthropic API key (Claude Console)
Keys are generated in the Claude Console (platform.claude.com). API usage is paid with prepaid credits.
5 stepsofficial docs onlychecked 2026-10-26
01How to get a Anthropic Claude API key
- Create a Claude Console account at platform.claude.com.
- Try models in the Workbench / playground (platform.claude.com/playground) if you like.
- Settings → API keys → Create key; pick the workspace it belongs to.
- Billing → “Buy credits” – without credits you cannot call the API.
- Call https://api.anthropic.com/v1/messages with headers x-api-key and anthropic-version: 2023-06-01.
Official key page: https://platform.claude.com/settings/keys – console labels may change; follow what the official page shows.
02Real-name, phone and credit card requirements
| Real-name / ID verification | Not mentioned in the docs we checked. |
|---|---|
| Phone number | Not mentioned in the docs we checked (以官方为准). |
| Credit card / payment | You must buy prepaid credits before using the API (payment on the Console billing page). Organisations with invoicing are billed monthly. |
03Base URL and a minimal call
https://api.anthropic.comANTHROPIC_API_KEY · Example model:claude-haiku-5-5curl
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-haiku-5-5",
"max_tokens": 256,
"messages": [{"role": "user", "content": "Hello"}]
}' Python
# pip install anthropic
import anthropic
client = anthropic.Anthropic() # reads ANTHROPIC_API_KEY
msg = client.messages.create(
model="claude-haiku-5-5",
max_tokens=256,
messages=[{"role": "user", "content": "Hello"}],
)
print(msg.content[0].text) 04Free quota
All free AI APIs →No free tier is described in the official billing article: usage is paid with prepaid credits, and when they run out you can no longer call the API. Claude Max and Team plans include monthly API credits when you link a Console organisation.
05Anthropic Claude API prices
All model prices →| Model | Input / 1M tokens | Output / 1M tokens | Source |
|---|---|---|---|
Claude Haiku 5.5claude-haiku-5-5 | $0.1 | $0.5 | official · 2026-10-10 |
Claude Haiku 3.5claude-3-5-haiku | $0.8 | $4 | official · 2026-10-10 |
Claude Haiku 4.5claude-haiku-4-5 | $1 | $5 | official · 2026-10-10 |
Claude Sonnet 5.5claude-sonnet-5-5 | $2 | $10 | official · 2026-10-10 |
Claude Sonnet 5claude-sonnet-5 | $2 | $10 | official · 2026-10-10 |
Claude Sonnet 4.6claude-sonnet-4-6 | $3 | $15 | official · 2026-10-10 |
Claude Sonnet 4.5claude-sonnet-4-5 | $3 | $15 | official · 2026-10-10 |
Claude Sonnet 4claude-sonnet-4 | $3 | $15 | official · 2026-10-10 |
Standard (non-batch) list prices from our price database; cheapest first, max 8 rows. Prices change – the official page wins.
06Keep your API key safe
- Use workspace-scoped keys so a key only works in its workspace, and set spend limits on the Billing page.
- Anthropic serves only the countries on its supported list – check it before signing up.
- Keep the key in an environment variable or a secrets manager – never hard-code it, never commit it to Git, never paste it into a screenshot, chat or issue.
- Never put a long-lived key in front-end, mobile or desktop client code – anyone can extract it. Call the API from your own server.
- One key per project or environment, so a leak can be revoked without breaking everything else.
- If a key leaks, delete it in the console immediately and create a new one, then check usage and billing.
- Do not buy keys from resellers or “API relays” and do not paste your key into websites you do not trust.
07FAQ
FAQ
Where is the Anthropic Console?
platform.claude.com (keys at platform.claude.com/settings/keys).
Is there a free Claude API key?
The official billing article describes prepaid credits only; without credits the API cannot be called. Max/Team plans include monthly API credits.
Which headers does the Claude API need?
x-api-key (or Authorization: Bearer), anthropic-version: 2023-06-01 and content-type: application/json.
08Official sources
- Claude API · Overview platform.claude.com
- Claude · Models overview platform.claude.com
- How do I pay for my Claude API usage? support.claude.com
All facts checked against these pages on 2026-10-26. If anything differs, the official page wins.