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

overview changedapi/overview

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−27removed
From line 4 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits33to this page, all time

### Getting API keys

The whole hunk

from line 4, old and new numbered
/
lines
from line 4
44description: Understand the Claude API's available endpoints, authentication headers, client SDKs, pagination, rate limits, and cloud platform access options.
55---
66 
7The Claude API is a RESTful API at `https://api.anthropic.com` that provides programmatic access to Claude models and Claude Managed Agents.
7The Claude API is a RESTful API at `https://api.anthropic.com` that lets your own code use Claude models and Claude Managed Agents. For example, your code can send messages to Claude or run agent sessions in managed cloud sandboxes.
88 
99<Note>
10 **New to Claude?** For direct model access, start with [Get started](https://platform.claude.com/docs/en/get-started) and [Working with Messages](https://platform.claude.com/docs/en/build-with-claude/working-with-messages). For managed agent infrastructure, see the [Claude Managed Agents quickstart](https://platform.claude.com/docs/en/managed-agents/quickstart).
10 **New to Claude?** For direct model access, start with [Get started with Claude](https://platform.claude.com/docs/en/get-started) and [Using the Messages API](https://platform.claude.com/docs/en/build-with-claude/working-with-messages). For managed agent infrastructure, see [Get started with Claude Managed Agents](https://platform.claude.com/docs/en/managed-agents/quickstart).
1111</Note>
1212 
1313## Prerequisites
from line 15
1515To use the Claude API, you need:
1616 
1717* A [Claude Console account](https://platform.claude.com/)
18* An [API key](https://platform.claude.com/settings/keys) from the Console, or a configured [Workload Identity Federation](https://platform.claude.com/docs/en/manage-claude/workload-identity-federation) rule
18* A way to authenticate (see [Authentication](https://platform.claude.com/docs/en/manage-claude/authentication))
1919 
20For step-by-step setup instructions, see [Get started](https://platform.claude.com/docs/en/get-started).
20For step-by-step setup instructions, see [Get started with Claude](https://platform.claude.com/docs/en/get-started). To try the API in your browser first, use [playground in the Claude Console](https://platform.claude.com/playground) (`platform.claude.com/playground`).
2121 
2222## Available APIs
2323 
from line 40
4040 
4141## Authentication
4242 
43For details on each authentication method and when to use it, see [Authentication](https://platform.claude.com/docs/en/manage-claude/authentication). Requests to the Claude API include these headers:
43Choose how to authenticate by where your code runs:
4444 
45* **On your own computer:** [Sign in with the CLI](https://platform.claude.com/docs/en/manage-claude/authentication#sign-in-with-the-cli) by running `ant auth login`. For a direct HTTP request, that section of the Authentication page shows how to get an access token and send it.
46* **In CI or on a server with an identity provider:** Use [Workload Identity Federation](https://platform.claude.com/docs/en/manage-claude/workload-identity-federation). For a direct HTTP request, that page’s [Construct the SDK client](https://platform.claude.com/docs/en/manage-claude/workload-identity-federation#construct-the-sdk-client) section shows how to get an access token and send it.
47* **Anywhere else:** For other methods, such as App Attest for an iOS or macOS app or a Developer API key, see [Authentication](https://platform.claude.com/docs/en/manage-claude/authentication). To create a key, see [Get your Claude API key](https://platform.claude.com/docs/en/get-api-key).
48 
49To manage an organization through the Admin API or the Compliance API, see [Admin API keys and tokens](https://platform.claude.com/docs/en/manage-claude/admin-api-keys).
50 
51For direct HTTP requests that call Claude, send these headers:
52 
4553| Header | Value | Required |
4654| ----- | ----- | ----- |
47| `Authorization` | `Bearer <token>`, where `<token>` is your API key or a short-lived access token obtained from `POST /v1/oauth/token` through [Workload Identity Federation](https://platform.claude.com/docs/en/manage-claude/workload-identity-federation) | Yes, unless `x-api-key` is set |
48| `x-api-key` | Your API key from Console. Legacy fallback for `Authorization`, still supported | No |
49| `anthropic-workspace-id` | ID of the [workspace](https://platform.claude.com/docs/en/manage-claude/workspaces) the request runs in (for example, `wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ`). See [Select a workspace](https://platform.claude.com/docs/en/manage-claude/authentication#select-a-workspace). | Required with an API key that isn’t scoped to a workspace. Optional for other API keys. A key created for a single workspace runs in that workspace when you omit the header. Not used with Workload Identity Federation tokens, which select a workspace at token exchange. |
55| `Authorization` | `Bearer <token>`, where `<token>` is an access token or a Developer API key | Yes, unless `x-api-key` is set |
56| `x-api-key` | A Developer API key. Legacy fallback for `Authorization`. Access tokens don’t go in this header. | No |
57| `anthropic-workspace-id` | ID of the workspace the request runs in (for example, `wrkspc_01AbCdEfGhJkLmNpQrStUvWx`). See [Select a workspace](https://platform.claude.com/docs/en/manage-claude/api-keys#select-a-workspace) on the Developer API keys page. | With a Developer API key scoped to the organization |
5058| `anthropic-version` | API version (for example, `2026-10-21`) | Yes |
5159| `content-type` | `application/json` | Yes |
5260 
53If you are using the [Client SDKs](https://platform.claude.com/docs/en/api/overview#client-sdks), the SDK sends the authentication, version, and content-type headers automatically; you pass `anthropic-workspace-id` yourself when your key needs it. For API versioning details, see [API versions](https://platform.claude.com/docs/en/api/versioning).
61If you use the [client SDK](https://platform.claude.com/docs/en/api/overview#client-sdks), it sends the authentication, version, and content-type headers for you. With a Developer API key scoped to the organization, pass `anthropic-workspace-id` yourself.
5462 
55When accessing Claude through a [cloud platform](https://platform.claude.com/docs/en/api/overview#claude-api-vs-cloud-platforms), authentication is integrated with the cloud provider’s IAM system. See the platform-specific documentation for supported credential types, required headers, and authentication options.
63For API versioning details, see [API versions](https://platform.claude.com/docs/en/api/versioning).
5664 
57### Getting API keys
65On a [cloud platform](https://platform.claude.com/docs/en/api/overview#claude-api-vs-cloud-platforms), use that platform’s own credentials.
5866 
59The API is made available through the web [Console](https://platform.claude.com/). In the Console, you can use [playground](https://platform.claude.com/playground) (`platform.claude.com/playground`) to try out the API in the browser and then generate API keys on the [API keys](https://platform.claude.com/settings/keys) page (`platform.claude.com/settings/keys`). To learn how, see [Get your Claude API key](https://platform.claude.com/docs/en/get-api-key). You choose each key’s type (see [Key types](https://platform.claude.com/docs/en/manage-claude/authentication#key-types)) and its [expiration](https://platform.claude.com/docs/en/manage-claude/authentication#key-expiration) when you create it. Use [workspaces](https://platform.claude.com/settings/workspaces) in the Console to separate environments and [control spend](https://platform.claude.com/docs/en/api/rate-limits) by use case.
60 
6167## Client SDKs
6268 
6369Anthropic provides official SDKs that simplify API integration by handling authentication, request formatting, error handling, and more.
from line 134
128134| Header | Description |
129135| ----- | ----- |
130136| `request-id` | A globally unique identifier for the request, such as `req_018EeWyXxfu5pfWkrYcMdjWG`. Include it when you contact support about a specific request. See [Request ID](https://platform.claude.com/docs/en/api/errors#request-id). |
131| `anthropic-organization-id` | The ID of the organization that the API key or access token used in the request belongs to. |
132| `anthropic-workspace-id` | The `wrkspc_`-prefixed ID of the [workspace](https://platform.claude.com/docs/en/manage-claude/workspaces) that the API key or access token resolved to, such as `wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ`, including when that is your organization’s Default Workspace. Absent when the credential doesn’t resolve to a workspace (for example, on Admin API requests) or the request fails before authentication completes. See [Identify the workspace behind an API response](https://platform.claude.com/docs/en/manage-claude/workspaces#identify-the-workspace-behind-an-api-response). |
137| `anthropic-organization-id` | The ID of the organization that the request’s credential belongs to. |
138| `anthropic-workspace-id` | The ID of the workspace that the request’s credential resolved to, such as `wrkspc_01AbCdEfGhJkLmNpQrStUvWx`. |
133139 
134For the rate limit headers, see [Response headers](https://platform.claude.com/docs/en/api/rate-limits#response-headers) in Rate limits. For examples that read a response header by name with each SDK, see [Identify the workspace behind an API response](https://platform.claude.com/docs/en/manage-claude/workspaces#identify-the-workspace-behind-an-api-response).
140The `anthropic-workspace-id` header is present even when the workspace is your organization’s default workspace.
135141 
142For the rate limit headers, see [Response headers](https://platform.claude.com/docs/en/api/rate-limits#response-headers) in Rate limits. For examples that read a response header by name with each SDK, see [Identify the workspace behind an API response](https://platform.claude.com/docs/en/manage-claude/workspaces#identify-the-workspace-behind-an-api-response) on the Workspaces page.
143 
136144<Note>
137145 Claude Platform on AWS adds an AWS request ID (`x-amzn-requestid`) alongside the standard `request-id` header. See [Request IDs](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#request-ids) for the dual-ID handling pattern.
138146</Note>
from line 147
139147 
140148## Pagination
141149 
142List endpoints return results in pages. Most newer list endpoints use the `page` and `next_page` cursor scheme described in this section. Some use a different scheme; see the note at the end of this section. Use the `limit` query parameter to control the page size and the `page` query parameter to fetch an adjacent page. Each response includes a `data` array alongside cursor fields for navigating between pages.
150List endpoints return results in pages. Each response holds one page of results in a `data` array. Many list endpoints use the `page` and `next_page` cursors described in the following table.
143151 
144152| Name | Location | Description |
145153| ----- | ----- | ----- |
from line 154
146154| `limit` | Query parameter | Maximum number of items to return per page. |
147155| `page` | Query parameter | Opaque cursor from a previous response. Pass a `next_page` or `prev_page` value here to fetch the adjacent page. |
148156| `order` | Query parameter | Sort direction for the results (`asc` or `desc`), on list endpoints that support sorting. A `page` cursor is only valid with the `order` it was created with. |
149| `next_page` | Response field | Cursor for the next page, or `null` if there are no more results. |
150| `prev_page` | Response field | Cursor for the previous page on endpoints that support backward pagination (currently `GET /v1/sessions`), or `null` if you are on the first page. Other list endpoints omit the field. |
157| `next_page` | Response field | Cursor for the next page or `null` if there are no more results. |
158| `prev_page` | Response field | Cursor for the previous page or `null` on the first page. Only `GET /v1/sessions` returns this field. |
151159 
152To go back a page, pass `prev_page` as the `page` parameter. `prev_page` is `null` when you’re on the first page. Not all list endpoints support `prev_page`. Only `GET /v1/sessions` returns `prev_page`; on list endpoints that do not support backward pagination, the field is absent from the response rather than `null`. For a request walkthrough, see [Listing sessions](https://platform.claude.com/docs/en/managed-agents/session-operations#listing-sessions).
160For an example that pages forward and back through `GET /v1/sessions`, see [Listing sessions](https://platform.claude.com/docs/en/managed-agents/session-operations#listing-sessions).
153161 
154162The SDK provides an auto-paginating iterator that follows `next_page` for you. For example, `for session in client.beta.sessions.list()` (typescript: `for await (const session of client.beta.sessions.list())`; go: `client.Beta.Sessions.ListAutoPaging()`; java: `client.beta().sessions().list().autoPager()`; csharp: `(await client.Beta.Sessions.List()).Paginate()`; php: `$client->beta->sessions->list()->pagingEachItem()`; ruby: `client.beta.sessions.list.auto_paging_each`) walks through every session. SDK auto-pagination is forward-only; to go back a page, read `prev_page` from the response and pass it back as the `page` parameter yourself. See [SDKs, CLI, and libraries](https://platform.claude.com/docs/en/cli-sdks-libraries/overview) for details.
155163 
Feedback