To get a Claude API key, sign in to the Claude Console at platform.claude.com, open the API keys page, click Create key and copy the key. It takes a few minutes. The key is also called an Anthropic API key, because Anthropic makes Claude and the SDKs read it from a variable named ANTHROPIC_API_KEY. They are the same thing.
Creating the key costs nothing. Using it is billed per token from prepaid credits. This guide covers the steps, the current prices, what is and is not free, a working code example and the errors people hit first. Facts were checked against Anthropic's docs on November 20, 2026.
What a Claude API Key Is (and Isn't)
A Claude API key is a secret string, starting with sk-ant-api, that lets your code call Claude. Every request made with it is metered per token and billed to your Claude Console organization.
The Claude API and the Claude apps are separate products with separate billing. A Claude subscription is for a person using claude.ai or Claude Code. An API key is for software: a backend, a script, an agent, a CI job.
| Claude subscription | Claude API key | |
|---|---|---|
| Where you sign up | claude.ai | platform.claude.com (Claude Console) |
| Who it is for | A person chatting or coding | Your own apps and scripts |
| How you pay | Flat monthly plan | Per token, from prepaid credits |
| Includes the other? | Max, Ultra and Team include some monthly API credit. Free and Pro do not. | No. API credit does not unlock the apps. |
You also do not strictly need an Anthropic key to use Claude models. Claude is available on Amazon Bedrock, Google Cloud and Microsoft Foundry, where you sign in with that cloud's credentials and the usage lands on your cloud bill. That matters if you already hold AWS Activate or Google Cloud startup credits.
How to Get a Claude API Key: Step by Step
Step 1: Create a Claude Console account. Go to platform.claude.com and sign up, or sign in if you have one. Use your company email rather than a personal address, so the organization belongs to the company and not to whoever signed up first.
Step 2: Open the API keys page. It is at platform.claude.com/settings/keys. This is the answer to "where do I find my Claude API key": keys are created and managed here, and nowhere in the claude.ai chat app.
Step 3: Click Create key. The form asks for four things.
| Field | What to choose |
|---|---|
| Name | Where the key will live, such as "prod-backend" or "ci-eval" |
| Expiration | 3 hours, 1 day, 7 days, 30 days, a custom length, or Never. It cannot be changed later. |
| Linked account | Yourself for a personal key, or a service account for anything shared or automated |
| Workspace | Scope the key to one workspace. A key that is not scoped needs a workspace ID header on every request. |
Step 4: Copy the key and store it. Put it in a password manager or your platform's secret store as soon as it is created. If you lose track of a key, delete it and make a new one.
Step 5: Set the environment variable. Anthropic's SDKs and CLI read the key from ANTHROPIC_API_KEY. Export it in your shell or add it to your deployment secrets. Do not paste it into source code.
Step 6: Add credits. Most organizations pay with prepaid usage credits, bought on the Billing page at platform.claude.com/settings/billing. Anthropic asks for some details about your organization and use case, then a payment method. Credits expire one year after purchase and are non-refundable. If the balance reaches zero, API calls stop until you add more, so consider auto-reload for anything in production.
Step 7: Make a test request and set a spend limit. Run the example below, then set a monthly spend limit at platform.claude.com/settings/spend-limits before you deploy anything that loops.
Using Your Claude API Key: First Request
Set the key once in your shell:
export ANTHROPIC_API_KEY="your-api-key-here"
Python. Install the SDK with pip install anthropic, then:
import anthropic
client = anthropic.Anthropic() # reads ANTHROPIC_API_KEY
message = client.messages.create(
model="claude-haiku-5-5",
max_tokens=1000,
messages=[{"role": "user", "content": "Hello, Claude"}],
)
for block in message.content:
if block.type == "text":
print(block.text)
curl. No SDK needed:
curl https://api.anthropic.com/v1/messages \
-H "content-type: application/json" \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2026-10-21" \
-d '{
"model": "claude-haiku-5-5",
"max_tokens": 1000,
"messages": [{"role": "user", "content": "Hello, Claude"}]
}'
The example uses Claude Haiku 5.5 because it is the cheapest current model, so a test costs a fraction of a cent. For TypeScript, install @anthropic-ai/sdk and the call has the same shape. If you get text back and the request shows on the Console's Usage page, the key works.
What a Claude API Key Costs to Use
The key itself is free. Usage is billed per million tokens, with input and output priced separately. These are Anthropic's list prices for the current models as of November 20, 2026.
| Model | API ID | Anthropic's description | Input / 1M tokens | Output / 1M tokens |
|---|---|---|---|---|
| Claude Fable 5.2 | claude-fable-5-2 | Demanding reasoning and long-horizon agentic work | $8 | $40 |
| Claude Opus 5.5 | claude-opus-5-5 | Long-running agentic coding and knowledge work | $4 | $20 |
| Claude Sonnet 5.5 | claude-sonnet-5-5 | The best combination of speed and intelligence | $2 | $10 |
| Claude Haiku 5.5 | claude-haiku-5-5 | High-volume, latency-sensitive tasks | $0.10 | $0.50 |
The Haiku 5.5 rate applies to prompts up to 100,000 tokens. Longer prompts are $0.50 input and $2.50 output. Anthropic's docs suggest starting with Opus 5.5 for most workloads if you are unsure.
Older models are still on sale: Fable 5.1 at $10 and $50, Opus 5 at $5 and $25, Sonnet 5 at $2 and $10, and Haiku 4.5 at $1 and $5.
Two discounts apply to every model. The Batch API is 50 percent off for work that can wait. Prompt cache reads cost 10 percent of the input price or less (5 percent on Opus 5.5 and Sonnet 5.5, 2.5 percent on Fable 5.2).
For a sense of scale, at list price:
| Workload | Model | Tokens | Cost |
|---|---|---|---|
| One short exchange | Sonnet 5.5 | 500 in, 200 out | About $0.003 |
| 10,000 support tickets | Haiku 5.5 | 3,000 in, 700 out each | About $6.50 |
| One long agent session | Opus 5.5 | 50,000 in, 15,000 out | About $0.50 |
A million tokens is roughly 555,000 English words on current models. Our Claude API pricing page goes deeper on caching and batch, and Claude pricing compares the subscription plans.
Is There a Free Claude API Key?
The key is always free to create. The usage mostly is not. Unlike Google's Gemini API, the Claude API has no ongoing free tier. These are the real ways to use it without paying, as of November 2026.
| Route | What you get | Who can use it |
|---|---|---|
| New account test credit | Anthropic's pricing docs say new users receive free credits to test the API. The amount is not published. | New Console users |
| Credits included with a Claude plan | $100 a month on Max, $200 on Ultra, up to $500 pooled on Team | Max, Ultra and Team subscribers. Not Free, Pro or Enterprise. |
| Cloud startup credits | Claude usage on Amazon Bedrock or Google Cloud, paid from your cloud credits | Startups in AWS Activate or Google for Startups |
| Claude for Startups | Closed to new applicants | Existing members only |
Credits included with a Claude plan. This is the route most people miss. If you already pay for Max, Ultra or Team, link a Console organization under Billing settings on claude.ai and the credits arrive each billing cycle, with no payment method needed on the Console side. New subscribers can claim after seven days on the plan. Unused credits expire at the end of each cycle, and they do not cover Claude Code.
Cloud startup credits. Run Claude through Amazon Bedrock or Google Cloud and the usage bills to your cloud account, where AWS Activate or Google for Startups credits apply. You use the cloud's credentials rather than a Claude API key.
Claude for Startups. Anthropic's startup program closed to new applicants on October 13, 2026. Its page says the current cohort is full and it is not accepting new applications. Existing members keep their access. Our Anthropic program page has a notify-me form if you want to hear when it reopens.
What does not exist: a promo code, an unlimited free tier, or a site that can legitimately give you a "free Claude API key." Keys posted on GitHub or sold in forums belong to someone else's account and get disabled. If you need a card-free API to prototype on, our free AI APIs comparison lists the providers that have a real free tier.
Rate Limits and Usage Tiers
Limits belong to your organization, not to the key. Anthropic places each organization in a usage tier based on usage history and account standing, and moves it up automatically over time.
| Tier | Monthly spend cap | Opus 5.5 requests per minute |
|---|---|---|
| Start | $500 | 4,000 |
| Build | $1,000 | 10,000 |
| Scale | $200,000 | 13,000 |
| Custom | None | Arranged with Anthropic |
New organizations may begin in an Evaluation tier with limits below Start while account history builds. Your current tier and limits are on the Rate limits page in the Console (platform.claude.com/usage/limits), which also has a Request tier increase button.
Each model also has input and output token limits per minute. Tokens read from the prompt cache do not count toward the input limit, so caching raises your real throughput as well as lowering your bill.
Common Claude API Key Errors
From Anthropic's API errors reference. The official SDKs retry rate limits and server errors twice by default.
| Error | What it means | Fix |
|---|---|---|
| 401 authentication_error | Key is malformed, revoked or expired | Check the environment variable. Expired keys cannot be reactivated, so create a new one. |
| "Your credit balance is too low to access the Anthropic API" | No credits left in the organization | Buy credits or turn on auto-reload on the Billing page |
| 402 billing_error | Problem with billing or payment details | Check payment details in the Console |
| 400 "not scoped to a workspace" | The key is not tied to one workspace and the request has no workspace ID | Add the anthropic-workspace-id header, or create a key scoped to a workspace |
| 400 "reached your specified API usage limits" | You hit a spend limit you set yourself | Raise or remove the limit under Spend limits |
| 403 permission_error | The key cannot use that resource | Check organization access and workspace settings |
| 429 rate_limit_error | Rate limit, a sharp jump in usage, or the tier's monthly spend cap | Wait for the retry-after time and ramp up gradually. If there is no retry-after header it is the spend cap: request a tier increase. |
| 529 overloaded_error | The API is temporarily overloaded | Retry with backoff |
One more that confuses people: a 401 that starts "CORS requests are not allowed for this Organization" is not a bad key. It means the request came from a browser. Send it from your backend instead.
Keeping Your Claude API Key Safe
Never ship a key to the client. Anyone who uses a web page can read a key in that page's code. Calls to the Claude API should go through your backend.
Keep keys out of git. Add your .env file to .gitignore and use your platform's secret store for deployments. If a key is committed, disable or delete it on the API keys page straight away. Disable is reversible; delete is permanent.
Set an expiration. A key that expires in 30 days limits how long a leak stays useful. Anthropic emails the creator before longer-lived keys expire.
One key per environment and service. Scope each key to its own workspace and give the workspace a spend limit, so a leak or a bug has a ceiling. Use a service account key for anything shared: a personal key stops working when that person leaves the organization.
Lock down where it works. The Console supports IP allowlisting. For production on AWS, Google Cloud or Azure, Anthropic recommends Workload Identity Federation, which replaces the static key with short-lived tokens.
Frequently Asked Questions
Is the Claude API key free?
Creating a Claude API key is free. Using it is not: requests are billed per token from prepaid credits. Anthropic's docs say new users receive free credits to test the API, without publishing an amount, and Max, Ultra and Team plans include monthly API credit. There is no ongoing free tier.
Where do I find my Claude API key?
In the Claude Console, on the API keys page at platform.claude.com/settings/keys. Keys are not shown anywhere in the claude.ai chat app. If you no longer have a key's value, delete it there and create a new one.
Is a Claude subscription the same as API access?
No. Claude Pro, Max, Ultra and Team are subscriptions for the Claude apps and Claude Code. API access is a separate Claude Console account billed per token. Max, Ultra and Team include some monthly API credit you can claim by linking a Console organization; Free and Pro include none.
Is a Claude API key the same as an Anthropic API key?
Yes. Anthropic is the company and Claude is the model, so both names refer to the key you create in the Claude Console. The SDKs read it from the ANTHROPIC_API_KEY environment variable.
How do I get a Claude API key?
Sign in at platform.claude.com, open the API keys page, click Create key, then choose a name, an expiration and a workspace. Copy the key, store it in a secrets manager and set it as ANTHROPIC_API_KEY.
How much does the Claude API cost per request?
It depends on tokens and model. As of November 2026, a short exchange of 500 input and 200 output tokens on Claude Sonnet 5.5 costs about $0.003, and a long agent session on Claude Opus 5.5 with 50,000 input and 15,000 output tokens is about $0.50. See our Claude API pricing page for more.
Can I use my Claude API key with Claude Code?
Yes. Sign Claude Code in with your Console account and usage bills per token to that organization. Or sign in with a Claude subscription and usage draws from the plan instead. The API credits included with Max, Ultra and Team plans do not cover Claude Code. Our Claude Code pricing guide compares the two.
Can startups still get free Claude API credits?
Not through a new application right now. Claude for Startups closed to new applicants on October 13, 2026, and existing members keep their access. Startups with AWS or Google Cloud credits can run Claude on those clouds instead. Our Anthropic program page has a notify-me form for when it reopens.
Next Steps
Create the Console account on your company domain, make a key scoped to a workspace with an expiration, and run the test request. Set a spend limit before you deploy. If you already pay for Max, Ultra or Team, claim the included API credit first. Then check the Claude API pricing page to model what production will cost, and the Anthropic program page for the startup program's status.