Follow Discord
Sweep 03 Dec 2026 · 19:13Z Build v2.1.336 553 read Stable v2.1.332 Latest v2.1.336 Next v2.1.336 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · api

get-api-key changedget-api-key

Nearest release: v2.1.333, published 4 hours after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.

Recorded here
Lines+35added
Lines−21removed
From line 1 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits12to this page, all time

## Before you begin ## Create a Developer API key ## Use your Developer API key ## Next steps ## Choose a key type ## Create an API key ## Use your API key ## API keys and the Admin API

The whole hunk

from line 1, old and new numbered
/
lines
from line 1
11---
22title: Get your Claude API key
33url: https://platform.claude.com/docs/en/get-api-key
4description: Find, create, and manage your API keys for the Claude API in the Claude Console.
4description: Create a Developer API key for the Claude API in the Claude Console, store it safely, and set it in your environment.
55---
66 
7API keys for the Claude API (also called Anthropic API keys) live in the Claude Console. To view your existing keys or create a new one, go to the [API keys](https://platform.claude.com/settings/keys) page (`platform.claude.com/settings/keys`) in the Console.
7A Developer API key is a secret that lets your code call Claude. These steps create one in the Claude Console and set it in the `ANTHROPIC_API_KEY` environment variable, which the SDK and the CLI read.
88 
9## Choose a key type
9**Is this the key you need?** A Developer API key calls Claude, and an [Admin API key](https://platform.claude.com/docs/en/manage-claude/admin-api-keys) manages an organization. To compare them, see the [two kinds of API key](https://platform.claude.com/docs/en/manage-claude/authentication#api-keys).
1010 
11When you create a key, you choose its type, which determines what the key can do, where it works, and when it stops working. A **personal key** acts as you, and stops working if you leave an organization. A **service account key** represents a [service account](https://platform.claude.com/docs/en/manage-claude/workload-identity-federation#service-accounts), which can be used by workloads such as CI pipelines, production services, or agents. Use a personal key for your own development, and a service account key for anything shared.
11**You might not need a key.** To choose a method that doesn’t use one, see [Choose your path](https://platform.claude.com/docs/en/manage-claude/authentication#choose-your-path) on the Authentication page.
1212 
13You can also create a **workspace key**, a legacy key without an owner: it belongs to the workspace you create it in and keeps working after its creator leaves. It is preferable to use a personal or service account key, as these stop working automatically when their associated account is removed from the organization.
13## Before you begin
1414 
15## Create an API key
15Your role must allow you to create a key. To check which roles can, see [Who can create which key](https://platform.claude.com/docs/en/manage-claude/api-keys#who-can-create-which-key) on the Developer API keys page.
1616 
17## Create a Developer API key
18 
1719<Steps>
1820 <Step title="Sign in to the Claude Console">
19 Go to the Claude Console at [platform.claude.com](https://platform.claude.com/) and sign in, or create an account if you don’t have one yet.
21 Go to the [Claude Console](https://platform.claude.com/) and sign in or create an account if you don’t have one.
2022 </Step>
2123 
2224 <Step title="Open the API keys page">
23 In the Claude Console, go to the [API keys](https://platform.claude.com/settings/keys) page (`platform.claude.com/settings/keys`).
25 In the Claude Console, open the [API keys](https://platform.claude.com/settings/keys) page (`platform.claude.com/settings/keys`).
2426 </Step>
2527 
2628 <Step title="Create a key">
27 Click **Create key**, name the key, select an [expiration](https://platform.claude.com/docs/en/manage-claude/authentication#key-expiration), and set **Linked account** to yourself or a service account. You can also select a [workspace](https://platform.claude.com/settings/workspaces) in the Console to scope the key to.
29 Click **Create key**. If the dialog first offers other ways to connect, click **Somewhere else** or **Continue with an API key**. Then, name the key and choose its settings:
30 
31 * **Expires:** how long the key lasts. You can’t change it later (see [Key expiration](https://platform.claude.com/docs/en/manage-claude/api-keys#key-expiration) on the Developer API keys page).
32 
33 * **Linked account:** who the key acts as (see [Key types](https://platform.claude.com/docs/en/manage-claude/api-keys#key-types) on the Developer API keys page):
34 
35 * Your name, marked **(you)**, for a personal key.
36 * A service account, for a service account key. Only organization admins can pick one.
37 * **Not linked**, for a legacy workspace key. Don’t use it for new integrations.
38 
39 * **Scope:** the workspace the key works in. If the key needs several workspaces, choose **Organization**. With that choice, each Claude API request must name a workspace in the `anthropic-workspace-id` header (see [Select a workspace](https://platform.claude.com/docs/en/manage-claude/api-keys#select-a-workspace) on the Developer API keys page).
2840 </Step>
2941 
3042 <Step title="Copy and store the key">
31 The Console shows the full key, which starts with `sk-ant-`, only once, at creation. Copy it and store it somewhere safe, such as a secrets manager. If you lose a key, you can’t view it again in the Console. Create a new key instead.
43 The Console shows the full key only once. Copy it and store it somewhere safe, such as a secrets manager. If you lose it, create a new key.
3244 </Step>
3345</Steps>
3446 
35If the **Create key** button on the API keys page is disabled, your role might not allow you to create keys there. Ask an organization admin to change your role, or to create a service account key for your workload.
47If the **Create key** button is missing or disabled, your role might not allow it, or an organization admin might have turned off key creation. To find out why and what to do, see [Who can create which key](https://platform.claude.com/docs/en/manage-claude/api-keys#who-can-create-which-key) on the Developer API keys page.
3648 
3749These steps are for the Claude API. If you use Claude through a [cloud platform](https://platform.claude.com/docs/en/api/overview#claude-api-vs-cloud-platforms), follow that platform’s authentication steps instead.
3850 
39## Use your API key
51## Use your Developer API key
4052 
41Set the key as an environment variable:
53Set the key as an environment variable for your current shell session:
4254 
4355```bash
44export ANTHROPIC_API_KEY="sk-ant-api03-..."
56export ANTHROPIC_API_KEY="sk-ant-..."
4557```
4658 
47The [client SDK](https://platform.claude.com/docs/en/cli-sdks-libraries/overview) reads `ANTHROPIC_API_KEY` automatically. Direct HTTP requests send the key as `Authorization: Bearer <key>`. If your API key isn’t scoped to a workspace, you must also send the `anthropic-workspace-id` header on each Claude API request, as shown in [Select a workspace](https://platform.claude.com/docs/en/manage-claude/authentication#select-a-workspace). For the Admin API, see [API keys and the Admin API](https://platform.claude.com/docs/en/get-api-key#api-keys-and-the-admin-api).
59The SDK and the CLI read `ANTHROPIC_API_KEY` automatically. To set it for every new shell or on Windows, see [API key](https://platform.claude.com/docs/en/cli-sdks-libraries/cli/authentication#api-key) on the CLI authentication options page.
4860 
49To make your first request, follow the [Quickstart](https://platform.claude.com/docs/en/get-started), and see [Authentication](https://platform.claude.com/docs/en/manage-claude/authentication) for complete details, including short-lived credentials with Workload Identity Federation.
61To run the docs’ cURL samples with your key, see [Run the docs’ samples with a key](https://platform.claude.com/docs/en/manage-claude/api-keys#run-the-docs-samples-with-a-key) on the Developer API keys page.
5062 
51## API keys and the Admin API
63For key types, expiration, and key management with the Admin API, see [Developer API keys](https://platform.claude.com/docs/en/manage-claude/api-keys).
5264 
53The [Admin API](https://platform.claude.com/docs/en/api/organization) includes endpoints for managing your organization’s API keys programmatically, such as [Retrieve API Key](https://platform.claude.com/docs/en/api/organization/api_keys/retrieve) and [List API Keys](https://platform.claude.com/docs/en/api/organization/api_keys/list). These endpoints are for organization admins automating key management. They accept an [Admin API key](https://platform.claude.com/docs/en/manage-claude/admin-api-keys), an OAuth token with the `org:admin` scope, or a personal or service account key that isn’t scoped to a specific workspace; workspace keys don’t work there. They never return a key’s secret value, only a partially redacted hint.
65## Next steps
5466 
55<Note>
56 The Admin API can’t recover a lost key or give you a key to call the Claude API with. To get a usable API key, create one on the [API keys](https://platform.claude.com/settings/keys) page (`platform.claude.com/settings/keys`) in the Claude Console.
57</Note>
67<CardGroup cols={2}>
68 <Card title="Get started with Claude" icon="code" href="https://platform.claude.com/docs/en/get-started">
69 Make your first request to Claude.
70 </Card>
71</CardGroup>
5872 
Feedback