Skip to content
Academy ofAI Learning

How to get a Claude API key, and whether your Claude plan includes one

Where to create a Claude API key, whether it is free, why a Pro plan does not include the API, which plans come with monthly API credits, the three kinds of key, and how to keep yours safe.

Last checked 20 November 2026

The short answer

A Claude API key comes from the Claude Console at platform.claude.com, not from the Claude app. Sign in or create a Console account, open the API keys page at platform.claude.com/settings/keys, select Create key, and copy the key straight away: the Console shows it only once. Keys start with sk-ant-.

The API is billed separately from Claude Pro and the other chat plans. New Console users get free credits to test it, and after that you buy prepaid credits. Max, Ultra and Team plans include monthly API credits; Free, Pro and Enterprise do not. Every fact on this page was checked on Anthropic's own pages on 20 November 2026.

Create your key, step by step

1. Sign in to the Claude Console. Go to platform.claude.com and sign in, or create an account if you do not have one.

2. Open the API keys page. It is at platform.claude.com/settings/keys.

3. Create the key. Select Create key, give it a name, choose when it expires, and set Linked account to yourself. Pick a workspace to scope it to as well (the section on key types explains why).

4. Copy and store it. The full key is shown once, when you create it. Keep it in a password manager or a secrets manager. If you lose it you cannot view it again, so create a new key instead.

If the Create key button is greyed out, your role in the organisation does not allow you to create keys. Ask an organisation admin to change your role, or to create a service account key for you.

Is a Claude API key free?

Creating a key costs nothing, and Anthropic says new users receive free credits to test the API. Anthropic does not describe any ongoing free tier: after those credits, the API is pay as you go. You buy prepaid credits on the Billing page (platform.claude.com/settings/billing), and each request is charged by the tokens it uses at that model's price.

You are billed only for successful requests. Purchased credits expire one year after you buy them and are non-refundable. Auto-reload can top your balance up when it falls below a level you choose. If your credits run out, API calls stop until you add more.

Does Claude Pro include an API key?

No. Anthropic treats its chat plans and the Console as separate products. A paid plan covers Claude on the web, desktop and mobile, and the Claude API is billed separately. Paying for Pro gives you no API credit.

Max, Ultra and Team plans do include monthly credits for the Claude Platform. You claim them on claude.ai under Settings, then Billing (Organization settings for a Team) by linking one Console organisation, once you have been on the plan for seven days. You do not need to add a card in the Console to use them.

PlanMonthly API credit
FreeNone
ProNone
Max$100
Ultra$200
Team$20 per Standard seat and $100 per Premium seat, pooled and capped at $500
EnterpriseNone

What the monthly credits cover

The credits work with the Claude API (the Messages API and Message Batches API), the Playground in the Console, Claude Managed Agents and the Claude Agent SDK.

They do not cover interactive Claude Code in the terminal, IDE, desktop or web, extra usage in the Claude apps, or Claude through Amazon Bedrock, Google Cloud Vertex AI or Microsoft Foundry. Unused credit expires at the end of each billing cycle, and the monthly credit is spent before any credit you have bought.

Do you need an API key for Claude Code?

Not if you have a paid plan. Claude Code works with a Pro, Max or Ultra plan: install it and sign in with your Claude account. Anthropic warns that if an ANTHROPIC_API_KEY environment variable is set, Claude Code uses that key instead of your subscription, so you pay API rates instead of using your plan.

If you meant to use your plan, remove that variable, then run /login inside Claude Code and sign in with the account that has your plan.

Personal, service account or workspace key?

When you create a key you choose its type, and the type decides what it acts as and when it stops working.

Scope the key to a workspace when you create it. If a key is not scoped to a workspace, every direct API request must also send an anthropic-workspace-id header. A scoped key saves you that step.

Key typeActs asUse it for
Personal keyYou, with your roles and permissionsYour own development and scripts. It stops working if you leave the organisation.
Service account keyA service accountAnything shared or automated, such as a production app or a CI pipeline
Workspace key (legacy)No one: it belongs to the workspaceOlder set-ups. Anthropic prefers the other two types for new work.

Use the key safely

Set the key as an environment variable instead of writing it into your code. The official SDKs read ANTHROPIC_API_KEY automatically, and direct HTTP requests send the key as Authorization: Bearer <key>.

Treat the key like a password. Never paste it into a chat, a screenshot, a shared document or a Git repository. If you think it has leaked, create a new key and disable the old one in the Console straight away.

For production apps on AWS, Google Cloud or Azure, Anthropic also supports Workload Identity Federation, which replaces a stored key with short-lived tokens from your cloud provider.

Mac, Linux or WSL
export ANTHROPIC_API_KEY="sk-ant-api03-..."
Windows PowerShell
$env:ANTHROPIC_API_KEY = "sk-ant-api03-..."

Learn to build with it

Our free Level 6 lessons go from your first API call to tool use, structured outputs and prompt caching, each with a hands-on step. Our qualifications are our own. They are not a Claude certification, and the Academy of AI Learning is independent: we are not affiliated with or endorsed by Anthropic.

Sources