In short
- Claude API keys, also called Anthropic API keys, live on the API keys page of the Claude Console, at platform.claude.com/settings/keys. Read on Get your Claude API key (Claude API docs) (opens in a new tab)
- The Console shows the full key, which starts with sk-ant-, only once, at creation. If you lose it, you create a new key. Read on Get your Claude API key (Claude API docs) (opens in a new tab)
- Direct HTTP requests send the key as Authorization: Bearer, and the client SDKs read it from the ANTHROPIC_API_KEY environment variable. Read on Authentication (Claude API docs) (opens in a new tab)
- Anthropic says new users receive free credits to test the API, and you buy credits or manage payment methods on the Console’s Billing page. Read on Pricing (Claude API docs) (opens in a new tab)
- A Claude key runs the model. PrimaryAPI gives the agents you build on Claude public data from social platforms, maps and filings through one more key.
How to get a Claude API key, step by step
These are Anthropic’s own steps, as its docs give them in November 2026.
- Go to the Claude Console at platform.claude.com and sign in, or create an account if you don’t have one yet. Read on Get your Claude API key (Claude API docs) (opens in a new tab)
- Open the API keys page at platform.claude.com/settings/keys. Read on Get your Claude API key (Claude API docs) (opens in a new tab)
- Click Create key, name the key, select an expiration, and set Linked account to yourself or to a service account. You can also pick a workspace to scope the key to. Read on Get your Claude API key (Claude API docs) (opens in a new tab)
- Copy the key, which starts with sk-ant-, and store it somewhere safe such as a secrets manager. The Console shows it only this once. Read on Get your Claude API key (Claude API docs) (opens in a new tab)
- Set it as the ANTHROPIC_API_KEY environment variable, which the client SDKs read automatically. Read on Get your Claude API key (Claude API docs) (opens in a new tab)
Personal, service account and workspace keys
When you create a key you choose its type. A personal key acts as you and stops working if you leave the organization. A service account key belongs to a service account, for workloads such as CI pipelines, production services or agents. Read on Get your Claude API key (Claude API docs) (opens in a new tab)
Workspace keys are legacy keys without an owner that keep working after their creator leaves. Anthropic recommends personal and service account keys for new integrations, because they stop working when their account is removed. Read on Authentication (Claude API docs) (opens in a new tab)
A key that isn’t scoped to a workspace must send the anthropic-workspace-id header on every request. A key created for one workspace can leave it out. Read on Authentication (Claude API docs) (opens in a new tab)
If the Create key button is disabled, your role might not allow creating keys. Ask an organization admin to change your role, or to create a service account key for your workload. Read on Get your Claude API key (Claude API docs) (opens in a new tab)
Expiry, spend limits and billing
Each key gets an expiration when you create it: a preset of 3 hours, 1 day, 7 days or 30 days, a custom duration, or Never. It can’t be changed afterwards, and requests with an expired key return a 401 error. Read on Authentication (Claude API docs) (opens in a new tab)
Every organization sits in a usage tier with a monthly spend cap, and you can set your own lower limit on the Spend limits page of the Console. Read on Rate limits (Claude API docs) (opens in a new tab)
Anthropic says new users receive free credits to test the API. To buy credits or manage payment methods, use the Billing page at platform.claude.com/settings/billing. Read on Pricing (Claude API docs) (opens in a new tab)
| Usage tier | Monthly spend cap |
|---|---|
| Start | $500 |
| Build | $1,000 |
| Scale | $200,000 |
| Custom | No cap; limits are arranged with the account team |
Make your first request with the key
Requests go to https://api.anthropic.com with the key as Authorization: Bearer, an anthropic-version header and content-type: application/json. The older x-api-key header still works in place of Authorization. Read on API overview (Claude API docs) (opens in a new tab)
Anthropic’s quickstart sends a POST to /v1/messages with a model, max_tokens and a messages array, and Claude answers with a JSON message. Read on Get started with Claude (Claude API docs) (opens in a new tab)
The client SDKs send the authentication, version and content-type headers for you, so with ANTHROPIC_API_KEY set you only write the request itself. Read on API overview (Claude API docs) (opens in a new tab)
Keep your Claude API key safe
Anyone with the key can spend from your organization, so these rules from Anthropic’s docs are worth following from day one.
- Store keys in a secrets manager, rotate them periodically, and disable or delete any key you suspect has leaked. Read on Authentication (Claude API docs) (opens in a new tab)
- Disable is reversible and Delete is permanent; an expired key can only be deleted. Read on Authentication (Claude API docs) (opens in a new tab)
- Call the Claude API from your own back end, not from code that runs in your users’ browsers, where anyone can read the key. Read on Authentication (Claude API docs) (opens in a new tab)
- An expiration limits how long a leaked key stays usable, and IP allowlisting limits where it works. Read on Authentication (Claude API docs) (opens in a new tab)
- Never paste the key into a chat or a prompt. Keep it in your environment or your tool’s settings.
Give your Claude agent data with one more key
A Claude API key runs the model. When the agent you build also needs facts from the web, such as Reddit threads, YouTube transcripts, X posts or Google Maps places, PrimaryAPI returns them as JSON with one key and one balance of credits.
Connect PrimaryAPI’s MCP server in Claude Code or Claude Desktop and the agent can search the catalog, check a price and run an API on its own. Give it a key with a spend limit, and you only pay when data comes back.
Try it with PrimaryAPI
One key for every API below, for your code and your AI agents. You only pay when data comes back.
- Reddit SearchSearch Reddit posts across all subreddits by query, with sort order and time window, cursor paged2 credits / call
- YouTube TranscriptExisting captions of a YouTube video or Short as plain text plus timed segments, by URL or ID2 credits / call
- Google Maps SearchSearch Google Maps for places matching a query in a free-text location and get up to 20 normalised places with rating, address, phone, website and coordinates2 credits / call
- GitHub RepositoryMetadata of one public GitHub repository1 credit / call