- Home
- Learn
- Deep Dives
- How to Get a Claude API Key
How to Get a Claude API Key
Create a Claude API key in the Console, store it safely, make a first call and know what it costs. Checked against Anthropic docs on 15-10-2026.
Published 15-10-2026. Steps last checked against the Anthropic documentation on 15-10-2026 and reviewed monthly.
Quick answer
This page is for the developer or small team that needs a working Claude API key today, for a script, a CI job or a product feature. Sign in to the Claude Console, open the API keys page at platform.claude.com/settings/keys, click Create key, name it, choose an expiration and copy the key. The Console shows the full key, which starts with sk-ant-, only once. Store it in a secrets manager and export it as ANTHROPIC_API_KEY. The rest of this page covers which key type to pick, the first call, what that call costs and what to do if the key leaks.
How we checked the information in this article
Our gate: a step goes in only if it appears on an Anthropic documentation page we read on 15-10-2026. We did not redo the walkthrough from a fresh account, so we show no Console screenshots and we cannot vouch for button labels beyond what the docs say. The gate keeps out any minimum credit purchase and any free-credit amount, because the pages we read did not state them.
We sell skills that load into Claude Code, Cursor, Codex CLI and Copilot, and we name a few of ours where they protect your key. No vendor paid to be listed here.
How do you create a Claude API key step by step?
Four steps, per the Anthropic page "Get your Claude API key". First, sign in to the Claude Console at platform.claude.com, or create an account. Second, open the API keys page. Third, click Create key, name it, choose an expiration and set the Linked account to yourself or a service account, and optionally scope it to a workspace. Fourth, copy the key and store it somewhere safe, because you cannot view it again later. If you lose it, create a new one.
If the Create key button is disabled, the docs say your role may not allow it. Ask an organization admin to change your role or to create a service account key for your workload. We would send that message on day one rather than hunting for a workaround.
Which key type should you pick? Our recommendation matches the docs: a personal key for your own development and a service account key for anything shared. Personal keys act as you and stop working when you leave the organization, which we count as a feature, because keys should not outlive the people who own them. The legacy workspace key has no owner and keeps working after its creator leaves, so we would avoid it for new work.
Is a Claude API key the same as an Anthropic API key?
Yes. Claude is Anthropic's model family, and the key you create in the Claude Console is the key the official SDKs read from the ANTHROPIC_API_KEY environment variable. It works for the Claude API directly; keys for Bedrock and Vertex AI come from AWS and Google Cloud instead.
Is there a free Claude API key?
We could not confirm a free tier or free credit amount on the Anthropic pages we read on 15-10-2026, so we do not state one. A Claude subscription is a separate product from API billing. The Claude pricing page lists Max plans with $100 or $200 a month in API credits, but Free and Pro do not list API credits. Check the Console billing page for your own account before you plan around credits. For what usage costs after that, see our Claude API pricing guide, and our comparison of AI coding agent costs for how it compares with other coding agents.
Where do you store a Claude API key?
In a secrets manager, per the docs, and in an environment variable on the machine that runs the code. Export ANTHROPIC_API_KEY and the official SDKs read it automatically, so the key never appears in your source. Direct HTTP requests send it in a request header instead. Our rule is simple: a key never goes in a repository, a chat message or a screenshot, and every repository gets a scanner.
The Secret Scanner skill scans repositories for leaked secrets, API keys and tokens, according to its listing. Secret Shield identifies and redacts API keys, connection strings and high-entropy secrets from logs and code before they ship, per its listing, and Secrets Hygiene keeps keys, cards and bank details out of chat, Slack and email. We have not tested these three against live keys, so run them on a test repository first. More options sit in our security skills, and our SKILL.md security guide explains how we check skills before listing them.
How do you make a first call to the Claude API?
Follow the Anthropic quickstart. Export the key, create a project, install the SDK and send one message. The Python version needs pip install anthropic, a client created with anthropic.Anthropic() and a call to client.messages.create with a model name, a max_tokens value and your messages. The quickstart lists examples for cURL, the CLI, Python, TypeScript, C#, Go, Java, PHP and Ruby, and on 15-10-2026 its example uses the model claude-opus-5-5.
What does that call cost? We calculated it from list prices on the Anthropic pricing page of 15-10-2026: Claude Opus 5.5 charges $4 per million input tokens and $20 per million output tokens. A prompt of about 30 tokens with max_tokens set to 1000 costs at most about $0.02, since the output cap is the only large number. This is our calculation, not a measured invoice line. If you want a cheaper test, Claude Haiku 5.5 lists $0.10 and $0.50 per million tokens. For savings tips, the guide to reducing token usage covers savings inside Claude Code today.
Once the call works, wrap it properly. The APIs and backend skills help you build the service around it.
What limits apply to a new key?
Limits belong to the organization, not the key. The Anthropic rate limit page sets a monthly spend cap per tier: $500 for Start, $1,000 for Build and $200,000 for Scale. The first table on that page, which we read as the Start tier, lists 1,000 requests per minute for Claude Opus 5.5 with 2,000,000 input tokens and 400,000 output tokens per minute. The page also says new organizations may start in an Evaluation tier with lower limits, and we could not confirm those numbers. Set your own monthly limit on the Billing page in the Console below the cap, so a bug cannot spend the whole tier. The LLM ops skills help you measure what your calls do in production. Our finance and accounting skills help when the next step is booking that spend.
How do you rotate a Claude API key or handle a leak?
The docs say to rotate keys periodically and to disable or delete any key you suspect has leaked. On the API keys page, Disable is reversible and Delete is permanent. Expired keys can only be deleted, and setting an expiration at creation limits how long a leaked key stays usable, which is why we would never create a non-expiring key by habit. If a key reached a public repository, treat it as compromised: disable it first, create a replacement, update your secrets manager and then search your history.
Anthropic also lists Workload Identity Federation for production workloads on AWS, Google Cloud, Azure, CI/CD and Kubernetes, which exchanges your identity provider's token for a short-lived credential so there is no static secret to leak. We have not set it up ourselves. If your workload already has a platform identity, it is the option we would evaluate first for production, and our DevOps and cloud skills cover the surrounding infrastructure work. Keys for Bedrock and Vertex AI are issued by AWS and Google Cloud, not in the Claude Console, so use your cloud provider's documentation for those. Our guide to Claude on Bedrock, Vertex AI and Foundry compares those routes.
What to do next
Create a personal key with an expiration, store it, run the quickstart once and set a monthly limit. Anthropic changes its Console and docs, so verify each step against the current docs before you rely on this page. If you are starting with Claude Code instead of the API, our Claude Code beginners guide is the next read.
Written by Samuel Rose, Founder of Agensi. Next scheduled review: 15-11-2026.
Sources
All read on 15-10-2026.