One read of Claude Developer Platformapi-20261130T143719Z
71 pages moved out of 972 read.
What this read moved
1-25 of 71, page 1 of 3This capture is too large to show at once. Changes 1-25 of 71 are below, significant first; the rest are on the following screens.
agents-and-tools/agent-skills/quickstart Changed · +15 / -5 lines
agents-and-tools/mcp-tunnels/overview Changed · +10 / -1 lines
api/migration-2026-10-21 Changed · +6 / -3 lines
api/overview Changed · +35 / -27 lines
### Getting API keys
build-with-claude/compaction-threshold Changed · +63 / -0 lines
### Message threads #### When a thread gets no summary
build-with-claude/fast-mode Changed · +17 / -8 lines
build-with-claude/message-threads Changed · +14 / -4 lines
build-with-claude/prompt-engineering/claude-prompting-best-practices Changed · +160 / -76 lines
build-with-claude/working-with-messages Changed · +256 / -23 lines
claude_api_primer Changed · +90 / -38 lines
### Invalid tool call ### Example event stream # API usage primer for Claude ### Invalid tool name ### Basic streaming request example
cli-sdks-libraries/cli/authentication Changed · +63 / -33 lines
## Interactive sign-in ## Interactive login
cli-sdks-libraries/sdks/ruby Changed · +5 / -1 lines
get-api-key Changed · +35 / -21 lines
## 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
get-started Changed · +21 / -9 lines
home Changed · +9 / -9 lines
manage-claude/admin-api Changed · +64 / -22 lines
manage-claude/admin-api-keys Changed · +211 / -80 lines
## Claude Console organizations ### What a Console Admin API key works with ## Get an access token with the `org:admin` scope ### Renew the access token and clean up ### Sign in for organization webhooks ## Claude Enterprise organizations ### Key access ### Create the key in claude.ai ## Use the key or access token ## Replace an Admin API key ## Which key do you need? ## Choose scopes for a Claude Enterprise key ## Use the key ## Next steps
manage-claude/administering-claude New page · 71 lines, new page
## Which organization you have ## In a Claude Console organization ## In a Claude Enterprise organization ## Manage your organization from code
A whole new page. There's nothing to diff it against, so here is what it says.
---
title: Administering Claude
url: https://platform.claude.com/docs/en/manage-claude/administering-claude
description: Find out which kind of Claude organization you have, how its parts fit together, and where to start managing it.
---
The admin pages are for people who manage Claude for a company or team. A Claude Console organization is for building with the Claude API, and a Claude Enterprise organization is for using Claude apps such as claude.ai. The pages cover who can use your organization, what each member can do, what the organization spends, and what happens to its data. This page shows how an organization is arranged and where to start. To write code that calls Claude instead, see [Get started with Claude](https://platform.claude.com/docs/en/get-started).
## Which organization you have
Which pages apply to you depends on which kind of organization you have:
* **Claude Console organization:** You manage it in the [Claude Console](https://platform.claude.com/settings/organization).
* **Claude Enterprise organization:** You manage it from [Organization settings](https://claude.ai/admin-settings) in claude.ai.
A company with Claude Enterprise normally also has a **parent organization**. It holds linked organizations, which can be Claude Console or Claude Enterprise organizations. Single sign-on is set up on the parent for all of them. Some features, such as the Compliance API, are turned on once for the parent and apply to every linked organization. A Claude Console organization can also stand alone, with no parent.

On a cloud platform, your cloud account’s access controls, such as identity and access management (IAM), determine who can use Claude. See your platform’s page, listed under [Claude API versus cloud platforms](https://platform.claude.com/docs/en/api/overview#claude-api-vs-cloud-platforms) on the API overview page.
## In a Claude Console organization
* **Members and roles:** Each member has one organization role, such as admin or developer, and a role in each workspace they can use. See the Admin API page’s [Organization roles and permissions](https://platform.claude.com/docs/en/manage-claude/admin-api#organization-roles-and-permissions) section and [Workspace roles and permissions](https://platform.claude.com/docs/en/manage-claude/workspaces#workspace-roles-and-permissions).
* **Workspaces:** Every organization has a default workspace. You can add more, such as one for each team or environment. A workspace you add can have its own members and its own spend and rate limits. Each request to Claude runs in one workspace, and the files and batches the request creates stay there.
* **Keys:** [Developer API keys](https://platform.claude.com/docs/en/manage-claude/api-keys) call Claude in one workspace or several. Console Admin API keys manage the whole organization, and only admins create them. See [Admin API keys and tokens](https://platform.claude.com/docs/en/manage-claude/admin-api-keys).
* **Service accounts:** A service account is an identity for a program instead of a person. Code that uses Workload Identity Federation or a service account key acts as a service account. See the Workload Identity Federation page’s [Service accounts](https://platform.claude.com/docs/en/manage-claude/workload-identity-federation#service-accounts) section.
* **Usage and cost:** The Claude Console’s [Usage page](https://platform.claude.com/usage) and [Cost page](https://platform.claude.com/cost) show what the organization uses and spends.
* **Compliance:** A Console Admin API key created after the [Compliance API](https://platform.claude.com/docs/en/manage-claude/compliance-api) is turned on can read activity records through it. See [Query the Activity Feed](https://platform.claude.com/docs/en/manage-claude/compliance-activity-feed).
* **Data:** [Data residency](https://platform.claude.com/docs/en/manage-claude/data-residency) sets where inference runs and where data is stored. See [API and data retention](https://platform.claude.com/docs/en/manage-claude/api-and-data-retention) for how long Anthropic keeps data, including zero data retention.
To set up a Claude Console organization by hand, start with [Workspaces](https://platform.claude.com/docs/en/manage-claude/workspaces). To choose how your code calls Claude, see [Authentication](https://platform.claude.com/docs/en/manage-claude/authentication).
## In a Claude Enterprise organization
* **Members and roles:** Each member has one Claude Enterprise organization role, such as primary owner, organization owner, or user. Groups, which connect members to custom roles, belong to the parent organization. See the User management page’s [Organization roles](https://platform.claude.com/docs/en/manage-claude/user-management#organization-roles) and [Groups and roles](https://platform.claude.com/docs/en/manage-claude/user-management#groups-and-roles) sections.
* **Usage:** The [Analytics dashboard](https://claude.ai/analytics) in claude.ai shows how people use Claude.
* **Compliance:** The [Compliance API](https://platform.claude.com/docs/en/manage-claude/compliance-api) reads records for audits.
* **Keys:** An Enterprise Admin API key manages the organization through the APIs its scopes cover. See [Create a key for a Claude Enterprise organization](https://platform.claude.com/docs/en/manage-claude/admin-api-keys#create-a-key-for-a-claude-enterprise-organization).
To set up a Claude Enterprise organization, start in its [Organization settings](https://claude.ai/admin-settings) in claude.ai.
## Manage your organization from code
First, get a credential, and then use the API for the job:
<CardGroup cols={2}>
<Card title="Admin API keys and tokens" icon="key" href="https://platform.claude.com/docs/en/manage-claude/admin-api-keys">
Get the credential a program uses to manage either kind of organization.
</Card>
<Card title="Usage and Cost Analytics API" icon="chart" href="https://platform.claude.com/docs/en/manage-claude/usage-cost-analytics-api">
Report token usage and cost for either kind of organization.
</Card>
<Card title="Admin API" icon="settings" href="https://platform.claude.com/docs/en/manage-claude/admin-api">
Manage a Claude Console organization’s members, workspaces, and Developer API keys.
</Card>
<Card title="User management" icon="building" href="https://platform.claude.com/docs/en/manage-claude/user-management">
Manage a Claude Enterprise organization’s members and groups with the Admin API.
</Card>
<Card title="Analytics APIs" icon="gauge" href="https://platform.claude.com/docs/en/manage-claude/analytics-api">
Report either Claude Code use or how people use Claude in Claude Enterprise.
</Card>
<Card title="Compliance API" icon="shield" href="https://platform.claude.com/docs/en/manage-claude/compliance-api">
Read activity records. In Claude Enterprise, also read chats and files.
</Card>
</CardGroup>
manage-claude/analytics-api Changed · +24 / -15 lines
### Cowork connector calls in cloud sessions
manage-claude/api-keys New page · 430 lines, new page
## Key types ### Scope ## Key expiration ## Who can create which key ## Create and use a key ### Run the docs’ samples with a key ## Select a workspace ## Keep a key safe ## Replace a workspace key ## Manage keys with the Admin API ## Special cases ### If you use Claude Platform on AWS
A whole new page. There's nothing to diff it against, so here is what it says.
---
title: Developer API keys
url: https://platform.claude.com/docs/en/manage-claude/api-keys
description: Compare the types of Developer API key, use a key, select a workspace, and manage expiration.
---
A Developer API key is a secret that you create in the Claude Console and send with each request. Keys suit tools that need one and servers where no [identity provider](https://platform.claude.com/docs/en/manage-claude/authentication#workload-identity-federation) is available.
**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).
**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.
## Key types
When you create a key, the **Linked account** setting determines its type. Choose yourself for a personal key or a service account for a service account key. **Not linked** makes a legacy workspace key.
If a tool that only you run asks for a key, use a personal key. If a shared or unattended workload has to use a key, give it a service account key, which doesn’t stop working when one person leaves.
The type determines who the key acts as, where it works, and when it stops working:
* **Personal key:** It acts as you, with your roles. It works in one workspace or in the workspaces where your role allows API use (see [Workspace roles and permissions](https://platform.claude.com/docs/en/manage-claude/workspaces#workspace-roles-and-permissions) on the Workspaces page). It stops working when you leave the organization or are removed from it.
* **Service account key:** It acts as a [service account](https://platform.claude.com/docs/en/manage-claude/workload-identity-federation#service-accounts). It works in one workspace or in the workspaces where the service account’s role allows API use. It stops working when the service account is archived.
* **Workspace key (legacy):** It acts as no one. It works in the workspace it was created in. It stops working when that workspace is archived.
Personal keys and service account keys are tied to an identity, so they don’t outlive the people or service accounts that own them.
Workspace keys are legacy, so use a personal or service account key for new integrations. To move off a workspace key, see [Replace a workspace key](https://platform.claude.com/docs/en/manage-claude/api-keys#replacing-workspace-api-keys).
### Scope
A personal or service account key is scoped to one workspace or to the organization:
* **Scoped to one workspace:** The key works only in that workspace. It also stops working when its owner loses access to the workspace or when the workspace is archived.
* **Scoped to the organization:** The key works in several workspaces, so each Claude API request names one (see [Select a workspace](https://platform.claude.com/docs/en/manage-claude/api-keys#select-a-workspace)).
## Key expiration
You choose a key’s expiration when you create it on the [API keys](https://platform.claude.com/settings/keys) page (`platform.claude.com/settings/keys`) in the Claude Console, and you can’t change the expiration afterward. The choices are:
* A preset: 3 hours, 1 day, 7 days, or 30 days
* A custom date and time
* **Never**, for keys you keep in a secrets manager and rotate yourself
If your organization has a maximum expiration policy, the Console limits presets and custom dates to that maximum and doesn’t offer **Never**.
If the key lasts at least 3 days, Anthropic emails the key’s creator before it expires.
After a key expires, requests made with it return a 401 `authentication_error`. An expired key can only be deleted, not turned back on, so create a new key to restore access.
The API keys table in the Console shows each key’s expiration. The [Admin API](https://platform.claude.com/docs/en/manage-claude/admin-api) reports each key’s `expires_at` on [List API Keys](https://platform.claude.com/docs/en/api/organization/api_keys/list) and [Retrieve API Key](https://platform.claude.com/docs/en/api/organization/api_keys/retrieve), so you can rotate keys before they expire.
## Who can create which key
| Key | Who can create it |
| ----- | ----- |
| Personal key, scoped to one workspace | Workspace Developer, Workspace Limited Developer, or Workspace Admin in that workspace. Organization developers who are members of that workspace can too. Organization admins have the Workspace Admin role in every workspace. |
| Personal key, scoped to the organization | Organization developers and admins |
| Service account key | Organization admins |
| Workspace key (legacy) | Workspace Developer, Workspace Limited Developer, or Workspace Admin in that workspace. Organization admins have the Workspace Admin role in every workspace. |
The default workspace has no member list, so organization developers and admins can create personal and workspace keys there.
For what each role allows, see [Organization roles and permissions](https://platform.claude.com/docs/en/manage-claude/admin-api#organization-roles-and-permissions) on the Admin API page and [Workspace roles and permissions](https://platform.claude.com/docs/en/manage-claude/workspaces#workspace-roles-and-permissions) on the Workspaces page.
An organization admin can turn off key creation on the [Security](https://platform.claude.com/settings/identity) page in the Claude Console. **Allow creating new API keys** controls the whole organization. **Allow creating new API keys in default workspace** controls only keys scoped to the default workspace.
If you can’t create the key you need, what to do depends on why:
* **You have the organization user role:** Use a workspace where you’re a Workspace Developer, Workspace Limited Developer, or Workspace Admin. On the [API keys](https://platform.claude.com/settings/keys) page, click **Create key**. If the dialog first offers other ways to connect, click **Somewhere else** or **Continue with an API key**. Then, set **Scope** to that workspace.
* **Create key is missing or disabled, or the Console says you don’t have permission:** Ask an organization admin. They can change your role, change the key creation settings, or create a service account key for your workload.
## Create and use a key
To create a key step by step, see [Get your Claude API key](https://platform.claude.com/docs/en/get-api-key).
The SDK and the CLI read a key from the `ANTHROPIC_API_KEY` environment variable. A direct HTTP request sends the key in the `Authorization` header after `Bearer`. It can send it in the legacy `x-api-key` header instead. Send only one. With `Authorization`, a request looks like this:
```http
POST /v1/messages
Authorization: Bearer YOUR_API_KEY
anthropic-version: 2026-10-21
content-type: application/json
```
Keep keys out of source control, client-side code, and prompts. To set `ANTHROPIC_API_KEY` in your shell, including on Windows, see [API key](https://platform.claude.com/docs/en/cli-sdks-libraries/cli/authentication#api-key) on the CLI authentication options page.
The following samples show how each tool takes the key:
<CodeGroup>
```bash cURL
curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2026-10-21" \
-H "content-type: application/json" \
-d '{
"model": "claude-opus-5-5",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Hello, Claude"}]
}'
```
```bash CLI
export ANTHROPIC_API_KEY=sk-ant-...
```
```python Python
client = Anthropic() # reads ANTHROPIC_API_KEY
# Or pass a key that you load from a secrets manager:
# client = Anthropic(api_key=key_from_your_secrets_manager)
```
```typescript TypeScript
const client = new Anthropic(); // reads ANTHROPIC_API_KEY
// Or pass a key that you load from a secrets manager:
// const client = new Anthropic({ apiKey: keyFromYourSecretsManager });
```
```csharp C#
AnthropicClient client = new(); // reads ANTHROPIC_API_KEY
// Or pass a key that you load from a secrets manager:
// AnthropicClient client = new() { ApiKey = keyFromYourSecretsManager };
```
```go Go
client := anthropic.NewClient() // reads ANTHROPIC_API_KEY
// Or pass a key that you load from a secrets manager
// (import github.com/anthropics/anthropic-sdk-go/v2/option):
// client := anthropic.NewClient(option.WithAPIKey(keyFromYourSecretsManager))
```
```java Java
AnthropicClient client = AnthropicOkHttpClient.fromEnv(); // reads ANTHROPIC_API_KEY
// Or pass a key that you load from a secrets manager:
// AnthropicClient client = AnthropicOkHttpClient.builder()
// .apiKey(keyFromYourSecretsManager)
// .build();
```
```php PHP
$client = new Client(); // reads ANTHROPIC_API_KEY
// Or pass a key that you load from a secrets manager:
// $client = new Client(apiKey: $keyFromYourSecretsManager);
```
```ruby Ruby
client = Anthropic::Client.new # reads ANTHROPIC_API_KEY
# Or pass a key that you load from a secrets manager:
# client = Anthropic::Client.new(api_key: key_from_your_secrets_manager)
```
</CodeGroup>
### Run the docs’ samples with a key
First, set `ANTHROPIC_API_KEY` to your key. If the key is scoped to the organization, every Claude API sample must also name a workspace (see [Select a workspace](https://platform.claude.com/docs/en/manage-claude/api-keys#select-a-workspace)). Anything else you change depends on the sample:
* **SDK and CLI samples, and cURL samples that send `x-api-key`:** Nothing else. They read `ANTHROPIC_API_KEY`.
* **cURL samples that use CLI sign-in:** These send `Authorization: Bearer $(ant auth print-credentials --access-token)`. Change it to `Authorization: Bearer $ANTHROPIC_API_KEY`.
## Select a workspace
Whether a request names a workspace depends on the key’s scope:
* **Scoped to one workspace:** Requests can leave out the `anthropic-workspace-id` header. If you send the header, it must name the key’s own workspace.
* **Scoped to the organization:** Each Claude API request must name a workspace in the `anthropic-workspace-id` header. Leave the header out of Admin API requests, which refuse it.
To find a workspace’s ID, use either of these:
* The **ID** column on the [Workspaces](https://platform.claude.com/settings/workspaces) page in the Claude Console. The page lists the default workspace too.
* [List Workspaces](https://platform.claude.com/docs/en/api/organization/workspaces/list) in the Admin API. It includes the default workspace only when you pass `include_default=true`.
The following samples set the header on one request. With the SDK, you can also set it once for every request from a client:
<CodeGroup>
```bash cURL
# Required on every Claude API request for a key scoped to the organization.
# Omit the anthropic-workspace-id header for a key scoped to one workspace.
curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2026-10-21" \
-H "anthropic-workspace-id: wrkspc_01AbCdEfGhJkLmNpQrStUvWx" \
-H "content-type: application/json" \
-d '{
"model": "claude-opus-5-5",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Hello, Claude"}]
}'
```
```bash CLI
# Required on every Claude API request for a key scoped to the organization.
# Omit --workspace-id for a key scoped to one workspace.
ant messages create \
--workspace-id wrkspc_01AbCdEfGhJkLmNpQrStUvWx \
--model claude-opus-5-5 \
--max-tokens 1024 \
--message '{role: user, content: "Hello, Claude"}'
```
```python Python
client = Anthropic() # reads ANTHROPIC_API_KEY
# Required on every Claude API request for a key scoped to the organization.
# Omit extra_headers for a key scoped to one workspace.
message = client.messages.create(
model="claude-opus-5-5",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello, Claude"}],
extra_headers={"anthropic-workspace-id": "wrkspc_01AbCdEfGhJkLmNpQrStUvWx"},
)
print(message.content)
# Or set it once for every request from this client:
workspace_client = Anthropic(
default_headers={"anthropic-workspace-id": "wrkspc_01AbCdEfGhJkLmNpQrStUvWx"},
)
```
```typescript TypeScript
const client = new Anthropic(); // reads ANTHROPIC_API_KEY
// Required on every Claude API request for a key scoped to the organization.
// Omit the second argument for a key scoped to one workspace.
const message = await client.messages.create(
{
model: "claude-opus-5-5",
max_tokens: 1024,
messages: [{ role: "user", content: "Hello, Claude" }]
},
{ headers: { "anthropic-workspace-id": "wrkspc_01AbCdEfGhJkLmNpQrStUvWx" } }
);
console.log(message.content);
// Or set it once for every request from this client:
const workspaceClient = new Anthropic({
defaultHeaders: { "anthropic-workspace-id": "wrkspc_01AbCdEfGhJkLmNpQrStUvWx" }
});
```
```csharp C#
AnthropicClient client = new(); // reads ANTHROPIC_API_KEY
MessageCreateParams parameters = new()
{
Model = Model.ClaudeOpus5_5,
MaxTokens = 1024,
Messages = [new UserMessageParam { Content = "Hello, Claude" }],
};
// Required on every Claude API request for a key scoped to the organization.
// Call client.Messages.Create(parameters) directly for a key scoped to one workspace.
var message = await client
.WithOptions(options =>
options with
{
ExtraHeaders = new Dictionary<string, string>
{
["anthropic-workspace-id"] = "wrkspc_01AbCdEfGhJkLmNpQrStUvWx",
},
}
)
.Messages.Create(parameters);
Console.WriteLine(message);
// Or set it once for every request from this client:
AnthropicClient workspaceClient = new(new ClientOptions
{
ExtraHeaders = new Dictionary<string, string>
{
["anthropic-workspace-id"] = "wrkspc_01AbCdEfGhJkLmNpQrStUvWx",
},
});
```
```go Go
client := anthropic.NewClient() // reads ANTHROPIC_API_KEY
// Required on every Claude API request for a key scoped to the organization.
// Omit the option for a key scoped to one workspace.
message, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
Model: anthropic.ModelClaudeOpus5_5,
MaxTokens: 1024,
Messages: []anthropic.MessageParam{
anthropic.NewUserMessage(anthropic.NewTextBlock("Hello, Claude")),
},
}, option.WithHeader("anthropic-workspace-id", "wrkspc_01AbCdEfGhJkLmNpQrStUvWx"))
if err != nil {
log.Fatal(err)
}
fmt.Println(message.Content)
// Or set it once for every request from this client:
workspaceClient := anthropic.NewClient(
option.WithHeader("anthropic-workspace-id", "wrkspc_01AbCdEfGhJkLmNpQrStUvWx"),
)
```
```java Java
AnthropicClient client = AnthropicOkHttpClient.fromEnv(); // reads ANTHROPIC_API_KEY
// Required on every Claude API request for a key scoped to the organization.
Cut at 300 lines. The page has the rest.
manage-claude/authentication Changed · +151 / -368 lines
## Choose your path ## Sign in with the CLI ## Which credential is used ## Browser-based applications ### Requests sent from a browser ### Key types ### Create and use a key ### Select a workspace ### Key expiration ### Replacing workspace API keys ### Browser-based applications ## Next steps
The two sides of this change are more than 400 edits apart, too far apart to line up, so this is the differ's own diff of it and the words inside a line are not marked.
manage-claude/claude-code-analytics-api Changed · +6 / -2 lines
manage-claude/claude-tag-api Changed · +20 / -17 lines
manage-claude/compliance-activity-feed Changed · +28 / -2 lines
## Activities that belong to an account