--- url: "https://platform.claude.com/docs/en/get-api-key" titulek: "Get your Claude API key - Claude Platform Docs" h1: "Get your Claude API key" popis: "Find, create, and manage your API keys for the Claude API in the Claude Console." jazyk: "en" kanonicka: "https://platform.claude.com/docs/en/get-api-key" drobecky: ["Messages", "Get your Claude API key"] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-13 21:20:07" znaku: 3487 slov: 532 kodovani: "utf-8" sha256: "8c59fa566b750a6a28c25f6549685b3b8a015a040b0de5562622d4124f3a7830" --- API 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 [Settings → API keys](https://platform.claude.com/settings/keys). ## Choose a key type When 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](/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. You 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. ## Create an API key 1. 1 Sign in to the Claude ConsoleGo to [platform.claude.com](https://platform.claude.com/) and sign in, or create an account if you don't have one yet. 2. 2 Open the API keys pageGo to [Settings → API keys](https://platform.claude.com/settings/keys). 3. 3 Create a keyClick **Create key**, name the key, choose an [expiration](/docs/en/manage-claude/authentication#key-expiration), and set **Linked account** to yourself or a service account. You can also choose a [workspace](https://platform.claude.com/settings/workspaces) to scope the key to. 4. 4 Copy and store the keyThe 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. If the **Create key** button on the API keys page is disabled, your role may 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. ## Use your API key Set the key as an environment variable: ``` export ANTHROPIC_API_KEY="sk-ant-api03-..." ``` The [client SDKs](/docs/en/cli-sdks-libraries/overview) read `ANTHROPIC_API_KEY` automatically. Direct HTTP requests send the key in the `x-api-key` header. If your API key works on multiple workspaces, you must also send the `anthropic-workspace-id` header on each Claude API request, as shown in [Select a workspace](/docs/en/manage-claude/authentication#select-a-workspace). For the Admin API, see API keys and the Admin API. To make your first request, follow the [Quickstart](/docs/en/get-started), and see [Authentication](/docs/en/manage-claude/authentication) for the full picture, including short-lived credentials with Workload Identity Federation. ## API keys and the Admin API The [Admin API](/docs/en/api/admin) includes endpoints for managing your organization's API keys programmatically, such as [Retrieve API Key](/docs/en/api/admin/api_keys/retrieve) and [List API Keys](/docs/en/api/admin/api_keys/list). These endpoints are for organization admins automating key management. They accept an [Admin API key](/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. Was this page helpful?