How to get a Claude API key (December 2026): step by step
Get a Claude (Anthropic) API key in the Claude Console in five steps. There is no free tier and credits start at $5, but here are the real ways to get credit.
To get a Claude API key, sign in to the Claude Console, open the API keys page, click Create key, choose an expiration, owner and workspace, then copy the key (it is shown only once). Before the key can make calls, your organization needs credits: the Claude API has no free tier, and the minimum credit purchase is $5.
A "Claude API key" and an "Anthropic API key" are the same thing. The steps below take about five minutes. After them come billing, workspaces, rate limits, keeping the key safe, and the legitimate ways to get free credit.
How to create a Claude API key, step by step
1. Create a Claude Console account
Go to platform.claude.com and sign up or sign in. The Console is separate from the claude.ai chat subscription: a Pro plan does not include API usage, so you set up billing here even if you already pay for Claude.
2. Add credits
Anthropic's help center says you will fill in some details about your organization and use case, then add a payment method and fund the account. In the Console, go to Billing, click Buy credits, enter an amount (at least $5) and confirm. Credits are available immediately.
If you have a Claude Max, Ultra or Team plan, you can skip the card and claim the plan's monthly API credits instead (covered in the free credit section below).
3. Open the API keys page and click Create key
In the Console, open API keys (platform.claude.com/keys/api-keys) and click Create key. If the dialog first offers other ways to connect, click Somewhere else or Continue with an API key.
4. Choose the key's settings
| Setting | What to pick |
|---|---|
| Name | Something that says where the key is used, such as prod-backend or local-dev |
| Expires | 3 hours, 1 day, 7 days, 30 days, a custom date, or Never. You cannot change it later |
| Linked account | Your name for a personal key. A service account for shared or unattended workloads (only organization admins can pick one). Avoid Not linked, which creates a legacy workspace key |
| Scope | One workspace, or Organization if the key must work in several. Organization-scoped keys need an anthropic-workspace-id header on every request |
A personal key acts as you and stops working when you leave the organization. A service account key keeps working when people leave, which is what you want for production.
5. Copy the key and store it
The Console shows the full key once. Put it in a secrets manager or your hosting provider's encrypted environment variables. If you lose it, create a new one.
6. Test it
Set the key as an environment variable and send a request. The official SDKs and the ant CLI read ANTHROPIC_API_KEY automatically.
export ANTHROPIC_API_KEY="sk-ant-..."
curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2026-10-21" \
-H "content-type: application/json" \
-d '{
"model": "claude-haiku-5-5",
"max_tokens": 256,
"messages": [{"role": "user", "content": "Hello, Claude"}]
}'
Claude Haiku 5.5 is the cheapest current model, at $0.10 per million input tokens, so a test call costs a fraction of a cent. Full per-model prices are in our Claude API pricing guide.
If Create key is missing or greyed out, your role may not allow it, or an admin may have turned off key creation on the Console's Security page. Ask an organization admin.
Do you even need an API key?
Often not. Anthropic now recommends keyless sign-in in several cases:
- On your own computer: run
ant auth loginwith the Anthropic CLI. It opens your browser and stores a short-lived token for one workspace. - In CI or on a server with an identity provider (GitHub Actions, AWS, Google Cloud, Kubernetes): use Workload Identity Federation, which needs no stored secret.
- In an iOS or macOS app: use App Attest instead of shipping a key in the app.
- For Claude Code: every paid Claude plan includes Claude Code, so you can sign in with your subscription instead of paying per token. Our Claude Code pricing guide compares the two.
An API key is still the right choice for servers without an identity provider and for third-party tools that ask for one.
Is there a free Claude API key?
No. Anthropic's pricing docs say it plainly: the Claude API has no free tier or self-serve trial, and new accounts do not include free credits. Any site offering a "free Claude API key" is not Anthropic (more on that below).
These are the legitimate ways to use the API without paying per token out of pocket:
| Route | What you get | Who qualifies |
|---|---|---|
| Claude Max plan | $100 a month in API credits | Max subscribers, after 7 days on the plan |
| Claude Ultra plan | $200 a month in API credits | Ultra subscribers, after 7 days |
| Claude Team plan | $20 per Standard seat, $100 per Premium seat, pooled, up to $500 a month | Team owners, after 7 days |
| Claude Startups VC route | Up to $100K in additional API credits | Startups backed by a VC in Anthropic's partner network |
| AI for Science | Up to $20,000 in API credits for 6 months | Researchers at academic and nonprofit institutions |
| Enterprise trial | Not published | Companies evaluating the API for enterprise use, through sales |
Subscription credits are claimed on claude.ai under Settings > Billing (Max, Ultra) or Organization settings > Billing (Team) by linking a Console organization. They cover the Claude API, Managed Agents, the Agent SDK and the Console playground, but not Claude Code, and they expire at the end of each billing cycle. Our guide to Claude credits covers every route, including cloud credits.
How billing works
- Prepaid credits. Most organizations buy credits up front. Purchased credits cover the API, the playground and Claude Code used through the Console.
- Auto-reload. On the Billing page you can set a balance that triggers an automatic top-up, and the amount to reload to.
- Expiry and refunds. Purchased credits expire one year after purchase and are non-refundable.
- What gets charged. Only successful calls. A request that was going to succeed is still charged if your client disconnects or times out.
- Running out. When the balance hits zero, API calls fail until you add credits.
- Order. Monthly plan credits are spent first, then purchased credits.
- Invoicing. Monthly invoicing is available through Anthropic's sales team.
Workspaces: organize keys by project
Every Console organization has a default workspace that cannot be renamed, archived or deleted. You can create up to 1,000 more. Use them to separate projects or environments (development, staging, production), each with its own members, keys, spend limit and rate limits.
Two things to know:
- When someone first signs in to Claude Code with a Console account, Anthropic creates a Claude Code workspace automatically to keep that traffic separate.
- Archiving a workspace cannot be undone and archives every key created for it within seconds.
Claude API rate limits and usage tiers
Anthropic places organizations on usage tiers automatically, based on usage history and account standing. New organizations may start in an Evaluation tier with limits below the standard ones, which rise as you build history. Each tier also has a monthly spend cap:
| Tier | Monthly spend cap | Claude Sonnet 5.5 and Opus 5.5 limits (RPM / input TPM / output TPM) |
|---|---|---|
| Start | $500 | 4,000 / 2,000,000 / 400,000 |
| Build | $1,000 | 10,000 / 5,000,000 / 1,000,000 |
| Scale | $200,000 | 13,000 / 10,000,000 / 2,000,000 |
| Custom | None (set with sales) | Custom |
RPM is requests per minute; TPM is tokens per minute. Cached input tokens do not count toward the input limit. When you hit the spend cap, requests return a 429 error until 00:00 UTC on the first of the next month, unless you click Request tier increase on the Console's Rate limits page.
Linking a Max, Ultra or Team plan moves the organization to at least the Start tier, and to at least Build if the monthly credit is over $200.
How to keep your Claude API key safe
Anthropic compares an API key to a credit card number: anyone who has it can run up charges on your account. The basics:
- Never put a key in source control, client-side code or a prompt. Call Claude from your back end, not from the browser.
- Use a secrets manager or your host's encrypted environment variables. If you use a local
.envfile, add it to.gitignore. - Set an expiration and rotate keys on a schedule. Anthropic's help center suggests every 90 days as an example.
- Use separate keys for development, testing and production, so you can kill one without breaking the others.
- Set spend limits on each workspace so a leaked key or a runaway script has a ceiling.
- Turn on IP allowlisting (in beta) to limit where a leaked key works.
- Be careful with third-party tools. Pasting your key into a web tool gives its developer access to your Console account.
GitHub scans public repositories for Claude API keys. If it finds one, Anthropic automatically deactivates the key and emails you. Since October 2026, GitHub push protection also blocks commits containing Anthropic keys by default in repositories with secret scanning on.
If a key leaks, delete it on the API keys page (deleting is permanent; disabling can be undone), create a new one, deploy it, and check the Usage and Logs pages for activity you do not recognize. Check every workspace and every Console organization you belong to.
Avoid "free Claude API key" scams
Search "free Claude API key" and you will find sites, Discord servers and GitHub repos offering working keys. Anthropic does not hand out free keys, so these are either someone else's leaked key or not a real key at all. Using one means running up charges on another person's account without permission, and keys exposed in public GitHub repos are deactivated automatically, so they tend to stop working without warning.
The other risk runs the other way. A site that asks you to paste in your key to "unlock free credits" now has access to your account. Real free credit only comes from Anthropic's own programs and plans in the table above, or from cloud startup programs.
If you are a startup, the best free-credit routes are below. AWS Activate credits can pay for Claude on Amazon Bedrock, which uses AWS credentials instead of an Anthropic key.
Questions
Is an Anthropic API key the same as a Claude API key?
Yes. Anthropic makes Claude, and the key you create in the Claude Console (platform.claude.com) is used for the Claude API at api.anthropic.com. The SDKs read it from the ANTHROPIC_API_KEY environment variable.
Can I use my Claude Pro subscription for the API?
No. Anthropic says the Pro plan does not include API usage through the Claude Console. Max, Ultra and Team plans include monthly API credits ($100, $200 and up to $500) that you claim by linking a Console organization.
What does a Claude API key look like?
A Developer API key starts with sk-ant-. Anthropic also has Admin API keys for managing an organization, but those cannot call Claude.
Why does my new API key return a credit balance error?
The key works, but the organization has no credits. Buy credits on the Billing page in the Claude Console (minimum $5) or link a Max, Ultra or Team plan to get its monthly API credits.
How long does a Claude API key last?
You choose when you create it, from 3 hours, 1 day, 7 days or 30 days to a custom date or never. The expiration cannot be changed later, and an expired key has to be replaced with a new one.
Programs in this guide
Sources
- platform.claude.com/docs/en/get-api-key
- platform.claude.com/docs/en/manage-claude/api-keys
- platform.claude.com/docs/en/manage-claude/authentication
- platform.claude.com/docs/en/manage-claude/workspaces
- docs.claude.com/en/api/getting-started
- docs.claude.com/en/api/rate-limits
- docs.claude.com/en/docs/about-claude/pricing
- platform.claude.com/docs/en/about-claude/api-credits-for-subscribers
- support.claude.com/en/articles/8977456-how-do-i-pay-for-my-claude-api-usage
- support.claude.com/en/articles/9767949-api-key-best-practices-keep-your-keys-safe-and-secure
- support.claude.com/en/articles/8325606-what-is-the-pro-plan
- github.blog/changelog/2026-10-13-secret-scanning-blocks-anthropic-keys-by-default-adds-salesforce
- claude.com/programs/startups
Related guides
- Claude API pricing (December 2026): cost per million tokens
Claude API pricing for December 2026: Opus 5.5 is $4 in and $20 out per million tokens, Sonnet 5.5 $2 and $10, Haiku from $0.10. Caching, batch and a calculator.
- Claude Code pricing (December 2026): plans, API costs and free options
Claude Code pricing: it is not free. It comes with Pro ($20 a month), Max ($100), Ultra ($200), Team, Enterprise or API billing. Real costs and how to cut them.
- Claude credits: every legitimate way to get Anthropic API credits
Claude for Startups is closed to new applicants, but VC-backed founders can still get up to $100K in Claude API credits. Here is every other route too.
- Claude Max (December 2026): price, usage limits and is it worth it?
Claude Max costs $100 a month for 5x Pro usage, Claude Code, Fable models and $100 in API credits. Limits, Max vs Pro vs Ultra, and when the API is cheaper.