One read of Claude Developer Platformapi-20260814T043121Z
565 pages moved out of 565 read.
What this read moved
251-275 of 565, page 11 of 23This capture is too large to show at once. Changes 251-275 of 565 are below, significant first; the rest are on the following screens.
api/beta/memory_stores/memory_versions First recorded · 939 lines, first recorded
# Memory Versions ## List memory versions ### Path Parameters ### Query Parameters ### Header Parameters ### Returns ### Example #### Response ## Retrieve a memory version ### Path Parameters ### Query Parameters ### Header Parameters ### Returns ### Example #### Response ## Redact a memory version ### Path Parameters ### Header Parameters ### Returns ### Example #### Response ## Domain Types ### Beta Managed Agents Actor ### Beta Managed Agents API Actor ### Beta Managed Agents Memory Version ### Beta Managed Agents Memory Version Operation ### Beta Managed Agents Session Actor ### Beta Managed Agents User Actor
The first capture of this source. The page was already there, and this is what it said.
---
title: Memory Versions
url: https://platform.claude.com/docs/en/api/beta/memory_stores/memory_versions
---
# Memory Versions
## List memory versions
**get** `/v1/memory_stores/{memory_store_id}/memory_versions`
List memory versions
### Path Parameters
- `memory_store_id: string`
### Query Parameters
- `api_key_id: optional string`
Query parameter for api_key_id
- `"created_at[gte]": optional string`
Return versions created at or after this time (inclusive).
- `"created_at[lte]": optional string`
Return versions created at or before this time (inclusive).
- `limit: optional number`
Query parameter for limit
- `memory_id: optional string`
Query parameter for memory_id
- `operation: optional BetaManagedAgentsMemoryVersionOperation`
Query parameter for operation
- `"created"`
- `"modified"`
- `"deleted"`
- `page: optional string`
Query parameter for page
- `session_id: optional string`
Query parameter for session_id
- `view: optional BetaManagedAgentsMemoryView`
Query parameter for view
- `"basic"`
- `"full"`
### Header Parameters
- `"anthropic-beta": optional array of AnthropicBeta`
Optional header to specify the beta version(s) you want to use.
- `string`
- `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 30 more`
- `"message-batches-2024-09-24"`
- `"prompt-caching-2024-07-31"`
- `"computer-use-2024-10-22"`
- `"computer-use-2025-01-24"`
- `"pdfs-2024-09-25"`
- `"token-counting-2024-11-01"`
- `"token-efficient-tools-2025-02-19"`
- `"output-128k-2025-02-19"`
- `"files-api-2025-04-14"`
- `"mcp-client-2025-04-04"`
- `"mcp-client-2025-11-20"`
- `"dev-full-thinking-2025-05-14"`
- `"interleaved-thinking-2025-05-14"`
- `"code-execution-2025-05-22"`
- `"extended-cache-ttl-2025-04-11"`
- `"context-1m-2025-08-07"`
- `"context-management-2025-06-27"`
- `"model-context-window-exceeded-2025-08-26"`
- `"skills-2025-10-02"`
- `"fast-mode-2026-02-01"`
- `"output-300k-2026-03-24"`
- `"user-profiles-2026-03-24"`
- `"advisor-tool-2026-03-01"`
- `"managed-agents-2026-04-01"`
- `"cache-diagnosis-2026-04-07"`
- `"dreaming-2026-04-21"`
- `"thinking-token-count-2026-05-13"`
- `"server-side-fallback-2026-06-01"`
- `"server-side-fallback-2026-07-01"`
- `"fallback-credit-2026-06-01"`
- `"fallback-credit-2026-07-01"`
- `"agent-memory-2026-07-22"`
- `"mid-conversation-tool-changes-2026-07-01"`
### Returns
- `data: optional array of BetaManagedAgentsMemoryVersion`
One page of `memory_version` objects, ordered by `created_at` descending (newest first), with `id` as tiebreak.
- `id: string`
Unique identifier for this version (a `memver_...` value).
- `created_at: string`
A timestamp in RFC 3339 format
- `memory_id: string`
ID of the memory this version snapshots (a `mem_...` value). Remains valid after the memory is deleted; pass it as `memory_id` to [List memory versions](/docs/en/api/beta/memory_stores/memory_versions/list) to retrieve the full lineage including the `deleted` row.
- `memory_store_id: string`
ID of the memory store this version belongs to (a `memstore_...` value).
- `operation: BetaManagedAgentsMemoryVersionOperation`
The kind of mutation a `memory_version` records. Every non-no-op mutation to a memory appends exactly one version row with one of these values.
- `"created"`
- `"modified"`
- `"deleted"`
- `type: "memory_version"`
- `"memory_version"`
- `content: optional string or null`
The memory's UTF-8 text content as of this version. `null` when `view=basic`, when `operation` is `deleted`, or when `redacted_at` is set.
- `content_sha256: optional string or null`
Lowercase hex SHA-256 digest of `content` as of this version (64 characters). `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise.
- `content_size_bytes: optional number or null`
Size of `content` in bytes as of this version. `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise.
- `created_by: optional BetaManagedAgentsActor`
Identifies who performed a write or redact operation. Captured at write time on the `memory_version` row. The API key that created a session is not recorded on agent writes; attribution answers who made the write, not who is ultimately responsible. Look up session provenance separately via the [Sessions API](/docs/en/api/sessions-retrieve).
- `BetaManagedAgentsSessionActor object { session_id, type }`
Attribution for a write made by an agent during a session, through the mounted filesystem at `/mnt/memory/`.
- `session_id: string`
ID of the session that performed the write (a `sesn_...` value). Look up the session via [Retrieve a session](/docs/en/api/sessions-retrieve) for further provenance.
- `type: "session_actor"`
- `"session_actor"`
- `BetaManagedAgentsAPIActor object { api_key_id, type }`
Attribution for a write made directly via the public API (outside of any session).
- `api_key_id: string`
ID of the API key that performed the write. This identifies the key, not the secret.
- `type: "api_actor"`
- `"api_actor"`
- `BetaManagedAgentsUserActor object { type, user_id }`
Attribution for a write made by a human user through the Anthropic Console.
- `type: "user_actor"`
- `"user_actor"`
- `user_id: string`
ID of the user who performed the write (a `user_...` value).
- `path: optional string or null`
The memory's path at the time of this write. `null` if and only if `redacted_at` is set.
- `redacted_at: optional string or null`
A timestamp in RFC 3339 format
- `redacted_by: optional BetaManagedAgentsActor`
Identifies who performed a write or redact operation. Captured at write time on the `memory_version` row. The API key that created a session is not recorded on agent writes; attribution answers who made the write, not who is ultimately responsible. Look up session provenance separately via the [Sessions API](/docs/en/api/sessions-retrieve).
- `next_page: optional string or null`
Opaque cursor for the next page (a `page_...` value), or `null` if there are no more results. Pass as `page` on the next request.
### Example
```http
curl https://api.anthropic.com/v1/memory_stores/$MEMORY_STORE_ID/memory_versions \
-H 'anthropic-version: 2023-06-01' \
-H 'anthropic-beta: agent-memory-2026-07-22' \
-H "X-Api-Key: $ANTHROPIC_API_KEY"
```
#### Response
```json
{
"data": [
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"memory_id": "memory_id",
"memory_store_id": "memory_store_id",
"operation": "created",
"type": "memory_version",
"content": "content",
"content_sha256": "content_sha256",
"content_size_bytes": 0,
"created_by": {
"session_id": "x",
"type": "session_actor"
},
"path": "path",
"redacted_at": "2019-12-27T18:11:19.117Z",
"redacted_by": {
"session_id": "x",
"type": "session_actor"
}
}
],
"next_page": "next_page"
}
```
## Retrieve a memory version
**get** `/v1/memory_stores/{memory_store_id}/memory_versions/{memory_version_id}`
Retrieve a memory version
### Path Parameters
- `memory_store_id: string`
- `memory_version_id: string`
### Query Parameters
- `view: optional BetaManagedAgentsMemoryView`
Cut at 300 lines. The page has the rest.
api/beta/memory_stores/memory_versions/list First recorded · 282 lines, first recorded
## List memory versions ### Path Parameters ### Query Parameters ### Header Parameters ### Returns ### Example #### Response
The first capture of this source. The page was already there, and this is what it said.
---
title: List memory versions
url: https://platform.claude.com/docs/en/api/beta/memory_stores/memory_versions/list
---
## List memory versions
**get** `/v1/memory_stores/{memory_store_id}/memory_versions`
List memory versions
### Path Parameters
- `memory_store_id: string`
### Query Parameters
- `api_key_id: optional string`
Query parameter for api_key_id
- `"created_at[gte]": optional string`
Return versions created at or after this time (inclusive).
- `"created_at[lte]": optional string`
Return versions created at or before this time (inclusive).
- `limit: optional number`
Query parameter for limit
- `memory_id: optional string`
Query parameter for memory_id
- `operation: optional BetaManagedAgentsMemoryVersionOperation`
Query parameter for operation
- `"created"`
- `"modified"`
- `"deleted"`
- `page: optional string`
Query parameter for page
- `session_id: optional string`
Query parameter for session_id
- `view: optional BetaManagedAgentsMemoryView`
Query parameter for view
- `"basic"`
- `"full"`
### Header Parameters
- `"anthropic-beta": optional array of AnthropicBeta`
Optional header to specify the beta version(s) you want to use.
- `string`
- `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 30 more`
- `"message-batches-2024-09-24"`
- `"prompt-caching-2024-07-31"`
- `"computer-use-2024-10-22"`
- `"computer-use-2025-01-24"`
- `"pdfs-2024-09-25"`
- `"token-counting-2024-11-01"`
- `"token-efficient-tools-2025-02-19"`
- `"output-128k-2025-02-19"`
- `"files-api-2025-04-14"`
- `"mcp-client-2025-04-04"`
- `"mcp-client-2025-11-20"`
- `"dev-full-thinking-2025-05-14"`
- `"interleaved-thinking-2025-05-14"`
- `"code-execution-2025-05-22"`
- `"extended-cache-ttl-2025-04-11"`
- `"context-1m-2025-08-07"`
- `"context-management-2025-06-27"`
- `"model-context-window-exceeded-2025-08-26"`
- `"skills-2025-10-02"`
- `"fast-mode-2026-02-01"`
- `"output-300k-2026-03-24"`
- `"user-profiles-2026-03-24"`
- `"advisor-tool-2026-03-01"`
- `"managed-agents-2026-04-01"`
- `"cache-diagnosis-2026-04-07"`
- `"dreaming-2026-04-21"`
- `"thinking-token-count-2026-05-13"`
- `"server-side-fallback-2026-06-01"`
- `"server-side-fallback-2026-07-01"`
- `"fallback-credit-2026-06-01"`
- `"fallback-credit-2026-07-01"`
- `"agent-memory-2026-07-22"`
- `"mid-conversation-tool-changes-2026-07-01"`
### Returns
- `data: optional array of BetaManagedAgentsMemoryVersion`
One page of `memory_version` objects, ordered by `created_at` descending (newest first), with `id` as tiebreak.
- `id: string`
Unique identifier for this version (a `memver_...` value).
- `created_at: string`
A timestamp in RFC 3339 format
- `memory_id: string`
ID of the memory this version snapshots (a `mem_...` value). Remains valid after the memory is deleted; pass it as `memory_id` to [List memory versions](/docs/en/api/beta/memory_stores/memory_versions/list) to retrieve the full lineage including the `deleted` row.
- `memory_store_id: string`
ID of the memory store this version belongs to (a `memstore_...` value).
- `operation: BetaManagedAgentsMemoryVersionOperation`
The kind of mutation a `memory_version` records. Every non-no-op mutation to a memory appends exactly one version row with one of these values.
- `"created"`
- `"modified"`
- `"deleted"`
- `type: "memory_version"`
- `"memory_version"`
- `content: optional string or null`
The memory's UTF-8 text content as of this version. `null` when `view=basic`, when `operation` is `deleted`, or when `redacted_at` is set.
- `content_sha256: optional string or null`
Lowercase hex SHA-256 digest of `content` as of this version (64 characters). `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise.
- `content_size_bytes: optional number or null`
Size of `content` in bytes as of this version. `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise.
- `created_by: optional BetaManagedAgentsActor`
Identifies who performed a write or redact operation. Captured at write time on the `memory_version` row. The API key that created a session is not recorded on agent writes; attribution answers who made the write, not who is ultimately responsible. Look up session provenance separately via the [Sessions API](/docs/en/api/sessions-retrieve).
- `BetaManagedAgentsSessionActor object { session_id, type }`
Attribution for a write made by an agent during a session, through the mounted filesystem at `/mnt/memory/`.
- `session_id: string`
ID of the session that performed the write (a `sesn_...` value). Look up the session via [Retrieve a session](/docs/en/api/sessions-retrieve) for further provenance.
- `type: "session_actor"`
- `"session_actor"`
- `BetaManagedAgentsAPIActor object { api_key_id, type }`
Attribution for a write made directly via the public API (outside of any session).
- `api_key_id: string`
ID of the API key that performed the write. This identifies the key, not the secret.
- `type: "api_actor"`
- `"api_actor"`
- `BetaManagedAgentsUserActor object { type, user_id }`
Attribution for a write made by a human user through the Anthropic Console.
- `type: "user_actor"`
- `"user_actor"`
- `user_id: string`
ID of the user who performed the write (a `user_...` value).
- `path: optional string or null`
The memory's path at the time of this write. `null` if and only if `redacted_at` is set.
- `redacted_at: optional string or null`
A timestamp in RFC 3339 format
- `redacted_by: optional BetaManagedAgentsActor`
Identifies who performed a write or redact operation. Captured at write time on the `memory_version` row. The API key that created a session is not recorded on agent writes; attribution answers who made the write, not who is ultimately responsible. Look up session provenance separately via the [Sessions API](/docs/en/api/sessions-retrieve).
- `next_page: optional string or null`
Opaque cursor for the next page (a `page_...` value), or `null` if there are no more results. Pass as `page` on the next request.
### Example
```http
curl https://api.anthropic.com/v1/memory_stores/$MEMORY_STORE_ID/memory_versions \
-H 'anthropic-version: 2023-06-01' \
-H 'anthropic-beta: agent-memory-2026-07-22' \
-H "X-Api-Key: $ANTHROPIC_API_KEY"
```
#### Response
```json
{
"data": [
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"memory_id": "memory_id",
"memory_store_id": "memory_store_id",
"operation": "created",
"type": "memory_version",
"content": "content",
"content_sha256": "content_sha256",
"content_size_bytes": 0,
"created_by": {
"session_id": "x",
"type": "session_actor"
},
"path": "path",
"redacted_at": "2019-12-27T18:11:19.117Z",
"redacted_by": {
"session_id": "x",
"type": "session_actor"
}
}
],
"next_page": "next_page"
}
```
api/beta/memory_stores/memory_versions/redact First recorded · 228 lines, first recorded
## Redact a memory version ### Path Parameters ### Header Parameters ### Returns ### Example #### Response
The first capture of this source. The page was already there, and this is what it said.
---
title: Redact a memory version
url: https://platform.claude.com/docs/en/api/beta/memory_stores/memory_versions/redact
---
## Redact a memory version
**post** `/v1/memory_stores/{memory_store_id}/memory_versions/{memory_version_id}/redact`
Redact a memory version
### Path Parameters
- `memory_store_id: string`
- `memory_version_id: string`
### Header Parameters
- `"anthropic-beta": optional array of AnthropicBeta`
Optional header to specify the beta version(s) you want to use.
- `string`
- `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 30 more`
- `"message-batches-2024-09-24"`
- `"prompt-caching-2024-07-31"`
- `"computer-use-2024-10-22"`
- `"computer-use-2025-01-24"`
- `"pdfs-2024-09-25"`
- `"token-counting-2024-11-01"`
- `"token-efficient-tools-2025-02-19"`
- `"output-128k-2025-02-19"`
- `"files-api-2025-04-14"`
- `"mcp-client-2025-04-04"`
- `"mcp-client-2025-11-20"`
- `"dev-full-thinking-2025-05-14"`
- `"interleaved-thinking-2025-05-14"`
- `"code-execution-2025-05-22"`
- `"extended-cache-ttl-2025-04-11"`
- `"context-1m-2025-08-07"`
- `"context-management-2025-06-27"`
- `"model-context-window-exceeded-2025-08-26"`
- `"skills-2025-10-02"`
- `"fast-mode-2026-02-01"`
- `"output-300k-2026-03-24"`
- `"user-profiles-2026-03-24"`
- `"advisor-tool-2026-03-01"`
- `"managed-agents-2026-04-01"`
- `"cache-diagnosis-2026-04-07"`
- `"dreaming-2026-04-21"`
- `"thinking-token-count-2026-05-13"`
- `"server-side-fallback-2026-06-01"`
- `"server-side-fallback-2026-07-01"`
- `"fallback-credit-2026-06-01"`
- `"fallback-credit-2026-07-01"`
- `"agent-memory-2026-07-22"`
- `"mid-conversation-tool-changes-2026-07-01"`
### Returns
- `BetaManagedAgentsMemoryVersion object { id, created_at, memory_id, 10 more }`
A `memory_version` object: one immutable, attributed row in a memory's append-only history. Every non-no-op mutation to a memory produces a new version. Versions belong to the store (not the individual memory) and persist after the memory is deleted. Retrieving a redacted version returns 200 with `content`, `path`, `content_size_bytes`, and `content_sha256` set to `null`; branch on `redacted_at`, not HTTP status.
- `id: string`
Unique identifier for this version (a `memver_...` value).
- `created_at: string`
A timestamp in RFC 3339 format
- `memory_id: string`
ID of the memory this version snapshots (a `mem_...` value). Remains valid after the memory is deleted; pass it as `memory_id` to [List memory versions](/docs/en/api/beta/memory_stores/memory_versions/list) to retrieve the full lineage including the `deleted` row.
- `memory_store_id: string`
ID of the memory store this version belongs to (a `memstore_...` value).
- `operation: BetaManagedAgentsMemoryVersionOperation`
The kind of mutation a `memory_version` records. Every non-no-op mutation to a memory appends exactly one version row with one of these values.
- `"created"`
- `"modified"`
- `"deleted"`
- `type: "memory_version"`
- `"memory_version"`
- `content: optional string or null`
The memory's UTF-8 text content as of this version. `null` when `view=basic`, when `operation` is `deleted`, or when `redacted_at` is set.
- `content_sha256: optional string or null`
Lowercase hex SHA-256 digest of `content` as of this version (64 characters). `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise.
- `content_size_bytes: optional number or null`
Size of `content` in bytes as of this version. `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise.
- `created_by: optional BetaManagedAgentsActor`
Identifies who performed a write or redact operation. Captured at write time on the `memory_version` row. The API key that created a session is not recorded on agent writes; attribution answers who made the write, not who is ultimately responsible. Look up session provenance separately via the [Sessions API](/docs/en/api/sessions-retrieve).
- `BetaManagedAgentsSessionActor object { session_id, type }`
Attribution for a write made by an agent during a session, through the mounted filesystem at `/mnt/memory/`.
- `session_id: string`
ID of the session that performed the write (a `sesn_...` value). Look up the session via [Retrieve a session](/docs/en/api/sessions-retrieve) for further provenance.
- `type: "session_actor"`
- `"session_actor"`
- `BetaManagedAgentsAPIActor object { api_key_id, type }`
Attribution for a write made directly via the public API (outside of any session).
- `api_key_id: string`
ID of the API key that performed the write. This identifies the key, not the secret.
- `type: "api_actor"`
- `"api_actor"`
- `BetaManagedAgentsUserActor object { type, user_id }`
Attribution for a write made by a human user through the Anthropic Console.
- `type: "user_actor"`
- `"user_actor"`
- `user_id: string`
ID of the user who performed the write (a `user_...` value).
- `path: optional string or null`
The memory's path at the time of this write. `null` if and only if `redacted_at` is set.
- `redacted_at: optional string or null`
A timestamp in RFC 3339 format
- `redacted_by: optional BetaManagedAgentsActor`
Identifies who performed a write or redact operation. Captured at write time on the `memory_version` row. The API key that created a session is not recorded on agent writes; attribution answers who made the write, not who is ultimately responsible. Look up session provenance separately via the [Sessions API](/docs/en/api/sessions-retrieve).
### Example
```http
curl https://api.anthropic.com/v1/memory_stores/$MEMORY_STORE_ID/memory_versions/$MEMORY_VERSION_ID/redact \
-X POST \
-H 'anthropic-version: 2023-06-01' \
-H 'anthropic-beta: agent-memory-2026-07-22' \
-H "X-Api-Key: $ANTHROPIC_API_KEY"
```
#### Response
```json
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"memory_id": "memory_id",
"memory_store_id": "memory_store_id",
"operation": "created",
"type": "memory_version",
"content": "content",
"content_sha256": "content_sha256",
"content_size_bytes": 0,
"created_by": {
"session_id": "x",
"type": "session_actor"
},
"path": "path",
"redacted_at": "2019-12-27T18:11:19.117Z",
"redacted_by": {
"session_id": "x",
"type": "session_actor"
}
}
```
api/beta/memory_stores/memory_versions/retrieve First recorded · 237 lines, first recorded
## Retrieve a memory version ### Path Parameters ### Query Parameters ### Header Parameters ### Returns ### Example #### Response
The first capture of this source. The page was already there, and this is what it said.
---
title: Retrieve a memory version
url: https://platform.claude.com/docs/en/api/beta/memory_stores/memory_versions/retrieve
---
## Retrieve a memory version
**get** `/v1/memory_stores/{memory_store_id}/memory_versions/{memory_version_id}`
Retrieve a memory version
### Path Parameters
- `memory_store_id: string`
- `memory_version_id: string`
### Query Parameters
- `view: optional BetaManagedAgentsMemoryView`
Query parameter for view
- `"basic"`
- `"full"`
### Header Parameters
- `"anthropic-beta": optional array of AnthropicBeta`
Optional header to specify the beta version(s) you want to use.
- `string`
- `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 30 more`
- `"message-batches-2024-09-24"`
- `"prompt-caching-2024-07-31"`
- `"computer-use-2024-10-22"`
- `"computer-use-2025-01-24"`
- `"pdfs-2024-09-25"`
- `"token-counting-2024-11-01"`
- `"token-efficient-tools-2025-02-19"`
- `"output-128k-2025-02-19"`
- `"files-api-2025-04-14"`
- `"mcp-client-2025-04-04"`
- `"mcp-client-2025-11-20"`
- `"dev-full-thinking-2025-05-14"`
- `"interleaved-thinking-2025-05-14"`
- `"code-execution-2025-05-22"`
- `"extended-cache-ttl-2025-04-11"`
- `"context-1m-2025-08-07"`
- `"context-management-2025-06-27"`
- `"model-context-window-exceeded-2025-08-26"`
- `"skills-2025-10-02"`
- `"fast-mode-2026-02-01"`
- `"output-300k-2026-03-24"`
- `"user-profiles-2026-03-24"`
- `"advisor-tool-2026-03-01"`
- `"managed-agents-2026-04-01"`
- `"cache-diagnosis-2026-04-07"`
- `"dreaming-2026-04-21"`
- `"thinking-token-count-2026-05-13"`
- `"server-side-fallback-2026-06-01"`
- `"server-side-fallback-2026-07-01"`
- `"fallback-credit-2026-06-01"`
- `"fallback-credit-2026-07-01"`
- `"agent-memory-2026-07-22"`
- `"mid-conversation-tool-changes-2026-07-01"`
### Returns
- `BetaManagedAgentsMemoryVersion object { id, created_at, memory_id, 10 more }`
A `memory_version` object: one immutable, attributed row in a memory's append-only history. Every non-no-op mutation to a memory produces a new version. Versions belong to the store (not the individual memory) and persist after the memory is deleted. Retrieving a redacted version returns 200 with `content`, `path`, `content_size_bytes`, and `content_sha256` set to `null`; branch on `redacted_at`, not HTTP status.
- `id: string`
Unique identifier for this version (a `memver_...` value).
- `created_at: string`
A timestamp in RFC 3339 format
- `memory_id: string`
ID of the memory this version snapshots (a `mem_...` value). Remains valid after the memory is deleted; pass it as `memory_id` to [List memory versions](/docs/en/api/beta/memory_stores/memory_versions/list) to retrieve the full lineage including the `deleted` row.
- `memory_store_id: string`
ID of the memory store this version belongs to (a `memstore_...` value).
- `operation: BetaManagedAgentsMemoryVersionOperation`
The kind of mutation a `memory_version` records. Every non-no-op mutation to a memory appends exactly one version row with one of these values.
- `"created"`
- `"modified"`
- `"deleted"`
- `type: "memory_version"`
- `"memory_version"`
- `content: optional string or null`
The memory's UTF-8 text content as of this version. `null` when `view=basic`, when `operation` is `deleted`, or when `redacted_at` is set.
- `content_sha256: optional string or null`
Lowercase hex SHA-256 digest of `content` as of this version (64 characters). `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise.
- `content_size_bytes: optional number or null`
Size of `content` in bytes as of this version. `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise.
- `created_by: optional BetaManagedAgentsActor`
Identifies who performed a write or redact operation. Captured at write time on the `memory_version` row. The API key that created a session is not recorded on agent writes; attribution answers who made the write, not who is ultimately responsible. Look up session provenance separately via the [Sessions API](/docs/en/api/sessions-retrieve).
- `BetaManagedAgentsSessionActor object { session_id, type }`
Attribution for a write made by an agent during a session, through the mounted filesystem at `/mnt/memory/`.
- `session_id: string`
ID of the session that performed the write (a `sesn_...` value). Look up the session via [Retrieve a session](/docs/en/api/sessions-retrieve) for further provenance.
- `type: "session_actor"`
- `"session_actor"`
- `BetaManagedAgentsAPIActor object { api_key_id, type }`
Attribution for a write made directly via the public API (outside of any session).
- `api_key_id: string`
ID of the API key that performed the write. This identifies the key, not the secret.
- `type: "api_actor"`
- `"api_actor"`
- `BetaManagedAgentsUserActor object { type, user_id }`
Attribution for a write made by a human user through the Anthropic Console.
- `type: "user_actor"`
- `"user_actor"`
- `user_id: string`
ID of the user who performed the write (a `user_...` value).
- `path: optional string or null`
The memory's path at the time of this write. `null` if and only if `redacted_at` is set.
- `redacted_at: optional string or null`
A timestamp in RFC 3339 format
- `redacted_by: optional BetaManagedAgentsActor`
Identifies who performed a write or redact operation. Captured at write time on the `memory_version` row. The API key that created a session is not recorded on agent writes; attribution answers who made the write, not who is ultimately responsible. Look up session provenance separately via the [Sessions API](/docs/en/api/sessions-retrieve).
### Example
```http
curl https://api.anthropic.com/v1/memory_stores/$MEMORY_STORE_ID/memory_versions/$MEMORY_VERSION_ID \
-H 'anthropic-version: 2023-06-01' \
-H 'anthropic-beta: agent-memory-2026-07-22' \
-H "X-Api-Key: $ANTHROPIC_API_KEY"
```
#### Response
```json
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"memory_id": "memory_id",
"memory_store_id": "memory_store_id",
"operation": "created",
"type": "memory_version",
"content": "content",
"content_sha256": "content_sha256",
"content_size_bytes": 0,
"created_by": {
"session_id": "x",
"type": "session_actor"
},
"path": "path",
"redacted_at": "2019-12-27T18:11:19.117Z",
"redacted_by": {
"session_id": "x",
"type": "session_actor"
}
}
```
api/beta/memory_stores/retrieve First recorded · 154 lines, first recorded
## Retrieve a memory store ### Path Parameters ### Header Parameters ### Returns ### Example #### Response
The first capture of this source. The page was already there, and this is what it said.
---
title: Retrieve a memory store
url: https://platform.claude.com/docs/en/api/beta/memory_stores/retrieve
---
## Retrieve a memory store
**get** `/v1/memory_stores/{memory_store_id}`
Retrieve a memory store
### Path Parameters
- `memory_store_id: string`
### Header Parameters
- `"anthropic-beta": optional array of AnthropicBeta`
Optional header to specify the beta version(s) you want to use.
- `string`
- `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 30 more`
- `"message-batches-2024-09-24"`
- `"prompt-caching-2024-07-31"`
- `"computer-use-2024-10-22"`
- `"computer-use-2025-01-24"`
- `"pdfs-2024-09-25"`
- `"token-counting-2024-11-01"`
- `"token-efficient-tools-2025-02-19"`
- `"output-128k-2025-02-19"`
- `"files-api-2025-04-14"`
- `"mcp-client-2025-04-04"`
- `"mcp-client-2025-11-20"`
- `"dev-full-thinking-2025-05-14"`
- `"interleaved-thinking-2025-05-14"`
- `"code-execution-2025-05-22"`
- `"extended-cache-ttl-2025-04-11"`
- `"context-1m-2025-08-07"`
- `"context-management-2025-06-27"`
- `"model-context-window-exceeded-2025-08-26"`
- `"skills-2025-10-02"`
- `"fast-mode-2026-02-01"`
- `"output-300k-2026-03-24"`
- `"user-profiles-2026-03-24"`
- `"advisor-tool-2026-03-01"`
- `"managed-agents-2026-04-01"`
- `"cache-diagnosis-2026-04-07"`
- `"dreaming-2026-04-21"`
- `"thinking-token-count-2026-05-13"`
- `"server-side-fallback-2026-06-01"`
- `"server-side-fallback-2026-07-01"`
- `"fallback-credit-2026-06-01"`
- `"fallback-credit-2026-07-01"`
- `"agent-memory-2026-07-22"`
- `"mid-conversation-tool-changes-2026-07-01"`
### Returns
- `BetaManagedAgentsMemoryStore object { id, created_at, name, 5 more }`
A `memory_store`: a named container for agent memories, scoped to a workspace. Attach a store to a session via `resources[]` to mount it as a directory the agent can read and write.
- `id: string`
Unique identifier for the memory store (a `memstore_...` tagged ID). Use this when attaching the store to a session, or in the `{memory_store_id}` path parameter of subsequent calls.
- `created_at: string`
A timestamp in RFC 3339 format
- `name: string`
Human-readable name for the store. 1–255 characters. The store's mount-path slug under `/mnt/memory/` is derived from this name.
- `type: "memory_store"`
- `"memory_store"`
- `updated_at: string`
A timestamp in RFC 3339 format
- `archived_at: optional string or null`
A timestamp in RFC 3339 format
- `description: optional string`
Free-text description of what the store contains, up to 1024 characters. Included in the agent's system prompt when the store is attached, so word it to be useful to the agent. Empty string when unset.
- `metadata: optional map[string]`
Arbitrary key-value tags for your own bookkeeping (such as the end user a store belongs to). Up to 16 pairs; keys 1–64 characters; values up to 512 characters. Returned on retrieve/list but not filterable.
### Example
```http
curl https://api.anthropic.com/v1/memory_stores/$MEMORY_STORE_ID \
-H 'anthropic-version: 2023-06-01' \
-H 'anthropic-beta: agent-memory-2026-07-22' \
-H "X-Api-Key: $ANTHROPIC_API_KEY"
```
#### Response
```json
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"name": "name",
"type": "memory_store",
"updated_at": "2019-12-27T18:11:19.117Z",
"archived_at": "2019-12-27T18:11:19.117Z",
"description": "description",
"metadata": {
"foo": "string"
}
}
```
api/beta/memory_stores/update First recorded · 170 lines, first recorded
## Update a memory store ### Path Parameters ### Header Parameters ### Body Parameters ### Returns ### Example #### Response
The first capture of this source. The page was already there, and this is what it said.
---
title: Update a memory store
url: https://platform.claude.com/docs/en/api/beta/memory_stores/update
---
## Update a memory store
**post** `/v1/memory_stores/{memory_store_id}`
Update a memory store
### Path Parameters
- `memory_store_id: string`
### Header Parameters
- `"anthropic-beta": optional array of AnthropicBeta`
Optional header to specify the beta version(s) you want to use.
- `string`
- `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 30 more`
- `"message-batches-2024-09-24"`
- `"prompt-caching-2024-07-31"`
- `"computer-use-2024-10-22"`
- `"computer-use-2025-01-24"`
- `"pdfs-2024-09-25"`
- `"token-counting-2024-11-01"`
- `"token-efficient-tools-2025-02-19"`
- `"output-128k-2025-02-19"`
- `"files-api-2025-04-14"`
- `"mcp-client-2025-04-04"`
- `"mcp-client-2025-11-20"`
- `"dev-full-thinking-2025-05-14"`
- `"interleaved-thinking-2025-05-14"`
- `"code-execution-2025-05-22"`
- `"extended-cache-ttl-2025-04-11"`
- `"context-1m-2025-08-07"`
- `"context-management-2025-06-27"`
- `"model-context-window-exceeded-2025-08-26"`
- `"skills-2025-10-02"`
- `"fast-mode-2026-02-01"`
- `"output-300k-2026-03-24"`
- `"user-profiles-2026-03-24"`
- `"advisor-tool-2026-03-01"`
- `"managed-agents-2026-04-01"`
- `"cache-diagnosis-2026-04-07"`
- `"dreaming-2026-04-21"`
- `"thinking-token-count-2026-05-13"`
- `"server-side-fallback-2026-06-01"`
- `"server-side-fallback-2026-07-01"`
- `"fallback-credit-2026-06-01"`
- `"fallback-credit-2026-07-01"`
- `"agent-memory-2026-07-22"`
- `"mid-conversation-tool-changes-2026-07-01"`
### Body Parameters
- `description: optional string or null`
New description for the store, up to 1024 characters. Pass an empty string to clear it.
- `metadata: optional map[string] or null`
Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omit the field to preserve. The stored bag is limited to 16 keys (up to 64 chars each) with values up to 512 chars.
- `name: optional string or null`
New human-readable name for the store. 1–255 characters; no control characters. Renaming changes the slug used for the store's `mount_path` in sessions created after the update.
### Returns
- `BetaManagedAgentsMemoryStore object { id, created_at, name, 5 more }`
A `memory_store`: a named container for agent memories, scoped to a workspace. Attach a store to a session via `resources[]` to mount it as a directory the agent can read and write.
- `id: string`
Unique identifier for the memory store (a `memstore_...` tagged ID). Use this when attaching the store to a session, or in the `{memory_store_id}` path parameter of subsequent calls.
- `created_at: string`
A timestamp in RFC 3339 format
- `name: string`
Human-readable name for the store. 1–255 characters. The store's mount-path slug under `/mnt/memory/` is derived from this name.
- `type: "memory_store"`
- `"memory_store"`
- `updated_at: string`
A timestamp in RFC 3339 format
- `archived_at: optional string or null`
A timestamp in RFC 3339 format
- `description: optional string`
Free-text description of what the store contains, up to 1024 characters. Included in the agent's system prompt when the store is attached, so word it to be useful to the agent. Empty string when unset.
- `metadata: optional map[string]`
Arbitrary key-value tags for your own bookkeeping (such as the end user a store belongs to). Up to 16 pairs; keys 1–64 characters; values up to 512 characters. Returned on retrieve/list but not filterable.
### Example
```http
curl https://api.anthropic.com/v1/memory_stores/$MEMORY_STORE_ID \
-H 'Content-Type: application/json' \
-H 'anthropic-version: 2023-06-01' \
-H 'anthropic-beta: agent-memory-2026-07-22' \
-H "X-Api-Key: $ANTHROPIC_API_KEY" \
-d '{}'
```
#### Response
```json
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"name": "name",
"type": "memory_store",
"updated_at": "2019-12-27T18:11:19.117Z",
"archived_at": "2019-12-27T18:11:19.117Z",
"description": "description",
"metadata": {
"foo": "string"
}
}
```
api/beta/messages First recorded · 42254 lines, first recorded
# Messages ## Create a Message ### Header Parameters ### Body Parameters ### Returns ### Example #### Response ## Count tokens in a Message ### Header Parameters ### Body Parameters ### Returns ### Example #### Response ## Domain Types ### Beta Advisor Message Iteration Usage ### Beta Advisor Redacted Result Block ### Beta Advisor Redacted Result Block Param ### Beta Advisor Result Block ### Beta Advisor Result Block Param ### Beta Advisor Tool 20260301 ### Beta Advisor Tool Result Block ### Beta Advisor Tool Result Block Param ### Beta Advisor Tool Result Error ### Beta Advisor Tool Result Error Param ### Beta All Thinking Turns ### Beta Base64 Image Source ### Beta Base64 PDF Source ### Beta Bash Code Execution Output Block ### Beta Bash Code Execution Output Block Param ### Beta Bash Code Execution Result Block ### Beta Bash Code Execution Result Block Param ### Beta Bash Code Execution Tool Result Block ### Beta Bash Code Execution Tool Result Block Param ### Beta Bash Code Execution Tool Result Error ### Beta Bash Code Execution Tool Result Error Param ### Beta Cache Control Ephemeral ### Beta Cache Creation ### Beta Cache Miss Messages Changed ### Beta Cache Miss Model Changed ### Beta Cache Miss Previous Message Not Found ### Beta Cache Miss System Changed ### Beta Cache Miss Tools Changed ### Beta Cache Miss Unavailable ### Beta Citation Char Location ### Beta Citation Char Location Param ### Beta Citation Config ### Beta Citation Content Block Location ### Beta Citation Content Block Location Param ### Beta Citation Page Location ### Beta Citation Page Location Param ### Beta Citation Search Result Location ### Beta Citation Search Result Location Param ### Beta Citation Web Search Result Location Param ### Beta Citations Config Param ### Beta Citations Delta ### Beta Citations Web Search Result Location ### Beta Clear Thinking 20251015 Edit ### Beta Clear Thinking 20251015 Edit Response ### Beta Clear Tool Uses 20250919 Edit ### Beta Clear Tool Uses 20250919 Edit Response ### Beta Code Execution Output Block ### Beta Code Execution Output Block Param ### Beta Code Execution Result Block ### Beta Code Execution Result Block Param ### Beta Code Execution Tool 20250522 ### Beta Code Execution Tool 20250825 ### Beta Code Execution Tool 20260120 ### Beta Code Execution Tool 20260521 ### Beta Code Execution Tool Result Block ### Beta Code Execution Tool Result Block Content ### Beta Code Execution Tool Result Block Param ### Beta Code Execution Tool Result Block Param Content ### Beta Code Execution Tool Result Error ### Beta Code Execution Tool Result Error Code ### Beta Code Execution Tool Result Error Param ### Beta Compact 20260112 Edit ### Beta Compaction Block ### Beta Compaction Block Param ### Beta Compaction Content Block Delta ### Beta Compaction Iteration Usage ### Beta Container ### Beta Container Params ### Beta Container Upload Block ### Beta Container Upload Block Param ### Beta Content Block ### Beta Content Block Param ### Beta Content Block Source ### Beta Content Block Source Content ### Beta Context Management Config ### Beta Context Management Response ### Beta Count Tokens Context Management Response ### Beta Diagnostics ### Beta Diagnostics Param ### Beta Direct Caller ### Beta Document Block ### Beta Encrypted Code Execution Result Block ### Beta Encrypted Code Execution Result Block Param ### Beta Fallback Block ### Beta Fallback Block Param ### Beta Fallback Credit Not Applied ### Beta Fallback Credit Redeemed ### Beta Fallback Credit Token Param ### Beta Fallback Credit Usage ### Beta Fallback Info ### Beta Fallback Info Param ### Beta Fallback Message Iteration Usage ### Beta Fallback Param ### Beta Fallback Refusal Trigger ### Beta Fallbacks Param ### Beta File Document Source ### Beta File Image Source ### Beta Image Block Param ### Beta Input JSON Delta ### Beta Input Tokens Clear At Least ### Beta Input Tokens Trigger ### Beta Iterations Usage ### Beta JSON Output Format ### Beta MCP Tool Config ### Beta MCP Tool Default Config ### Beta MCP Tool Result Block ### Beta MCP Tool Use Block ### Beta MCP Tool Use Block Param ### Beta MCP Toolset ### Beta Memory Tool 20250818 ### Beta Memory Tool 20250818 Command ### Beta Memory Tool 20250818 Create Command ### Beta Memory Tool 20250818 Delete Command ### Beta Memory Tool 20250818 Insert Command ### Beta Memory Tool 20250818 Rename Command ### Beta Memory Tool 20250818 Str Replace Command ### Beta Memory Tool 20250818 View Command ### Beta Message ### Beta Message Delta Usage ### Beta Message Iteration Usage ### Beta Message Param ### Beta Message Tokens Count ### Beta Metadata ### Beta Mid Conversation System Block Param ### Beta Output Config ### Beta Output Tokens Details ### Beta Plain Text Source ### Beta Raw Content Block Delta ### Beta Raw Content Block Delta Event ### Beta Raw Content Block Start Event ### Beta Raw Content Block Stop Event ### Beta Raw Message Delta Event ### Beta Raw Message Start Event ### Beta Raw Message Stop Event ### Beta Raw Message Stream Event ### Beta Redacted Thinking Block ### Beta Redacted Thinking Block Param ### Beta Refusal Stop Details ### Beta Request Document Block ### Beta Request MCP Server Tool Configuration ### Beta Request MCP Server URL Definition ### Beta Request MCP Tool Result Block Param ### Beta Request Tool Addition Block ### Beta Request Tool Removal Block ### Beta Search Result Block Param ### Beta Server Tool Caller ### Beta Server Tool Caller 20260120 ### Beta Server Tool Usage ### Beta Server Tool Use Block ### Beta Server Tool Use Block Param ### Beta Signature Delta ### Beta Skill ### Beta Skill Params ### Beta Stop Reason ### Beta Text Block ### Beta Text Block Param ### Beta Text Citation ### Beta Text Citation Param ### Beta Text Delta ### Beta Text Editor Code Execution Create Result Block ### Beta Text Editor Code Execution Create Result Block Param ### Beta Text Editor Code Execution Str Replace Result Block ### Beta Text Editor Code Execution Str Replace Result Block Param ### Beta Text Editor Code Execution Tool Result Block ### Beta Text Editor Code Execution Tool Result Block Param ### Beta Text Editor Code Execution Tool Result Error ### Beta Text Editor Code Execution Tool Result Error Param ### Beta Text Editor Code Execution View Result Block ### Beta Text Editor Code Execution View Result Block Param ### Beta Thinking Block ### Beta Thinking Block Param ### Beta Thinking Config Adaptive ### Beta Thinking Config Disabled ### Beta Thinking Config Enabled ### Beta Thinking Config Param ### Beta Thinking Delta ### Beta Thinking Turns ### Beta Token Task Budget ### Beta Tool ### Beta Tool Bash 20241022 ### Beta Tool Bash 20250124 ### Beta Tool Change MCP Tool Reference ### Beta Tool Change MCP Toolset Reference ### Beta Tool Change Tool Reference ### Beta Tool Choice ### Beta Tool Choice Any ### Beta Tool Choice Auto ### Beta Tool Choice None ### Beta Tool Choice Tool ### Beta Tool Computer Use 20241022 ### Beta Tool Computer Use 20250124 ### Beta Tool Computer Use 20251124 ### Beta Tool Reference Block ### Beta Tool Reference Block Param ### Beta Tool Result Block Param ### Beta Tool Search Tool Bm25 20251119 ### Beta Tool Search Tool Regex 20251119 ### Beta Tool Search Tool Result Block ### Beta Tool Search Tool Result Block Param ### Beta Tool Search Tool Result Error ### Beta Tool Search Tool Result Error Param ### Beta Tool Search Tool Search Result Block ### Beta Tool Search Tool Search Result Block Param ### Beta Tool Text Editor 20241022 ### Beta Tool Text Editor 20250124 ### Beta Tool Text Editor 20250429 ### Beta Tool Text Editor 20250728 ### Beta Tool Union ### Beta Tool Use Block ### Beta Tool Use Block Param ### Beta Tool Uses Keep ### Beta Tool Uses Trigger ### Beta URL Image Source ### Beta URL PDF Source ### Beta Usage ### Beta User Location ### Beta Web Fetch Block ### Beta Web Fetch Block Param ### Beta Web Fetch Tool 20250910 ### Beta Web Fetch Tool 20260209 ### Beta Web Fetch Tool 20260309 ### Beta Web Fetch Tool 20260318 ### Beta Web Fetch Tool Result Block ### Beta Web Fetch Tool Result Block Param ### Beta Web Fetch Tool Result Error Block ### Beta Web Fetch Tool Result Error Block Param ### Beta Web Fetch Tool Result Error Code ### Beta Web Search Result Block ### Beta Web Search Result Block Param ### Beta Web Search Tool 20250305 ### Beta Web Search Tool 20260209 ### Beta Web Search Tool 20260318 ### Beta Web Search Tool Request Error ### Beta Web Search Tool Result Block ### Beta Web Search Tool Result Block Content ### Beta Web Search Tool Result Block Param ### Beta Web Search Tool Result Block Param Content ### Beta Web Search Tool Result Error ### Beta Web Search Tool Result Error Code # Batches ## Create a Message Batch ### Header Parameters ### Body Parameters ### Returns ### Example #### Response ## Retrieve a Message Batch ### Path Parameters ### Header Parameters ### Returns ### Example #### Response ## List Message Batches ### Query Parameters ### Header Parameters ### Returns ### Example #### Response ## Cancel a Message Batch ### Path Parameters ### Header Parameters ### Returns ### Example #### Response ## Delete a Message Batch ### Path Parameters ### Header Parameters ### Returns ### Example #### Response ## Retrieve Message Batch results ### Path Parameters ### Header Parameters ### Returns ### Example ## Domain Types ### Beta Deleted Message Batch ### Beta Message Batch ### Beta Message Batch Canceled Result ### Beta Message Batch Errored Result ### Beta Message Batch Expired Result ### Beta Message Batch Individual Response ### Beta Message Batch Request Counts ### Beta Message Batch Result ### Beta Message Batch Succeeded Result
This page is larger than the 256 KiB this site keeps, so one side of the diff below stops where the stored text does.
The first capture of this source. The page was already there, and this is what it said.
---
title: Messages
url: https://platform.claude.com/docs/en/api/beta/messages
---
# Messages
## Create a Message
**post** `/v1/messages`
Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.
The Messages API can be used for either single queries or stateless multi-turn conversations.
Learn more about the Messages API in our [user guide](https://platform.claude.com/docs/en/get-started)
### Header Parameters
- `"anthropic-beta": optional array of AnthropicBeta`
Optional header to specify the beta version(s) you want to use.
- `string`
- `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 30 more`
- `"message-batches-2024-09-24"`
- `"prompt-caching-2024-07-31"`
- `"computer-use-2024-10-22"`
- `"computer-use-2025-01-24"`
- `"pdfs-2024-09-25"`
- `"token-counting-2024-11-01"`
- `"token-efficient-tools-2025-02-19"`
- `"output-128k-2025-02-19"`
- `"files-api-2025-04-14"`
- `"mcp-client-2025-04-04"`
- `"mcp-client-2025-11-20"`
- `"dev-full-thinking-2025-05-14"`
- `"interleaved-thinking-2025-05-14"`
- `"code-execution-2025-05-22"`
- `"extended-cache-ttl-2025-04-11"`
- `"context-1m-2025-08-07"`
- `"context-management-2025-06-27"`
- `"model-context-window-exceeded-2025-08-26"`
- `"skills-2025-10-02"`
- `"fast-mode-2026-02-01"`
- `"output-300k-2026-03-24"`
- `"user-profiles-2026-03-24"`
- `"advisor-tool-2026-03-01"`
- `"managed-agents-2026-04-01"`
- `"cache-diagnosis-2026-04-07"`
- `"dreaming-2026-04-21"`
- `"thinking-token-count-2026-05-13"`
- `"server-side-fallback-2026-06-01"`
- `"server-side-fallback-2026-07-01"`
- `"fallback-credit-2026-06-01"`
- `"fallback-credit-2026-07-01"`
- `"agent-memory-2026-07-22"`
- `"mid-conversation-tool-changes-2026-07-01"`
- `"anthropic-user-profile-id": optional string`
The user profile ID to attribute this request to. Use when acting on behalf of a party other than your organization. Requires the `user-profiles` beta header.
### Body Parameters
- `max_tokens: number`
The maximum number of tokens to generate before stopping.
Note that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.
Set to `0` to populate the [prompt cache](https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pre-warming-the-cache) without generating a response.
Different models have different maximum values for this parameter. See [models](https://platform.claude.com/docs/en/about-claude/models/overview) for details.
- `messages: array of BetaMessageParam`
Input messages.
Our models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn.
Each input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages.
If the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response.
Example with a single `user` message:
```json
[{"role": "user", "content": "Hello, Claude"}]
```
Example with multiple conversational turns:
```json
[
{"role": "user", "content": "Hello there."},
{"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},
{"role": "user", "content": "Can you explain LLMs in plain English?"},
]
```
Example with a partially-filled response from Claude:
```json
[
{"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
{"role": "assistant", "content": "The best answer is ("},
]
```
Each input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `"text"`. The following input messages are equivalent:
```json
{"role": "user", "content": "Hello, Claude"}
```
```json
{"role": "user", "content": [{"type": "text", "text": "Hello, Claude"}]}
```
See [input examples](https://platform.claude.com/docs/en/build-with-claude/working-with-messages).
Note that if you want to include a [system prompt](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices#give-claude-a-role), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API.
There is a limit of 100,000 messages in a single request.
- `content: string or array of BetaContentBlockParam`
- `string`
- `array of BetaContentBlockParam`
- `BetaTextBlockParam object { text, type, cache_control, citations }`
- `text: string`
- `type: "text"`
- `"text"`
- `cache_control: optional BetaCacheControlEphemeral or null`
Create a cache control breakpoint at this content block.
- `type: "ephemeral"`
- `"ephemeral"`
- `ttl: optional "5m" or "1h"`
The time-to-live for the cache control breakpoint.
This may be one the following values:
- `5m`: 5 minutes
- `1h`: 1 hour
Defaults to `5m`. See [prompt caching pricing](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) for details.
- `"5m"`
- `"1h"`
- `citations: optional array of BetaTextCitationParam or null`
- `BetaCitationCharLocationParam object { cited_text, document_index, document_title, 3 more }`
- `cited_text: string`
- `document_index: number`
- `document_title: string or null`
- `end_char_index: number`
- `start_char_index: number`
- `type: "char_location"`
- `"char_location"`
- `BetaCitationPageLocationParam object { cited_text, document_index, document_title, 3 more }`
- `cited_text: string`
- `document_index: number`
- `document_title: string or null`
- `end_page_number: number`
- `start_page_number: number`
- `type: "page_location"`
- `"page_location"`
- `BetaCitationContentBlockLocationParam object { cited_text, document_index, document_title, 3 more }`
- `cited_text: string`
The full text of the cited block range, concatenated.
Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
- `document_index: number`
- `document_title: string or null`
- `end_block_index: number`
Exclusive 0-based end index of the cited block range in the source's `content` array.
Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
- `start_block_index: number`
0-based index of the first cited block in the source's `content` array.
- `type: "content_block_location"`
- `"content_block_location"`
- `BetaCitationWebSearchResultLocationParam object { cited_text, encrypted_index, title, 2 more }`
- `cited_text: string`
- `encrypted_index: string`
- `title: string or null`
- `type: "web_search_result_location"`
- `"web_search_result_location"`
- `url: string`
- `BetaCitationSearchResultLocationParam object { cited_text, end_block_index, search_result_index, 4 more }`
- `cited_text: string`
The full text of the cited block range, concatenated.
Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
- `end_block_index: number`
Exclusive 0-based end index of the cited block range in the source's `content` array.
Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
- `search_result_index: number`
0-based index of the cited search result among all `search_result` content blocks in the request, in the order they appear across messages and tool results.
Counted separately from `document_index`; server-side web search results are not included in this count.
- `source: string`
- `start_block_index: number`
0-based index of the first cited block in the source's `content` array.
- `title: string or null`
- `type: "search_result_location"`
Cut at 300 lines. The page has the rest.
api/beta/messages/batches First recorded · 11033 lines, first recorded
# Batches ## Create a Message Batch ### Header Parameters ### Body Parameters ### Returns ### Example #### Response ## Retrieve a Message Batch ### Path Parameters ### Header Parameters ### Returns ### Example #### Response ## List Message Batches ### Query Parameters ### Header Parameters ### Returns ### Example #### Response ## Cancel a Message Batch ### Path Parameters ### Header Parameters ### Returns ### Example #### Response ## Delete a Message Batch ### Path Parameters ### Header Parameters ### Returns ### Example #### Response ## Retrieve Message Batch results ### Path Parameters ### Header Parameters ### Returns ### Example ## Domain Types ### Beta Deleted Message Batch ### Beta Message Batch ### Beta Message Batch Canceled Result ### Beta Message Batch Errored Result ### Beta Message Batch Expired Result ### Beta Message Batch Individual Response ### Beta Message Batch Request Counts ### Beta Message Batch Result ### Beta Message Batch Succeeded Result
This page is larger than the 256 KiB this site keeps, so one side of the diff below stops where the stored text does.
The first capture of this source. The page was already there, and this is what it said.
---
title: Batches
url: https://platform.claude.com/docs/en/api/beta/messages/batches
---
# Batches
## Create a Message Batch
**post** `/v1/messages/batches`
Send a batch of Message creation requests.
The Message Batches API can be used to process multiple Messages API requests at once. Once a Message Batch is created, it begins processing immediately. Batches can take up to 24 hours to complete.
Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
### Header Parameters
- `"anthropic-beta": optional array of AnthropicBeta`
Optional header to specify the beta version(s) you want to use.
- `string`
- `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 30 more`
- `"message-batches-2024-09-24"`
- `"prompt-caching-2024-07-31"`
- `"computer-use-2024-10-22"`
- `"computer-use-2025-01-24"`
- `"pdfs-2024-09-25"`
- `"token-counting-2024-11-01"`
- `"token-efficient-tools-2025-02-19"`
- `"output-128k-2025-02-19"`
- `"files-api-2025-04-14"`
- `"mcp-client-2025-04-04"`
- `"mcp-client-2025-11-20"`
- `"dev-full-thinking-2025-05-14"`
- `"interleaved-thinking-2025-05-14"`
- `"code-execution-2025-05-22"`
- `"extended-cache-ttl-2025-04-11"`
- `"context-1m-2025-08-07"`
- `"context-management-2025-06-27"`
- `"model-context-window-exceeded-2025-08-26"`
- `"skills-2025-10-02"`
- `"fast-mode-2026-02-01"`
- `"output-300k-2026-03-24"`
- `"user-profiles-2026-03-24"`
- `"advisor-tool-2026-03-01"`
- `"managed-agents-2026-04-01"`
- `"cache-diagnosis-2026-04-07"`
- `"dreaming-2026-04-21"`
- `"thinking-token-count-2026-05-13"`
- `"server-side-fallback-2026-06-01"`
- `"server-side-fallback-2026-07-01"`
- `"fallback-credit-2026-06-01"`
- `"fallback-credit-2026-07-01"`
- `"agent-memory-2026-07-22"`
- `"mid-conversation-tool-changes-2026-07-01"`
- `"anthropic-user-profile-id": optional string`
The user profile ID to attribute the requests in this batch to. Use when acting on behalf of a party other than your organization. Requires the `user-profiles` beta header. Applies to every request in the batch; an individual request whose `user_profile_id` body field conflicts with this header is errored.
### Body Parameters
- `requests: array of object { custom_id, params }`
List of requests for prompt completion. Each is an individual request to create a Message.
- `custom_id: string`
Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.
Must be unique for each request within the Message Batch.
- `params: object { max_tokens, messages, model, 22 more }`
Messages API creation parameters for the individual request.
See the [Messages API reference](https://platform.claude.com/docs/en/api/messages) for full documentation on available parameters.
- `max_tokens: number`
The maximum number of tokens to generate before stopping.
Note that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.
Set to `0` to populate the [prompt cache](https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pre-warming-the-cache) without generating a response.
Different models have different maximum values for this parameter. See [models](https://platform.claude.com/docs/en/about-claude/models/overview) for details.
- `messages: array of BetaMessageParam`
Input messages.
Our models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn.
Each input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages.
If the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response.
Example with a single `user` message:
```json
[{"role": "user", "content": "Hello, Claude"}]
```
Example with multiple conversational turns:
```json
[
{"role": "user", "content": "Hello there."},
{"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},
{"role": "user", "content": "Can you explain LLMs in plain English?"},
]
```
Example with a partially-filled response from Claude:
```json
[
{"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
{"role": "assistant", "content": "The best answer is ("},
]
```
Each input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `"text"`. The following input messages are equivalent:
```json
{"role": "user", "content": "Hello, Claude"}
```
```json
{"role": "user", "content": [{"type": "text", "text": "Hello, Claude"}]}
```
See [input examples](https://platform.claude.com/docs/en/build-with-claude/working-with-messages).
Note that if you want to include a [system prompt](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices#give-claude-a-role), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API.
There is a limit of 100,000 messages in a single request.
- `content: string or array of BetaContentBlockParam`
- `string`
- `array of BetaContentBlockParam`
- `BetaTextBlockParam object { text, type, cache_control, citations }`
- `text: string`
- `type: "text"`
- `"text"`
- `cache_control: optional BetaCacheControlEphemeral or null`
Create a cache control breakpoint at this content block.
- `type: "ephemeral"`
- `"ephemeral"`
- `ttl: optional "5m" or "1h"`
The time-to-live for the cache control breakpoint.
This may be one the following values:
- `5m`: 5 minutes
- `1h`: 1 hour
Defaults to `5m`. See [prompt caching pricing](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) for details.
- `"5m"`
- `"1h"`
- `citations: optional array of BetaTextCitationParam or null`
- `BetaCitationCharLocationParam object { cited_text, document_index, document_title, 3 more }`
- `cited_text: string`
- `document_index: number`
- `document_title: string or null`
- `end_char_index: number`
- `start_char_index: number`
- `type: "char_location"`
- `"char_location"`
- `BetaCitationPageLocationParam object { cited_text, document_index, document_title, 3 more }`
- `cited_text: string`
- `document_index: number`
- `document_title: string or null`
- `end_page_number: number`
- `start_page_number: number`
- `type: "page_location"`
- `"page_location"`
- `BetaCitationContentBlockLocationParam object { cited_text, document_index, document_title, 3 more }`
- `cited_text: string`
The full text of the cited block range, concatenated.
Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
- `document_index: number`
- `document_title: string or null`
- `end_block_index: number`
Exclusive 0-based end index of the cited block range in the source's `content` array.
Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
- `start_block_index: number`
0-based index of the first cited block in the source's `content` array.
- `type: "content_block_location"`
- `"content_block_location"`
- `BetaCitationWebSearchResultLocationParam object { cited_text, encrypted_index, title, 2 more }`
- `cited_text: string`
- `encrypted_index: string`
- `title: string or null`
- `type: "web_search_result_location"`
- `"web_search_result_location"`
- `url: string`
- `BetaCitationSearchResultLocationParam object { cited_text, end_block_index, search_result_index, 4 more }`
- `cited_text: string`
The full text of the cited block range, concatenated.
Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
- `end_block_index: number`
Exclusive 0-based end index of the cited block range in the source's `content` array.
Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
Cut at 300 lines. The page has the rest.
api/beta/messages/batches/cancel First recorded · 219 lines, first recorded
## Cancel a Message Batch ### Path Parameters ### Header Parameters ### Returns ### Example #### Response
The first capture of this source. The page was already there, and this is what it said.
---
title: Cancel a Message Batch
url: https://platform.claude.com/docs/en/api/beta/messages/batches/cancel
---
## Cancel a Message Batch
**post** `/v1/messages/batches/{message_batch_id}/cancel`
Batches may be canceled any time before processing ends. Once cancellation is initiated, the batch enters a `canceling` state, at which time the system may complete any in-progress, non-interruptible requests before finalizing cancellation.
The number of canceled requests is specified in `request_counts`. To determine which requests were canceled, check the individual results within the batch. Note that cancellation may not result in any canceled requests if they were non-interruptible.
Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
### Path Parameters
- `message_batch_id: string`
ID of the Message Batch.
### Header Parameters
- `"anthropic-beta": optional array of AnthropicBeta`
Optional header to specify the beta version(s) you want to use.
- `string`
- `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 30 more`
- `"message-batches-2024-09-24"`
- `"prompt-caching-2024-07-31"`
- `"computer-use-2024-10-22"`
- `"computer-use-2025-01-24"`
- `"pdfs-2024-09-25"`
- `"token-counting-2024-11-01"`
- `"token-efficient-tools-2025-02-19"`
- `"output-128k-2025-02-19"`
- `"files-api-2025-04-14"`
- `"mcp-client-2025-04-04"`
- `"mcp-client-2025-11-20"`
- `"dev-full-thinking-2025-05-14"`
- `"interleaved-thinking-2025-05-14"`
- `"code-execution-2025-05-22"`
- `"extended-cache-ttl-2025-04-11"`
- `"context-1m-2025-08-07"`
- `"context-management-2025-06-27"`
- `"model-context-window-exceeded-2025-08-26"`
- `"skills-2025-10-02"`
- `"fast-mode-2026-02-01"`
- `"output-300k-2026-03-24"`
- `"user-profiles-2026-03-24"`
- `"advisor-tool-2026-03-01"`
- `"managed-agents-2026-04-01"`
- `"cache-diagnosis-2026-04-07"`
- `"dreaming-2026-04-21"`
- `"thinking-token-count-2026-05-13"`
- `"server-side-fallback-2026-06-01"`
- `"server-side-fallback-2026-07-01"`
- `"fallback-credit-2026-06-01"`
- `"fallback-credit-2026-07-01"`
- `"agent-memory-2026-07-22"`
- `"mid-conversation-tool-changes-2026-07-01"`
### Returns
- `BetaMessageBatch object { id, archived_at, cancel_initiated_at, 7 more }`
- `id: string`
Unique object identifier.
The format and length of IDs may change over time.
- `archived_at: string or null`
RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
- `cancel_initiated_at: string or null`
RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
- `created_at: string`
RFC 3339 datetime string representing the time at which the Message Batch was created.
- `ended_at: string or null`
RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
- `expires_at: string`
RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
- `processing_status: "in_progress" or "canceling" or "ended"`
Processing status of the Message Batch.
- `"in_progress"`
- `"canceling"`
- `"ended"`
- `request_counts: BetaMessageBatchRequestCounts`
Tallies requests within the Message Batch, categorized by their status.
Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
- `canceled: number`
Number of requests in the Message Batch that have been canceled.
This is zero until processing of the entire Message Batch has ended.
- `errored: number`
Number of requests in the Message Batch that encountered an error.
This is zero until processing of the entire Message Batch has ended.
- `expired: number`
Number of requests in the Message Batch that have expired.
This is zero until processing of the entire Message Batch has ended.
- `processing: number`
Number of requests in the Message Batch that are processing.
- `succeeded: number`
Number of requests in the Message Batch that have completed successfully.
This is zero until processing of the entire Message Batch has ended.
- `results_url: string or null`
URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
- `type: "message_batch"`
Object type.
For Message Batches, this is always `"message_batch"`.
- `"message_batch"`
### Example
```http
curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID/cancel \
-X POST \
-H 'anthropic-version: 2023-06-01' \
-H 'anthropic-beta: message-batches-2024-09-24' \
-H "X-Api-Key: $ANTHROPIC_API_KEY"
```
#### Response
```json
{
"id": "msgbatch_013Zva2CMHLNnXjNJJKqJ2EF",
"archived_at": "2024-08-20T18:37:24.100435Z",
"cancel_initiated_at": "2024-08-20T18:37:24.100435Z",
"created_at": "2024-08-20T18:37:24.100435Z",
"ended_at": "2024-08-20T18:37:24.100435Z",
"expires_at": "2024-08-20T18:37:24.100435Z",
"processing_status": "in_progress",
"request_counts": {
"canceled": 10,
"errored": 30,
"expired": 10,
"processing": 100,
"succeeded": 50
},
"results_url": "https://api.anthropic.com/v1/messages/batches/msgbatch_013Zva2CMHLNnXjNJJKqJ2EF/results",
"type": "message_batch"
}
```
api/beta/messages/batches/create First recorded · 3359 lines, first recorded
## Create a Message Batch ### Header Parameters ### Body Parameters ### Returns ### Example #### Response
The first capture of this source. The page was already there, and this is what it said.
---
title: Create a Message Batch
url: https://platform.claude.com/docs/en/api/beta/messages/batches/create
---
## Create a Message Batch
**post** `/v1/messages/batches`
Send a batch of Message creation requests.
The Message Batches API can be used to process multiple Messages API requests at once. Once a Message Batch is created, it begins processing immediately. Batches can take up to 24 hours to complete.
Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
### Header Parameters
- `"anthropic-beta": optional array of AnthropicBeta`
Optional header to specify the beta version(s) you want to use.
- `string`
- `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 30 more`
- `"message-batches-2024-09-24"`
- `"prompt-caching-2024-07-31"`
- `"computer-use-2024-10-22"`
- `"computer-use-2025-01-24"`
- `"pdfs-2024-09-25"`
- `"token-counting-2024-11-01"`
- `"token-efficient-tools-2025-02-19"`
- `"output-128k-2025-02-19"`
- `"files-api-2025-04-14"`
- `"mcp-client-2025-04-04"`
- `"mcp-client-2025-11-20"`
- `"dev-full-thinking-2025-05-14"`
- `"interleaved-thinking-2025-05-14"`
- `"code-execution-2025-05-22"`
- `"extended-cache-ttl-2025-04-11"`
- `"context-1m-2025-08-07"`
- `"context-management-2025-06-27"`
- `"model-context-window-exceeded-2025-08-26"`
- `"skills-2025-10-02"`
- `"fast-mode-2026-02-01"`
- `"output-300k-2026-03-24"`
- `"user-profiles-2026-03-24"`
- `"advisor-tool-2026-03-01"`
- `"managed-agents-2026-04-01"`
- `"cache-diagnosis-2026-04-07"`
- `"dreaming-2026-04-21"`
- `"thinking-token-count-2026-05-13"`
- `"server-side-fallback-2026-06-01"`
- `"server-side-fallback-2026-07-01"`
- `"fallback-credit-2026-06-01"`
- `"fallback-credit-2026-07-01"`
- `"agent-memory-2026-07-22"`
- `"mid-conversation-tool-changes-2026-07-01"`
- `"anthropic-user-profile-id": optional string`
The user profile ID to attribute the requests in this batch to. Use when acting on behalf of a party other than your organization. Requires the `user-profiles` beta header. Applies to every request in the batch; an individual request whose `user_profile_id` body field conflicts with this header is errored.
### Body Parameters
- `requests: array of object { custom_id, params }`
List of requests for prompt completion. Each is an individual request to create a Message.
- `custom_id: string`
Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.
Must be unique for each request within the Message Batch.
- `params: object { max_tokens, messages, model, 22 more }`
Messages API creation parameters for the individual request.
See the [Messages API reference](https://platform.claude.com/docs/en/api/messages) for full documentation on available parameters.
- `max_tokens: number`
The maximum number of tokens to generate before stopping.
Note that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.
Set to `0` to populate the [prompt cache](https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pre-warming-the-cache) without generating a response.
Different models have different maximum values for this parameter. See [models](https://platform.claude.com/docs/en/about-claude/models/overview) for details.
- `messages: array of BetaMessageParam`
Input messages.
Our models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn.
Each input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages.
If the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response.
Example with a single `user` message:
```json
[{"role": "user", "content": "Hello, Claude"}]
```
Example with multiple conversational turns:
```json
[
{"role": "user", "content": "Hello there."},
{"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},
{"role": "user", "content": "Can you explain LLMs in plain English?"},
]
```
Example with a partially-filled response from Claude:
```json
[
{"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
{"role": "assistant", "content": "The best answer is ("},
]
```
Each input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `"text"`. The following input messages are equivalent:
```json
{"role": "user", "content": "Hello, Claude"}
```
```json
{"role": "user", "content": [{"type": "text", "text": "Hello, Claude"}]}
```
See [input examples](https://platform.claude.com/docs/en/build-with-claude/working-with-messages).
Note that if you want to include a [system prompt](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices#give-claude-a-role), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API.
There is a limit of 100,000 messages in a single request.
- `content: string or array of BetaContentBlockParam`
- `string`
- `array of BetaContentBlockParam`
- `BetaTextBlockParam object { text, type, cache_control, citations }`
- `text: string`
- `type: "text"`
- `"text"`
- `cache_control: optional BetaCacheControlEphemeral or null`
Create a cache control breakpoint at this content block.
- `type: "ephemeral"`
- `"ephemeral"`
- `ttl: optional "5m" or "1h"`
The time-to-live for the cache control breakpoint.
This may be one the following values:
- `5m`: 5 minutes
- `1h`: 1 hour
Defaults to `5m`. See [prompt caching pricing](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) for details.
- `"5m"`
- `"1h"`
- `citations: optional array of BetaTextCitationParam or null`
- `BetaCitationCharLocationParam object { cited_text, document_index, document_title, 3 more }`
- `cited_text: string`
- `document_index: number`
- `document_title: string or null`
- `end_char_index: number`
- `start_char_index: number`
- `type: "char_location"`
- `"char_location"`
- `BetaCitationPageLocationParam object { cited_text, document_index, document_title, 3 more }`
- `cited_text: string`
- `document_index: number`
- `document_title: string or null`
- `end_page_number: number`
- `start_page_number: number`
- `type: "page_location"`
- `"page_location"`
- `BetaCitationContentBlockLocationParam object { cited_text, document_index, document_title, 3 more }`
- `cited_text: string`
The full text of the cited block range, concatenated.
Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
- `document_index: number`
- `document_title: string or null`
- `end_block_index: number`
Exclusive 0-based end index of the cited block range in the source's `content` array.
Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
- `start_block_index: number`
0-based index of the first cited block in the source's `content` array.
- `type: "content_block_location"`
- `"content_block_location"`
- `BetaCitationWebSearchResultLocationParam object { cited_text, encrypted_index, title, 2 more }`
- `cited_text: string`
- `encrypted_index: string`
- `title: string or null`
- `type: "web_search_result_location"`
- `"web_search_result_location"`
- `url: string`
- `BetaCitationSearchResultLocationParam object { cited_text, end_block_index, search_result_index, 4 more }`
- `cited_text: string`
The full text of the cited block range, concatenated.
Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
- `end_block_index: number`
Exclusive 0-based end index of the cited block range in the source's `content` array.
Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
- `search_result_index: number`
Cut at 300 lines. The page has the rest.
api/beta/messages/batches/delete First recorded · 131 lines, first recorded
## Delete a Message Batch ### Path Parameters ### Header Parameters ### Returns ### Example #### Response
The first capture of this source. The page was already there, and this is what it said.
---
title: Delete a Message Batch
url: https://platform.claude.com/docs/en/api/beta/messages/batches/delete
---
## Delete a Message Batch
**delete** `/v1/messages/batches/{message_batch_id}`
Delete a Message Batch.
Message Batches can only be deleted once they've finished processing. If you'd like to delete an in-progress batch, you must first cancel it.
Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
### Path Parameters
- `message_batch_id: string`
ID of the Message Batch.
### Header Parameters
- `"anthropic-beta": optional array of AnthropicBeta`
Optional header to specify the beta version(s) you want to use.
- `string`
- `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 30 more`
- `"message-batches-2024-09-24"`
- `"prompt-caching-2024-07-31"`
- `"computer-use-2024-10-22"`
- `"computer-use-2025-01-24"`
- `"pdfs-2024-09-25"`
- `"token-counting-2024-11-01"`
- `"token-efficient-tools-2025-02-19"`
- `"output-128k-2025-02-19"`
- `"files-api-2025-04-14"`
- `"mcp-client-2025-04-04"`
- `"mcp-client-2025-11-20"`
- `"dev-full-thinking-2025-05-14"`
- `"interleaved-thinking-2025-05-14"`
- `"code-execution-2025-05-22"`
- `"extended-cache-ttl-2025-04-11"`
- `"context-1m-2025-08-07"`
- `"context-management-2025-06-27"`
- `"model-context-window-exceeded-2025-08-26"`
- `"skills-2025-10-02"`
- `"fast-mode-2026-02-01"`
- `"output-300k-2026-03-24"`
- `"user-profiles-2026-03-24"`
- `"advisor-tool-2026-03-01"`
- `"managed-agents-2026-04-01"`
- `"cache-diagnosis-2026-04-07"`
- `"dreaming-2026-04-21"`
- `"thinking-token-count-2026-05-13"`
- `"server-side-fallback-2026-06-01"`
- `"server-side-fallback-2026-07-01"`
- `"fallback-credit-2026-06-01"`
- `"fallback-credit-2026-07-01"`
- `"agent-memory-2026-07-22"`
- `"mid-conversation-tool-changes-2026-07-01"`
### Returns
- `BetaDeletedMessageBatch object { id, type }`
- `id: string`
ID of the Message Batch.
- `type: "message_batch_deleted"`
Deleted object type.
For Message Batches, this is always `"message_batch_deleted"`.
- `"message_batch_deleted"`
### Example
```http
curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID \
-X DELETE \
-H 'anthropic-version: 2023-06-01' \
-H 'anthropic-beta: message-batches-2024-09-24' \
-H "X-Api-Key: $ANTHROPIC_API_KEY"
```
#### Response
```json
{
"id": "msgbatch_013Zva2CMHLNnXjNJJKqJ2EF",
"type": "message_batch_deleted"
}
```
api/beta/messages/batches/list First recorded · 245 lines, first recorded
## List Message Batches ### Query Parameters ### Header Parameters ### Returns ### Example #### Response
The first capture of this source. The page was already there, and this is what it said.
---
title: List Message Batches
url: https://platform.claude.com/docs/en/api/beta/messages/batches/list
---
## List Message Batches
**get** `/v1/messages/batches`
List all Message Batches within a Workspace. Most recently created batches are returned first.
Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
### Query Parameters
- `after_id: optional string`
ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.
- `before_id: optional string`
ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.
- `limit: optional number`
Number of items to return per page.
Defaults to `20`. Ranges from `1` to `1000`.
### Header Parameters
- `"anthropic-beta": optional array of AnthropicBeta`
Optional header to specify the beta version(s) you want to use.
- `string`
- `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 30 more`
- `"message-batches-2024-09-24"`
- `"prompt-caching-2024-07-31"`
- `"computer-use-2024-10-22"`
- `"computer-use-2025-01-24"`
- `"pdfs-2024-09-25"`
- `"token-counting-2024-11-01"`
- `"token-efficient-tools-2025-02-19"`
- `"output-128k-2025-02-19"`
- `"files-api-2025-04-14"`
- `"mcp-client-2025-04-04"`
- `"mcp-client-2025-11-20"`
- `"dev-full-thinking-2025-05-14"`
- `"interleaved-thinking-2025-05-14"`
- `"code-execution-2025-05-22"`
- `"extended-cache-ttl-2025-04-11"`
- `"context-1m-2025-08-07"`
- `"context-management-2025-06-27"`
- `"model-context-window-exceeded-2025-08-26"`
- `"skills-2025-10-02"`
- `"fast-mode-2026-02-01"`
- `"output-300k-2026-03-24"`
- `"user-profiles-2026-03-24"`
- `"advisor-tool-2026-03-01"`
- `"managed-agents-2026-04-01"`
- `"cache-diagnosis-2026-04-07"`
- `"dreaming-2026-04-21"`
- `"thinking-token-count-2026-05-13"`
- `"server-side-fallback-2026-06-01"`
- `"server-side-fallback-2026-07-01"`
- `"fallback-credit-2026-06-01"`
- `"fallback-credit-2026-07-01"`
- `"agent-memory-2026-07-22"`
- `"mid-conversation-tool-changes-2026-07-01"`
### Returns
- `data: array of BetaMessageBatch`
- `id: string`
Unique object identifier.
The format and length of IDs may change over time.
- `archived_at: string or null`
RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
- `cancel_initiated_at: string or null`
RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
- `created_at: string`
RFC 3339 datetime string representing the time at which the Message Batch was created.
- `ended_at: string or null`
RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
- `expires_at: string`
RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
- `processing_status: "in_progress" or "canceling" or "ended"`
Processing status of the Message Batch.
- `"in_progress"`
- `"canceling"`
- `"ended"`
- `request_counts: BetaMessageBatchRequestCounts`
Tallies requests within the Message Batch, categorized by their status.
Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
- `canceled: number`
Number of requests in the Message Batch that have been canceled.
This is zero until processing of the entire Message Batch has ended.
- `errored: number`
Number of requests in the Message Batch that encountered an error.
This is zero until processing of the entire Message Batch has ended.
- `expired: number`
Number of requests in the Message Batch that have expired.
This is zero until processing of the entire Message Batch has ended.
- `processing: number`
Number of requests in the Message Batch that are processing.
- `succeeded: number`
Number of requests in the Message Batch that have completed successfully.
This is zero until processing of the entire Message Batch has ended.
- `results_url: string or null`
URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
- `type: "message_batch"`
Object type.
For Message Batches, this is always `"message_batch"`.
- `"message_batch"`
- `first_id: string or null`
First ID in the `data` list. Can be used as the `before_id` for the previous page.
- `has_more: boolean`
Indicates if there are more results in the requested page direction.
- `last_id: string or null`
Last ID in the `data` list. Can be used as the `after_id` for the next page.
### Example
```http
curl https://api.anthropic.com/v1/messages/batches \
-H 'anthropic-version: 2023-06-01' \
-H 'anthropic-beta: message-batches-2024-09-24' \
-H "X-Api-Key: $ANTHROPIC_API_KEY"
```
#### Response
```json
{
"data": [
{
"id": "msgbatch_013Zva2CMHLNnXjNJJKqJ2EF",
"archived_at": "2024-08-20T18:37:24.100435Z",
"cancel_initiated_at": "2024-08-20T18:37:24.100435Z",
"created_at": "2024-08-20T18:37:24.100435Z",
"ended_at": "2024-08-20T18:37:24.100435Z",
"expires_at": "2024-08-20T18:37:24.100435Z",
"processing_status": "in_progress",
"request_counts": {
"canceled": 10,
"errored": 30,
"expired": 10,
"processing": 100,
"succeeded": 50
},
"results_url": "https://api.anthropic.com/v1/messages/batches/msgbatch_013Zva2CMHLNnXjNJJKqJ2EF/results",
"type": "message_batch"
}
],
"first_id": "first_id",
"has_more": true,
"last_id": "last_id"
}
```
api/beta/messages/batches/results First recorded · 1769 lines, first recorded
## Retrieve Message Batch results ### Path Parameters ### Header Parameters ### Returns ### Example
The first capture of this source. The page was already there, and this is what it said.
---
title: Retrieve Message Batch results
url: https://platform.claude.com/docs/en/api/beta/messages/batches/results
---
## Retrieve Message Batch results
**get** `/v1/messages/batches/{message_batch_id}/results`
Streams the results of a Message Batch as a `.jsonl` file.
Each line in the file is a JSON object containing the result of a single request in the Message Batch. Results are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
### Path Parameters
- `message_batch_id: string`
ID of the Message Batch.
### Header Parameters
- `"anthropic-beta": optional array of AnthropicBeta`
Optional header to specify the beta version(s) you want to use.
- `string`
- `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 30 more`
- `"message-batches-2024-09-24"`
- `"prompt-caching-2024-07-31"`
- `"computer-use-2024-10-22"`
- `"computer-use-2025-01-24"`
- `"pdfs-2024-09-25"`
- `"token-counting-2024-11-01"`
- `"token-efficient-tools-2025-02-19"`
- `"output-128k-2025-02-19"`
- `"files-api-2025-04-14"`
- `"mcp-client-2025-04-04"`
- `"mcp-client-2025-11-20"`
- `"dev-full-thinking-2025-05-14"`
- `"interleaved-thinking-2025-05-14"`
- `"code-execution-2025-05-22"`
- `"extended-cache-ttl-2025-04-11"`
- `"context-1m-2025-08-07"`
- `"context-management-2025-06-27"`
- `"model-context-window-exceeded-2025-08-26"`
- `"skills-2025-10-02"`
- `"fast-mode-2026-02-01"`
- `"output-300k-2026-03-24"`
- `"user-profiles-2026-03-24"`
- `"advisor-tool-2026-03-01"`
- `"managed-agents-2026-04-01"`
- `"cache-diagnosis-2026-04-07"`
- `"dreaming-2026-04-21"`
- `"thinking-token-count-2026-05-13"`
- `"server-side-fallback-2026-06-01"`
- `"server-side-fallback-2026-07-01"`
- `"fallback-credit-2026-06-01"`
- `"fallback-credit-2026-07-01"`
- `"agent-memory-2026-07-22"`
- `"mid-conversation-tool-changes-2026-07-01"`
### Returns
- `BetaMessageBatchIndividualResponse object { custom_id, result }`
This is a single line in the response `.jsonl` file and does not represent the response as a whole.
- `custom_id: string`
Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.
Must be unique for each request within the Message Batch.
- `result: BetaMessageBatchResult`
Processing result for this request.
Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.
- `BetaMessageBatchSucceededResult object { message, type }`
- `message: BetaMessage`
- `id: string`
Unique object identifier.
The format and length of IDs may change over time.
- `container: BetaContainer or null`
Information about the container used in the request (for the code execution tool)
- `id: string`
Identifier for the container used in this request
- `expires_at: string`
The time at which the container will expire.
- `skills: array of BetaSkill or null`
Skills loaded in the container
- `skill_id: string`
Skill ID
- `type: "anthropic" or "custom"`
Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
- `"anthropic"`
- `"custom"`
- `version: string`
Skill version or 'latest' for most recent version
- `content: array of BetaContentBlock`
Content generated by the model.
This is an array of content blocks, each of which has a `type` that determines its shape.
Example:
```json
[{"type": "text", "text": "Hi, I'm Claude."}]
```
If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.
For example, if the input `messages` were:
```json
[
{"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
{"role": "assistant", "content": "The best answer is ("}
]
```
Then the response `content` might be:
```json
[{"type": "text", "text": "B)"}]
```
- `BetaTextBlock object { citations, text, type }`
- `citations: array of BetaTextCitation or null`
Citations supporting the text block.
The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.
- `BetaCitationCharLocation object { cited_text, document_index, document_title, 4 more }`
- `cited_text: string`
- `document_index: number`
- `document_title: string or null`
- `end_char_index: number`
- `file_id: string or null`
- `start_char_index: number`
- `type: "char_location"`
- `"char_location"`
- `BetaCitationPageLocation object { cited_text, document_index, document_title, 4 more }`
- `cited_text: string`
- `document_index: number`
- `document_title: string or null`
- `end_page_number: number`
- `file_id: string or null`
- `start_page_number: number`
- `type: "page_location"`
- `"page_location"`
- `BetaCitationContentBlockLocation object { cited_text, document_index, document_title, 4 more }`
- `cited_text: string`
The full text of the cited block range, concatenated.
Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
- `document_index: number`
- `document_title: string or null`
- `end_block_index: number`
Exclusive 0-based end index of the cited block range in the source's `content` array.
Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
- `file_id: string or null`
- `start_block_index: number`
0-based index of the first cited block in the source's `content` array.
- `type: "content_block_location"`
- `"content_block_location"`
- `BetaCitationsWebSearchResultLocation object { cited_text, encrypted_index, title, 2 more }`
- `cited_text: string`
- `encrypted_index: string`
- `title: string or null`
- `type: "web_search_result_location"`
- `"web_search_result_location"`
- `url: string`
- `BetaCitationSearchResultLocation object { cited_text, end_block_index, search_result_index, 4 more }`
- `cited_text: string`
The full text of the cited block range, concatenated.
Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
- `end_block_index: number`
Exclusive 0-based end index of the cited block range in the source's `content` array.
Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
- `search_result_index: number`
0-based index of the cited search result among all `search_result` content blocks in the request, in the order they appear across messages and tool results.
Counted separately from `document_index`; server-side web search results are not included in this count.
- `source: string`
- `start_block_index: number`
0-based index of the first cited block in the source's `content` array.
- `title: string or null`
Cut at 300 lines. The page has the rest.
api/beta/messages/batches/retrieve First recorded · 216 lines, first recorded
## Retrieve a Message Batch ### Path Parameters ### Header Parameters ### Returns ### Example #### Response
The first capture of this source. The page was already there, and this is what it said.
---
title: Retrieve a Message Batch
url: https://platform.claude.com/docs/en/api/beta/messages/batches/retrieve
---
## Retrieve a Message Batch
**get** `/v1/messages/batches/{message_batch_id}`
This endpoint is idempotent and can be used to poll for Message Batch completion. To access the results of a Message Batch, make a request to the `results_url` field in the response.
Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing)
### Path Parameters
- `message_batch_id: string`
ID of the Message Batch.
### Header Parameters
- `"anthropic-beta": optional array of AnthropicBeta`
Optional header to specify the beta version(s) you want to use.
- `string`
- `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 30 more`
- `"message-batches-2024-09-24"`
- `"prompt-caching-2024-07-31"`
- `"computer-use-2024-10-22"`
- `"computer-use-2025-01-24"`
- `"pdfs-2024-09-25"`
- `"token-counting-2024-11-01"`
- `"token-efficient-tools-2025-02-19"`
- `"output-128k-2025-02-19"`
- `"files-api-2025-04-14"`
- `"mcp-client-2025-04-04"`
- `"mcp-client-2025-11-20"`
- `"dev-full-thinking-2025-05-14"`
- `"interleaved-thinking-2025-05-14"`
- `"code-execution-2025-05-22"`
- `"extended-cache-ttl-2025-04-11"`
- `"context-1m-2025-08-07"`
- `"context-management-2025-06-27"`
- `"model-context-window-exceeded-2025-08-26"`
- `"skills-2025-10-02"`
- `"fast-mode-2026-02-01"`
- `"output-300k-2026-03-24"`
- `"user-profiles-2026-03-24"`
- `"advisor-tool-2026-03-01"`
- `"managed-agents-2026-04-01"`
- `"cache-diagnosis-2026-04-07"`
- `"dreaming-2026-04-21"`
- `"thinking-token-count-2026-05-13"`
- `"server-side-fallback-2026-06-01"`
- `"server-side-fallback-2026-07-01"`
- `"fallback-credit-2026-06-01"`
- `"fallback-credit-2026-07-01"`
- `"agent-memory-2026-07-22"`
- `"mid-conversation-tool-changes-2026-07-01"`
### Returns
- `BetaMessageBatch object { id, archived_at, cancel_initiated_at, 7 more }`
- `id: string`
Unique object identifier.
The format and length of IDs may change over time.
- `archived_at: string or null`
RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.
- `cancel_initiated_at: string or null`
RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.
- `created_at: string`
RFC 3339 datetime string representing the time at which the Message Batch was created.
- `ended_at: string or null`
RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.
- `expires_at: string`
RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.
- `processing_status: "in_progress" or "canceling" or "ended"`
Processing status of the Message Batch.
- `"in_progress"`
- `"canceling"`
- `"ended"`
- `request_counts: BetaMessageBatchRequestCounts`
Tallies requests within the Message Batch, categorized by their status.
Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.
- `canceled: number`
Number of requests in the Message Batch that have been canceled.
This is zero until processing of the entire Message Batch has ended.
- `errored: number`
Number of requests in the Message Batch that encountered an error.
This is zero until processing of the entire Message Batch has ended.
- `expired: number`
Number of requests in the Message Batch that have expired.
This is zero until processing of the entire Message Batch has ended.
- `processing: number`
Number of requests in the Message Batch that are processing.
- `succeeded: number`
Number of requests in the Message Batch that have completed successfully.
This is zero until processing of the entire Message Batch has ended.
- `results_url: string or null`
URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.
- `type: "message_batch"`
Object type.
For Message Batches, this is always `"message_batch"`.
- `"message_batch"`
### Example
```http
curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID \
-H 'anthropic-version: 2023-06-01' \
-H 'anthropic-beta: message-batches-2024-09-24' \
-H "X-Api-Key: $ANTHROPIC_API_KEY"
```
#### Response
```json
{
"id": "msgbatch_013Zva2CMHLNnXjNJJKqJ2EF",
"archived_at": "2024-08-20T18:37:24.100435Z",
"cancel_initiated_at": "2024-08-20T18:37:24.100435Z",
"created_at": "2024-08-20T18:37:24.100435Z",
"ended_at": "2024-08-20T18:37:24.100435Z",
"expires_at": "2024-08-20T18:37:24.100435Z",
"processing_status": "in_progress",
"request_counts": {
"canceled": 10,
"errored": 30,
"expired": 10,
"processing": 100,
"succeeded": 50
},
"results_url": "https://api.anthropic.com/v1/messages/batches/msgbatch_013Zva2CMHLNnXjNJJKqJ2EF/results",
"type": "message_batch"
}
```
api/beta/messages/count_tokens First recorded · 3074 lines, first recorded
## Count tokens in a Message ### Header Parameters ### Body Parameters ### Returns ### Example #### Response
The first capture of this source. The page was already there, and this is what it said.
---
title: Count tokens in a Message
url: https://platform.claude.com/docs/en/api/beta/messages/count_tokens
---
## Count tokens in a Message
**post** `/v1/messages/count_tokens`
Count the number of tokens in a Message.
The Token Count API can be used to count the number of tokens in a Message, including tools, images, and documents, without creating it.
Learn more about token counting in our [user guide](https://platform.claude.com/docs/en/build-with-claude/token-counting)
### Header Parameters
- `"anthropic-beta": optional array of AnthropicBeta`
Optional header to specify the beta version(s) you want to use.
- `string`
- `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 30 more`
- `"message-batches-2024-09-24"`
- `"prompt-caching-2024-07-31"`
- `"computer-use-2024-10-22"`
- `"computer-use-2025-01-24"`
- `"pdfs-2024-09-25"`
- `"token-counting-2024-11-01"`
- `"token-efficient-tools-2025-02-19"`
- `"output-128k-2025-02-19"`
- `"files-api-2025-04-14"`
- `"mcp-client-2025-04-04"`
- `"mcp-client-2025-11-20"`
- `"dev-full-thinking-2025-05-14"`
- `"interleaved-thinking-2025-05-14"`
- `"code-execution-2025-05-22"`
- `"extended-cache-ttl-2025-04-11"`
- `"context-1m-2025-08-07"`
- `"context-management-2025-06-27"`
- `"model-context-window-exceeded-2025-08-26"`
- `"skills-2025-10-02"`
- `"fast-mode-2026-02-01"`
- `"output-300k-2026-03-24"`
- `"user-profiles-2026-03-24"`
- `"advisor-tool-2026-03-01"`
- `"managed-agents-2026-04-01"`
- `"cache-diagnosis-2026-04-07"`
- `"dreaming-2026-04-21"`
- `"thinking-token-count-2026-05-13"`
- `"server-side-fallback-2026-06-01"`
- `"server-side-fallback-2026-07-01"`
- `"fallback-credit-2026-06-01"`
- `"fallback-credit-2026-07-01"`
- `"agent-memory-2026-07-22"`
- `"mid-conversation-tool-changes-2026-07-01"`
- `"anthropic-user-profile-id": optional string`
The user profile ID to attribute this request to. Use when acting on behalf of a party other than your organization. Requires the `user-profiles` beta header.
### Body Parameters
- `messages: array of BetaMessageParam`
Input messages.
Our models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn.
Each input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages.
If the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response.
Example with a single `user` message:
```json
[{"role": "user", "content": "Hello, Claude"}]
```
Example with multiple conversational turns:
```json
[
{"role": "user", "content": "Hello there."},
{"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},
{"role": "user", "content": "Can you explain LLMs in plain English?"},
]
```
Example with a partially-filled response from Claude:
```json
[
{"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
{"role": "assistant", "content": "The best answer is ("},
]
```
Each input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `"text"`. The following input messages are equivalent:
```json
{"role": "user", "content": "Hello, Claude"}
```
```json
{"role": "user", "content": [{"type": "text", "text": "Hello, Claude"}]}
```
See [input examples](https://platform.claude.com/docs/en/build-with-claude/working-with-messages).
Note that if you want to include a [system prompt](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices#give-claude-a-role), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API.
There is a limit of 100,000 messages in a single request.
- `content: string or array of BetaContentBlockParam`
- `string`
- `array of BetaContentBlockParam`
- `BetaTextBlockParam object { text, type, cache_control, citations }`
- `text: string`
- `type: "text"`
- `"text"`
- `cache_control: optional BetaCacheControlEphemeral or null`
Create a cache control breakpoint at this content block.
- `type: "ephemeral"`
- `"ephemeral"`
- `ttl: optional "5m" or "1h"`
The time-to-live for the cache control breakpoint.
This may be one the following values:
- `5m`: 5 minutes
- `1h`: 1 hour
Defaults to `5m`. See [prompt caching pricing](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) for details.
- `"5m"`
- `"1h"`
- `citations: optional array of BetaTextCitationParam or null`
- `BetaCitationCharLocationParam object { cited_text, document_index, document_title, 3 more }`
- `cited_text: string`
- `document_index: number`
- `document_title: string or null`
- `end_char_index: number`
- `start_char_index: number`
- `type: "char_location"`
- `"char_location"`
- `BetaCitationPageLocationParam object { cited_text, document_index, document_title, 3 more }`
- `cited_text: string`
- `document_index: number`
- `document_title: string or null`
- `end_page_number: number`
- `start_page_number: number`
- `type: "page_location"`
- `"page_location"`
- `BetaCitationContentBlockLocationParam object { cited_text, document_index, document_title, 3 more }`
- `cited_text: string`
The full text of the cited block range, concatenated.
Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
- `document_index: number`
- `document_title: string or null`
- `end_block_index: number`
Exclusive 0-based end index of the cited block range in the source's `content` array.
Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
- `start_block_index: number`
0-based index of the first cited block in the source's `content` array.
- `type: "content_block_location"`
- `"content_block_location"`
- `BetaCitationWebSearchResultLocationParam object { cited_text, encrypted_index, title, 2 more }`
- `cited_text: string`
- `encrypted_index: string`
- `title: string or null`
- `type: "web_search_result_location"`
- `"web_search_result_location"`
- `url: string`
- `BetaCitationSearchResultLocationParam object { cited_text, end_block_index, search_result_index, 4 more }`
- `cited_text: string`
The full text of the cited block range, concatenated.
Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
- `end_block_index: number`
Exclusive 0-based end index of the cited block range in the source's `content` array.
Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
- `search_result_index: number`
0-based index of the cited search result among all `search_result` content blocks in the request, in the order they appear across messages and tool results.
Counted separately from `document_index`; server-side web search results are not included in this count.
- `source: string`
- `start_block_index: number`
0-based index of the first cited block in the source's `content` array.
- `title: string or null`
- `type: "search_result_location"`
- `"search_result_location"`
- `BetaImageBlockParam object { source, type, cache_control }`
- `source: BetaBase64ImageSource or BetaURLImageSource or BetaFileImageSource`
- `BetaBase64ImageSource object { data, media_type, type }`
- `data: string`
- `media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"`
Cut at 300 lines. The page has the rest.
api/beta/messages/create First recorded · 4896 lines, first recorded
## Create a Message ### Header Parameters ### Body Parameters ### Returns ### Example #### Response
The first capture of this source. The page was already there, and this is what it said.
---
title: Create a Message
url: https://platform.claude.com/docs/en/api/beta/messages/create
---
## Create a Message
**post** `/v1/messages`
Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.
The Messages API can be used for either single queries or stateless multi-turn conversations.
Learn more about the Messages API in our [user guide](https://platform.claude.com/docs/en/get-started)
### Header Parameters
- `"anthropic-beta": optional array of AnthropicBeta`
Optional header to specify the beta version(s) you want to use.
- `string`
- `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 30 more`
- `"message-batches-2024-09-24"`
- `"prompt-caching-2024-07-31"`
- `"computer-use-2024-10-22"`
- `"computer-use-2025-01-24"`
- `"pdfs-2024-09-25"`
- `"token-counting-2024-11-01"`
- `"token-efficient-tools-2025-02-19"`
- `"output-128k-2025-02-19"`
- `"files-api-2025-04-14"`
- `"mcp-client-2025-04-04"`
- `"mcp-client-2025-11-20"`
- `"dev-full-thinking-2025-05-14"`
- `"interleaved-thinking-2025-05-14"`
- `"code-execution-2025-05-22"`
- `"extended-cache-ttl-2025-04-11"`
- `"context-1m-2025-08-07"`
- `"context-management-2025-06-27"`
- `"model-context-window-exceeded-2025-08-26"`
- `"skills-2025-10-02"`
- `"fast-mode-2026-02-01"`
- `"output-300k-2026-03-24"`
- `"user-profiles-2026-03-24"`
- `"advisor-tool-2026-03-01"`
- `"managed-agents-2026-04-01"`
- `"cache-diagnosis-2026-04-07"`
- `"dreaming-2026-04-21"`
- `"thinking-token-count-2026-05-13"`
- `"server-side-fallback-2026-06-01"`
- `"server-side-fallback-2026-07-01"`
- `"fallback-credit-2026-06-01"`
- `"fallback-credit-2026-07-01"`
- `"agent-memory-2026-07-22"`
- `"mid-conversation-tool-changes-2026-07-01"`
- `"anthropic-user-profile-id": optional string`
The user profile ID to attribute this request to. Use when acting on behalf of a party other than your organization. Requires the `user-profiles` beta header.
### Body Parameters
- `max_tokens: number`
The maximum number of tokens to generate before stopping.
Note that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.
Set to `0` to populate the [prompt cache](https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pre-warming-the-cache) without generating a response.
Different models have different maximum values for this parameter. See [models](https://platform.claude.com/docs/en/about-claude/models/overview) for details.
- `messages: array of BetaMessageParam`
Input messages.
Our models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn.
Each input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages.
If the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response.
Example with a single `user` message:
```json
[{"role": "user", "content": "Hello, Claude"}]
```
Example with multiple conversational turns:
```json
[
{"role": "user", "content": "Hello there."},
{"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},
{"role": "user", "content": "Can you explain LLMs in plain English?"},
]
```
Example with a partially-filled response from Claude:
```json
[
{"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
{"role": "assistant", "content": "The best answer is ("},
]
```
Each input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `"text"`. The following input messages are equivalent:
```json
{"role": "user", "content": "Hello, Claude"}
```
```json
{"role": "user", "content": [{"type": "text", "text": "Hello, Claude"}]}
```
See [input examples](https://platform.claude.com/docs/en/build-with-claude/working-with-messages).
Note that if you want to include a [system prompt](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices#give-claude-a-role), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API.
There is a limit of 100,000 messages in a single request.
- `content: string or array of BetaContentBlockParam`
- `string`
- `array of BetaContentBlockParam`
- `BetaTextBlockParam object { text, type, cache_control, citations }`
- `text: string`
- `type: "text"`
- `"text"`
- `cache_control: optional BetaCacheControlEphemeral or null`
Create a cache control breakpoint at this content block.
- `type: "ephemeral"`
- `"ephemeral"`
- `ttl: optional "5m" or "1h"`
The time-to-live for the cache control breakpoint.
This may be one the following values:
- `5m`: 5 minutes
- `1h`: 1 hour
Defaults to `5m`. See [prompt caching pricing](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) for details.
- `"5m"`
- `"1h"`
- `citations: optional array of BetaTextCitationParam or null`
- `BetaCitationCharLocationParam object { cited_text, document_index, document_title, 3 more }`
- `cited_text: string`
- `document_index: number`
- `document_title: string or null`
- `end_char_index: number`
- `start_char_index: number`
- `type: "char_location"`
- `"char_location"`
- `BetaCitationPageLocationParam object { cited_text, document_index, document_title, 3 more }`
- `cited_text: string`
- `document_index: number`
- `document_title: string or null`
- `end_page_number: number`
- `start_page_number: number`
- `type: "page_location"`
- `"page_location"`
- `BetaCitationContentBlockLocationParam object { cited_text, document_index, document_title, 3 more }`
- `cited_text: string`
The full text of the cited block range, concatenated.
Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
- `document_index: number`
- `document_title: string or null`
- `end_block_index: number`
Exclusive 0-based end index of the cited block range in the source's `content` array.
Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
- `start_block_index: number`
0-based index of the first cited block in the source's `content` array.
- `type: "content_block_location"`
- `"content_block_location"`
- `BetaCitationWebSearchResultLocationParam object { cited_text, encrypted_index, title, 2 more }`
- `cited_text: string`
- `encrypted_index: string`
- `title: string or null`
- `type: "web_search_result_location"`
- `"web_search_result_location"`
- `url: string`
- `BetaCitationSearchResultLocationParam object { cited_text, end_block_index, search_result_index, 4 more }`
- `cited_text: string`
The full text of the cited block range, concatenated.
Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
- `end_block_index: number`
Exclusive 0-based end index of the cited block range in the source's `content` array.
Always greater than `start_block_index`; a single-block citation has `end_block_index = start_block_index + 1`.
- `search_result_index: number`
0-based index of the cited search result among all `search_result` content blocks in the request, in the order they appear across messages and tool results.
Counted separately from `document_index`; server-side web search results are not included in this count.
- `source: string`
- `start_block_index: number`
0-based index of the first cited block in the source's `content` array.
- `title: string or null`
- `type: "search_result_location"`
- `"search_result_location"`
Cut at 300 lines. The page has the rest.
api/beta/models First recorded · 1011 lines, first recorded
# Models ## List Models ### Query Parameters ### Header Parameters ### Returns ### Example #### Response ## Get a Model ### Path Parameters ### Header Parameters ### Returns ### Example #### Response ## Domain Types ### Beta Capability Support ### Beta Context Management Capability ### Beta Effort Capability ### Beta Model Capabilities ### Beta Model Info ### Beta Thinking Capability ### Beta Thinking Types
The first capture of this source. The page was already there, and this is what it said.
---
title: Models
url: https://platform.claude.com/docs/en/api/beta/models
---
# Models
## List Models
**get** `/v1/models`
List available models.
The Models API response can be used to determine which models are available for use in the API. More recently released models are listed first.
### Query Parameters
- `after_id: optional string`
ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.
- `before_id: optional string`
ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.
- `limit: optional number`
Number of items to return per page.
Defaults to `20`. Ranges from `1` to `1000`.
### Header Parameters
- `"anthropic-beta": optional array of AnthropicBeta`
Optional header to specify the beta version(s) you want to use.
- `string`
- `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 30 more`
- `"message-batches-2024-09-24"`
- `"prompt-caching-2024-07-31"`
- `"computer-use-2024-10-22"`
- `"computer-use-2025-01-24"`
- `"pdfs-2024-09-25"`
- `"token-counting-2024-11-01"`
- `"token-efficient-tools-2025-02-19"`
- `"output-128k-2025-02-19"`
- `"files-api-2025-04-14"`
- `"mcp-client-2025-04-04"`
- `"mcp-client-2025-11-20"`
- `"dev-full-thinking-2025-05-14"`
- `"interleaved-thinking-2025-05-14"`
- `"code-execution-2025-05-22"`
- `"extended-cache-ttl-2025-04-11"`
- `"context-1m-2025-08-07"`
- `"context-management-2025-06-27"`
- `"model-context-window-exceeded-2025-08-26"`
- `"skills-2025-10-02"`
- `"fast-mode-2026-02-01"`
- `"output-300k-2026-03-24"`
- `"user-profiles-2026-03-24"`
- `"advisor-tool-2026-03-01"`
- `"managed-agents-2026-04-01"`
- `"cache-diagnosis-2026-04-07"`
- `"dreaming-2026-04-21"`
- `"thinking-token-count-2026-05-13"`
- `"server-side-fallback-2026-06-01"`
- `"server-side-fallback-2026-07-01"`
- `"fallback-credit-2026-06-01"`
- `"fallback-credit-2026-07-01"`
- `"agent-memory-2026-07-22"`
- `"mid-conversation-tool-changes-2026-07-01"`
### Returns
- `data: array of BetaModelInfo`
- `id: string`
Unique model identifier.
- `allowed_fallback_models: array of string or null`
Model IDs this model accepts as `fallbacks[i].model` on the Messages API. An empty list means the `fallbacks` parameter is not supported for this model as primary.
- `capabilities: BetaModelCapabilities or null`
Model capability information.
- `batch: BetaCapabilitySupport`
Whether the model supports the Batch API.
- `supported: boolean`
Whether this capability is supported by the model.
- `citations: BetaCapabilitySupport`
Whether the model supports citation generation.
- `code_execution: BetaCapabilitySupport`
Whether the model supports code execution tools.
- `context_management: BetaContextManagementCapability`
Context management support and available strategies.
- `clear_thinking_20251015: BetaCapabilitySupport or null`
Indicates whether a capability is supported.
- `clear_tool_uses_20250919: BetaCapabilitySupport or null`
Indicates whether a capability is supported.
- `compact_20260112: BetaCapabilitySupport or null`
Indicates whether a capability is supported.
- `supported: boolean`
Whether this capability is supported by the model.
- `effort: BetaEffortCapability`
Effort (reasoning_effort) support and available levels.
- `high: BetaCapabilitySupport`
Whether the model supports high effort level.
- `low: BetaCapabilitySupport`
Whether the model supports low effort level.
- `max: BetaCapabilitySupport`
Whether the model supports max effort level.
- `medium: BetaCapabilitySupport`
Whether the model supports medium effort level.
- `supported: boolean`
Whether this capability is supported by the model.
- `xhigh: BetaCapabilitySupport or null`
Indicates whether a capability is supported.
- `image_input: BetaCapabilitySupport`
Whether the model accepts image content blocks.
- `pdf_input: BetaCapabilitySupport`
Whether the model accepts PDF content blocks.
- `structured_outputs: BetaCapabilitySupport`
Whether the model supports structured output / JSON mode / strict tool schemas.
- `thinking: BetaThinkingCapability`
Thinking capability and supported type configurations.
- `supported: boolean`
Whether this capability is supported by the model.
- `types: BetaThinkingTypes`
Supported thinking type configurations.
- `adaptive: BetaCapabilitySupport`
Whether the model supports thinking with type 'adaptive' (auto).
- `enabled: BetaCapabilitySupport`
Whether the model supports thinking with type 'enabled'.
- `created_at: string`
RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown.
- `display_name: string`
A human-readable name for the model.
- `max_input_tokens: number or null`
Maximum input context window size in tokens for this model.
- `max_tokens: number or null`
Maximum value for the `max_tokens` parameter when using this model.
- `type: "model"`
Object type.
For Models, this is always `"model"`.
- `"model"`
- `first_id: string or null`
First ID in the `data` list. Can be used as the `before_id` for the previous page.
- `has_more: boolean`
Indicates if there are more results in the requested page direction.
- `last_id: string or null`
Last ID in the `data` list. Can be used as the `after_id` for the next page.
### Example
```http
curl https://api.anthropic.com/v1/models \
-H 'anthropic-version: 2023-06-01' \
-H "X-Api-Key: $ANTHROPIC_API_KEY"
```
#### Response
```json
{
"data": [
{
"id": "claude-opus-4-6",
"allowed_fallback_models": [
"string"
],
"capabilities": {
"batch": {
"supported": true
},
"citations": {
"supported": true
},
"code_execution": {
"supported": true
},
"context_management": {
"clear_thinking_20251015": {
"supported": true
},
"clear_tool_uses_20250919": {
"supported": true
},
"compact_20260112": {
"supported": true
},
"supported": true
},
"effort": {
"high": {
"supported": true
},
"low": {
Cut at 300 lines. The page has the rest.
api/beta/models/list First recorded · 344 lines, first recorded
## List Models ### Query Parameters ### Header Parameters ### Returns ### Example #### Response
The first capture of this source. The page was already there, and this is what it said.
---
title: List Models
url: https://platform.claude.com/docs/en/api/beta/models/list
---
## List Models
**get** `/v1/models`
List available models.
The Models API response can be used to determine which models are available for use in the API. More recently released models are listed first.
### Query Parameters
- `after_id: optional string`
ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.
- `before_id: optional string`
ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.
- `limit: optional number`
Number of items to return per page.
Defaults to `20`. Ranges from `1` to `1000`.
### Header Parameters
- `"anthropic-beta": optional array of AnthropicBeta`
Optional header to specify the beta version(s) you want to use.
- `string`
- `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 30 more`
- `"message-batches-2024-09-24"`
- `"prompt-caching-2024-07-31"`
- `"computer-use-2024-10-22"`
- `"computer-use-2025-01-24"`
- `"pdfs-2024-09-25"`
- `"token-counting-2024-11-01"`
- `"token-efficient-tools-2025-02-19"`
- `"output-128k-2025-02-19"`
- `"files-api-2025-04-14"`
- `"mcp-client-2025-04-04"`
- `"mcp-client-2025-11-20"`
- `"dev-full-thinking-2025-05-14"`
- `"interleaved-thinking-2025-05-14"`
- `"code-execution-2025-05-22"`
- `"extended-cache-ttl-2025-04-11"`
- `"context-1m-2025-08-07"`
- `"context-management-2025-06-27"`
- `"model-context-window-exceeded-2025-08-26"`
- `"skills-2025-10-02"`
- `"fast-mode-2026-02-01"`
- `"output-300k-2026-03-24"`
- `"user-profiles-2026-03-24"`
- `"advisor-tool-2026-03-01"`
- `"managed-agents-2026-04-01"`
- `"cache-diagnosis-2026-04-07"`
- `"dreaming-2026-04-21"`
- `"thinking-token-count-2026-05-13"`
- `"server-side-fallback-2026-06-01"`
- `"server-side-fallback-2026-07-01"`
- `"fallback-credit-2026-06-01"`
- `"fallback-credit-2026-07-01"`
- `"agent-memory-2026-07-22"`
- `"mid-conversation-tool-changes-2026-07-01"`
### Returns
- `data: array of BetaModelInfo`
- `id: string`
Unique model identifier.
- `allowed_fallback_models: array of string or null`
Model IDs this model accepts as `fallbacks[i].model` on the Messages API. An empty list means the `fallbacks` parameter is not supported for this model as primary.
- `capabilities: BetaModelCapabilities or null`
Model capability information.
- `batch: BetaCapabilitySupport`
Whether the model supports the Batch API.
- `supported: boolean`
Whether this capability is supported by the model.
- `citations: BetaCapabilitySupport`
Whether the model supports citation generation.
- `code_execution: BetaCapabilitySupport`
Whether the model supports code execution tools.
- `context_management: BetaContextManagementCapability`
Context management support and available strategies.
- `clear_thinking_20251015: BetaCapabilitySupport or null`
Indicates whether a capability is supported.
- `clear_tool_uses_20250919: BetaCapabilitySupport or null`
Indicates whether a capability is supported.
- `compact_20260112: BetaCapabilitySupport or null`
Indicates whether a capability is supported.
- `supported: boolean`
Whether this capability is supported by the model.
- `effort: BetaEffortCapability`
Effort (reasoning_effort) support and available levels.
- `high: BetaCapabilitySupport`
Whether the model supports high effort level.
- `low: BetaCapabilitySupport`
Whether the model supports low effort level.
- `max: BetaCapabilitySupport`
Whether the model supports max effort level.
- `medium: BetaCapabilitySupport`
Whether the model supports medium effort level.
- `supported: boolean`
Whether this capability is supported by the model.
- `xhigh: BetaCapabilitySupport or null`
Indicates whether a capability is supported.
- `image_input: BetaCapabilitySupport`
Whether the model accepts image content blocks.
- `pdf_input: BetaCapabilitySupport`
Whether the model accepts PDF content blocks.
- `structured_outputs: BetaCapabilitySupport`
Whether the model supports structured output / JSON mode / strict tool schemas.
- `thinking: BetaThinkingCapability`
Thinking capability and supported type configurations.
- `supported: boolean`
Whether this capability is supported by the model.
- `types: BetaThinkingTypes`
Supported thinking type configurations.
- `adaptive: BetaCapabilitySupport`
Whether the model supports thinking with type 'adaptive' (auto).
- `enabled: BetaCapabilitySupport`
Whether the model supports thinking with type 'enabled'.
- `created_at: string`
RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown.
- `display_name: string`
A human-readable name for the model.
- `max_input_tokens: number or null`
Maximum input context window size in tokens for this model.
- `max_tokens: number or null`
Maximum value for the `max_tokens` parameter when using this model.
- `type: "model"`
Object type.
For Models, this is always `"model"`.
- `"model"`
- `first_id: string or null`
First ID in the `data` list. Can be used as the `before_id` for the previous page.
- `has_more: boolean`
Indicates if there are more results in the requested page direction.
- `last_id: string or null`
Last ID in the `data` list. Can be used as the `after_id` for the next page.
### Example
```http
curl https://api.anthropic.com/v1/models \
-H 'anthropic-version: 2023-06-01' \
-H "X-Api-Key: $ANTHROPIC_API_KEY"
```
#### Response
```json
{
"data": [
{
"id": "claude-opus-4-6",
"allowed_fallback_models": [
"string"
],
"capabilities": {
"batch": {
"supported": true
},
"citations": {
"supported": true
},
"code_execution": {
"supported": true
},
"context_management": {
"clear_thinking_20251015": {
"supported": true
},
"clear_tool_uses_20250919": {
"supported": true
},
"compact_20260112": {
"supported": true
},
"supported": true
},
"effort": {
"high": {
"supported": true
},
"low": {
"supported": true
},
Cut at 300 lines. The page has the rest.
api/beta/models/retrieve First recorded · 315 lines, first recorded
## Get a Model ### Path Parameters ### Header Parameters ### Returns ### Example #### Response
The first capture of this source. The page was already there, and this is what it said.
---
title: Get a Model
url: https://platform.claude.com/docs/en/api/beta/models/retrieve
---
## Get a Model
**get** `/v1/models/{model_id}`
Get a specific model.
The Models API response can be used to determine information about a specific model or resolve a model alias to a model ID.
### Path Parameters
- `model_id: string`
Model identifier or alias.
### Header Parameters
- `"anthropic-beta": optional array of AnthropicBeta`
Optional header to specify the beta version(s) you want to use.
- `string`
- `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 30 more`
- `"message-batches-2024-09-24"`
- `"prompt-caching-2024-07-31"`
- `"computer-use-2024-10-22"`
- `"computer-use-2025-01-24"`
- `"pdfs-2024-09-25"`
- `"token-counting-2024-11-01"`
- `"token-efficient-tools-2025-02-19"`
- `"output-128k-2025-02-19"`
- `"files-api-2025-04-14"`
- `"mcp-client-2025-04-04"`
- `"mcp-client-2025-11-20"`
- `"dev-full-thinking-2025-05-14"`
- `"interleaved-thinking-2025-05-14"`
- `"code-execution-2025-05-22"`
- `"extended-cache-ttl-2025-04-11"`
- `"context-1m-2025-08-07"`
- `"context-management-2025-06-27"`
- `"model-context-window-exceeded-2025-08-26"`
- `"skills-2025-10-02"`
- `"fast-mode-2026-02-01"`
- `"output-300k-2026-03-24"`
- `"user-profiles-2026-03-24"`
- `"advisor-tool-2026-03-01"`
- `"managed-agents-2026-04-01"`
- `"cache-diagnosis-2026-04-07"`
- `"dreaming-2026-04-21"`
- `"thinking-token-count-2026-05-13"`
- `"server-side-fallback-2026-06-01"`
- `"server-side-fallback-2026-07-01"`
- `"fallback-credit-2026-06-01"`
- `"fallback-credit-2026-07-01"`
- `"agent-memory-2026-07-22"`
- `"mid-conversation-tool-changes-2026-07-01"`
### Returns
- `BetaModelInfo object { id, allowed_fallback_models, capabilities, 5 more }`
- `id: string`
Unique model identifier.
- `allowed_fallback_models: array of string or null`
Model IDs this model accepts as `fallbacks[i].model` on the Messages API. An empty list means the `fallbacks` parameter is not supported for this model as primary.
- `capabilities: BetaModelCapabilities or null`
Model capability information.
- `batch: BetaCapabilitySupport`
Whether the model supports the Batch API.
- `supported: boolean`
Whether this capability is supported by the model.
- `citations: BetaCapabilitySupport`
Whether the model supports citation generation.
- `code_execution: BetaCapabilitySupport`
Whether the model supports code execution tools.
- `context_management: BetaContextManagementCapability`
Context management support and available strategies.
- `clear_thinking_20251015: BetaCapabilitySupport or null`
Indicates whether a capability is supported.
- `clear_tool_uses_20250919: BetaCapabilitySupport or null`
Indicates whether a capability is supported.
- `compact_20260112: BetaCapabilitySupport or null`
Indicates whether a capability is supported.
- `supported: boolean`
Whether this capability is supported by the model.
- `effort: BetaEffortCapability`
Effort (reasoning_effort) support and available levels.
- `high: BetaCapabilitySupport`
Whether the model supports high effort level.
- `low: BetaCapabilitySupport`
Whether the model supports low effort level.
- `max: BetaCapabilitySupport`
Whether the model supports max effort level.
- `medium: BetaCapabilitySupport`
Whether the model supports medium effort level.
- `supported: boolean`
Whether this capability is supported by the model.
- `xhigh: BetaCapabilitySupport or null`
Indicates whether a capability is supported.
- `image_input: BetaCapabilitySupport`
Whether the model accepts image content blocks.
- `pdf_input: BetaCapabilitySupport`
Whether the model accepts PDF content blocks.
- `structured_outputs: BetaCapabilitySupport`
Whether the model supports structured output / JSON mode / strict tool schemas.
- `thinking: BetaThinkingCapability`
Thinking capability and supported type configurations.
- `supported: boolean`
Whether this capability is supported by the model.
- `types: BetaThinkingTypes`
Supported thinking type configurations.
- `adaptive: BetaCapabilitySupport`
Whether the model supports thinking with type 'adaptive' (auto).
- `enabled: BetaCapabilitySupport`
Whether the model supports thinking with type 'enabled'.
- `created_at: string`
RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown.
- `display_name: string`
A human-readable name for the model.
- `max_input_tokens: number or null`
Maximum input context window size in tokens for this model.
- `max_tokens: number or null`
Maximum value for the `max_tokens` parameter when using this model.
- `type: "model"`
Object type.
For Models, this is always `"model"`.
- `"model"`
### Example
```http
curl https://api.anthropic.com/v1/models/$MODEL_ID \
-H 'anthropic-version: 2023-06-01' \
-H "X-Api-Key: $ANTHROPIC_API_KEY"
```
#### Response
```json
{
"id": "claude-opus-4-6",
"allowed_fallback_models": [
"string"
],
"capabilities": {
"batch": {
"supported": true
},
"citations": {
"supported": true
},
"code_execution": {
"supported": true
},
"context_management": {
"clear_thinking_20251015": {
"supported": true
},
"clear_tool_uses_20250919": {
"supported": true
},
"compact_20260112": {
"supported": true
},
"supported": true
},
"effort": {
"high": {
"supported": true
},
"low": {
"supported": true
},
"max": {
"supported": true
},
"medium": {
"supported": true
},
"supported": true,
"xhigh": {
"supported": true
}
},
"image_input": {
"supported": true
},
"pdf_input": {
"supported": true
},
"structured_outputs": {
"supported": true
},
"thinking": {
"supported": true,
"types": {
"adaptive": {
Cut at 300 lines. The page has the rest.
api/beta/sessions First recorded · 33358 lines, first recorded
# Sessions ## Create Session ### Header Parameters ### Body Parameters ### Returns ### Example #### Response ## List Sessions ### Query Parameters ### Header Parameters ### Returns ### Example #### Response ## Get Session ### Path Parameters ### Header Parameters ### Returns ### Example #### Response ## Update Session ### Path Parameters ### Header Parameters ### Body Parameters ### Returns ### Example #### Response ## Delete Session ### Path Parameters ### Header Parameters ### Returns ### Example #### Response ## Archive Session ### Path Parameters ### Header Parameters ### Returns ### Example #### Response ## Domain Types ### Beta Managed Agents Advisor Params ### Beta Managed Agents Agent Message Preview ### Beta Managed Agents Agent Params ### Beta Managed Agents Agent Thinking Preview ### Beta Managed Agents Agent With Overrides Params ### Beta Managed Agents Branch Checkout ### Beta Managed Agents Budget Limit ### Beta Managed Agents Cache Creation Usage ### Beta Managed Agents Commit Checkout ### Beta Managed Agents Deleted Session ### Beta Managed Agents Delta Content ### Beta Managed Agents Delta Event ### Beta Managed Agents Delta Type ### Beta Managed Agents File Resource Params ### Beta Managed Agents GitHub Repository Resource Params ### Beta Managed Agents Memory Store Resource Param ### Beta Managed Agents Multiagent ### Beta Managed Agents Multiagent Params ### Beta Managed Agents Multiagent Roster Entry Params ### Beta Managed Agents Outcome Evaluation Resource ### Beta Managed Agents Server Tool Usage ### Beta Managed Agents Session ### Beta Managed Agents Session Agent ### Beta Managed Agents Session Agent Update ### Beta Managed Agents Session Multiagent Coordinator ### Beta Managed Agents Session Stats ### Beta Managed Agents Session Updated Event ### Beta Managed Agents Session Usage ### Beta Managed Agents Session Usage Event ### Beta Managed Agents Start Event ### Beta Managed Agents Start Event Preview ### Beta Managed Agents System Content Block ### Beta Managed Agents System Message Event ### Beta Managed Agents User Tool Result Event # Events ## List Events ### Path Parameters ### Query Parameters ### Header Parameters ### Returns ### Example #### Response ## Send Events ### Path Parameters ### Header Parameters ### Body Parameters ### Returns ### Example #### Response ## Stream Events ### Path Parameters ### Query Parameters ### Header Parameters ### Returns ### Example #### Response ## Domain Types ### Beta Managed Agents Agent Custom Tool Use Event ### Beta Managed Agents Agent MCP Tool Result Event ### Beta Managed Agents Agent MCP Tool Use Event ### Beta Managed Agents Agent Message Event ### Beta Managed Agents Agent Thinking Event ### Beta Managed Agents Agent Thread Context Compacted Event ### Beta Managed Agents Agent Thread Message Received Event ### Beta Managed Agents Agent Thread Message Sent Event ### Beta Managed Agents Agent Tool Result Event ### Beta Managed Agents Agent Tool Use Event ### Beta Managed Agents Base64 Document Source ### Beta Managed Agents Base64 Image Source ### Beta Managed Agents Billing Error ### Beta Managed Agents Credential Host Unreachable Error ### Beta Managed Agents Document Block ### Beta Managed Agents Event Params ### Beta Managed Agents File Document Source ### Beta Managed Agents File Image Source ### Beta Managed Agents File Rubric ### Beta Managed Agents File Rubric Params ### Beta Managed Agents Image Block ### Beta Managed Agents MCP Authentication Failed Error ### Beta Managed Agents MCP Connection Failed Error ### Beta Managed Agents Model Overloaded Error ### Beta Managed Agents Model Rate Limited Error ### Beta Managed Agents Model Request Failed Error ### Beta Managed Agents Plain Text Document Source ### Beta Managed Agents Redacted Block ### Beta Managed Agents Retry Status Exhausted ### Beta Managed Agents Retry Status Retrying ### Beta Managed Agents Retry Status Terminal ### Beta Managed Agents Search Result Block ### Beta Managed Agents Search Result Citations ### Beta Managed Agents Search Result Content ### Beta Managed Agents Send Session Events ### Beta Managed Agents Session Budget Reached ### Beta Managed Agents Session Deleted Event ### Beta Managed Agents Session End Turn ### Beta Managed Agents Session Error Event ### Beta Managed Agents Session Event ### Beta Managed Agents Session Requires Action ### Beta Managed Agents Session Retries Exhausted ### Beta Managed Agents Session Status Idle Event ### Beta Managed Agents Session Status Rescheduled Event ### Beta Managed Agents Session Status Running Event ### Beta Managed Agents Session Status Terminated Event ### Beta Managed Agents Session Thread Created Event ### Beta Managed Agents Session Thread Status Idle Event ### Beta Managed Agents Session Thread Status Rescheduled Event ### Beta Managed Agents Session Thread Status Running Event ### Beta Managed Agents Session Thread Status Terminated Event ### Beta Managed Agents Session Usage Snapshot ### Beta Managed Agents Span Model Request End Event ### Beta Managed Agents Span Model Request Start Event ### Beta Managed Agents Span Model Usage ### Beta Managed Agents Span Outcome Evaluation End Event ### Beta Managed Agents Span Outcome Evaluation Ongoing Event ### Beta Managed Agents Span Outcome Evaluation Start Event ### Beta Managed Agents Stream Session Events ### Beta Managed Agents System Message Event Params ### Beta Managed Agents Text Block ### Beta Managed Agents Text Rubric ### Beta Managed Agents Text Rubric Params ### Beta Managed Agents Unknown Error ### Beta Managed Agents URL Document Source ### Beta Managed Agents URL Image Source ### Beta Managed Agents User Custom Tool Result Event ### Beta Managed Agents User Custom Tool Result Event Params ### Beta Managed Agents User Define Outcome Event ### Beta Managed Agents User Define Outcome Event Params ### Beta Managed Agents User Interrupt Event ### Beta Managed Agents User Interrupt Event Params ### Beta Managed Agents User Message Event ### Beta Managed Agents User Message Event Params ### Beta Managed Agents User Tool Confirmation Event ### Beta Managed Agents User Tool Confirmation Event Params ### Beta Managed Agents User Tool Result Event Params # Resources ## Add Session Resource ### Path Parameters ### Header Parameters ### Body Parameters ### Returns ### Example #### Response ## List Session Resources ### Path Parameters ### Query Parameters ### Header Parameters ### Returns ### Example #### Response ## Get Session Resource ### Path Parameters ### Header Parameters ### Returns ### Example #### Response ## Update Session Resource ### Path Parameters ### Header Parameters ### Body Parameters ### Returns ### Example #### Response ## Delete Session Resource ### Path Parameters ### Header Parameters ### Returns ### Example #### Response ## Domain Types ### Beta Managed Agents Delete Session Resource ### Beta Managed Agents File Resource ### Beta Managed Agents GitHub Repository Resource ### Beta Managed Agents Memory Store Resource ### Beta Managed Agents Session Resource ### Resource Retrieve Response ### Resource Update Response # Threads ## List Session Threads ### Path Parameters ### Query Parameters ### Header Parameters ### Returns ### Example #### Response ## Get Session Thread ### Path Parameters ### Header Parameters ### Returns ### Example #### Response ## Archive Session Thread ### Path Parameters ### Header Parameters ### Returns ### Example #### Response ## Domain Types ### Beta Managed Agents Session Thread ### Beta Managed Agents Session Thread Stats ### Beta Managed Agents Session Thread Status ### Beta Managed Agents Session Thread Usage ### Beta Managed Agents Stream Session Thread Events # Events ## List Session Thread Events ### Path Parameters ### Query Parameters ### Header Parameters ### Returns ### Example #### Response ## Stream Session Thread Events ### Path Parameters ### Query Parameters ### Header Parameters ### Returns ### Example #### Response
This page is larger than the 256 KiB this site keeps, so one side of the diff below stops where the stored text does.
The first capture of this source. The page was already there, and this is what it said.
---
title: Sessions
url: https://platform.claude.com/docs/en/api/beta/sessions
---
# Sessions
## Create Session
**post** `/v1/sessions`
Create Session
### Header Parameters
- `"anthropic-beta": optional array of AnthropicBeta`
Optional header to specify the beta version(s) you want to use.
- `string`
- `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 30 more`
- `"message-batches-2024-09-24"`
- `"prompt-caching-2024-07-31"`
- `"computer-use-2024-10-22"`
- `"computer-use-2025-01-24"`
- `"pdfs-2024-09-25"`
- `"token-counting-2024-11-01"`
- `"token-efficient-tools-2025-02-19"`
- `"output-128k-2025-02-19"`
- `"files-api-2025-04-14"`
- `"mcp-client-2025-04-04"`
- `"mcp-client-2025-11-20"`
- `"dev-full-thinking-2025-05-14"`
- `"interleaved-thinking-2025-05-14"`
- `"code-execution-2025-05-22"`
- `"extended-cache-ttl-2025-04-11"`
- `"context-1m-2025-08-07"`
- `"context-management-2025-06-27"`
- `"model-context-window-exceeded-2025-08-26"`
- `"skills-2025-10-02"`
- `"fast-mode-2026-02-01"`
- `"output-300k-2026-03-24"`
- `"user-profiles-2026-03-24"`
- `"advisor-tool-2026-03-01"`
- `"managed-agents-2026-04-01"`
- `"cache-diagnosis-2026-04-07"`
- `"dreaming-2026-04-21"`
- `"thinking-token-count-2026-05-13"`
- `"server-side-fallback-2026-06-01"`
- `"server-side-fallback-2026-07-01"`
- `"fallback-credit-2026-06-01"`
- `"fallback-credit-2026-07-01"`
- `"agent-memory-2026-07-22"`
- `"mid-conversation-tool-changes-2026-07-01"`
### Body Parameters
- `agent: string or BetaManagedAgentsAgentParams or BetaManagedAgentsAgentWithOverridesParams`
Agent identifier. Accepts the `agent` ID string, which pins the latest version for the session, or an `agent` object with both id and version specified.
- `string`
- `BetaManagedAgentsAgentParams object { id, type, version }`
Specification for an Agent. Provide a specific `version` or use the short-form `agent="agent_id"` for the most recent version
- `id: string`
The `agent` ID.
- `type: "agent"`
- `"agent"`
- `version: optional number`
The specific `agent` version to use. Omit to use the latest version. Must be at least 1 if specified.
- `BetaManagedAgentsAgentWithOverridesParams object { id, type, mcp_servers, 5 more }`
Reference to an `agent` plus optional configuration overrides. Each provided field replaces the agent's value for the caller's use; the agent resource is unchanged.
- `id: string`
The `agent` ID.
- `type: "agent_with_overrides"`
- `"agent_with_overrides"`
- `mcp_servers: optional array of BetaManagedAgentsURLMCPServerParams`
Replacement MCP server list. Full replacement: the provided array becomes the MCP servers. Send an empty array to clear; omit to preserve the agent's servers.
- `name: string`
Unique name for this server, referenced by mcp_toolset configurations. 1-255 characters.
- `type: "url"`
- `"url"`
- `url: string`
Endpoint URL for the MCP server.
- `model: optional BetaManagedAgentsModel or BetaManagedAgentsModelConfigParams`
Replacement model. Accepts the model string, e.g. `claude-opus-4-6`, or a `model_config` object. Omit to use the agent's model.
- `BetaManagedAgentsModel = "claude-sonnet-5" or "claude-fable-5" or "claude-opus-5" or 10 more or string`
The model that will power your agent.
See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
- `"claude-sonnet-5" or "claude-fable-5" or "claude-opus-5" or 10 more`
The model that will power your agent.
See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
- `"claude-sonnet-5"`
High-performance model for coding and agents
- `"claude-fable-5"`
Next generation of intelligence for the hardest knowledge work and coding problems
- `"claude-opus-5"`
Powerful intelligence for long-running agents and coding
- `"claude-opus-4-8"`
Powerful intelligence for long-running agents and coding
- `"claude-opus-4-7"`
Powerful intelligence for long-running agents and coding
- `"claude-opus-4-6"`
Powerful intelligence for long-running agents and coding
- `"claude-sonnet-4-6"`
Best combination of speed and intelligence
- `"claude-haiku-4-5"`
Fastest model with near-frontier intelligence
- `"claude-haiku-4-5-20251001"`
Fastest model with near-frontier intelligence
- `"claude-opus-4-5"`
Powerful intelligence for long-running agents and coding
- `"claude-opus-4-5-20251101"`
Powerful intelligence for long-running agents and coding
- `"claude-sonnet-4-5"`
High-performance model for agents and coding
- `"claude-sonnet-4-5-20250929"`
High-performance model for agents and coding
- `string`
- `BetaManagedAgentsModelConfigParams object { id, effort, inference_geo, speed }`
An object that defines additional configuration control over model use
- `id: BetaManagedAgentsModel`
The model that will power your agent.
See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
- `effort: optional "low" or "medium" or "high" or 2 more or BetaManagedAgentsEffortLow or BetaManagedAgentsEffortMedium or 3 more or null`
How hard Claude works on each inference call. Accepts a bare level string (`"high"`) or `{"type": "high"}`. On create, omitting it resolves the per-model default; on update, omitting it leaves the stored value unchanged.
- `BetaManagedAgentsEffortLevel = "low" or "medium" or "high" or 2 more`
How hard Claude works on each turn. Higher levels favor reasoning depth over latency. Not all models accept every level; invalid combinations are rejected at create time.
- `"low"`
- `"medium"`
- `"high"`
- `"xhigh"`
- `"max"`
- `BetaManagedAgentsEffortLow object { type }`
Low effort. Favors latency over reasoning depth.
- `type: "low"`
- `"low"`
- `BetaManagedAgentsEffortMedium object { type }`
Medium effort. Balances latency and reasoning depth.
- `type: "medium"`
- `"medium"`
- `BetaManagedAgentsEffortHigh object { type }`
High effort. Favors reasoning depth.
- `type: "high"`
- `"high"`
- `BetaManagedAgentsEffortXhigh object { type }`
Extra-high effort. Not all models accept this level.
- `type: "xhigh"`
- `"xhigh"`
- `BetaManagedAgentsEffortMax object { type }`
Maximum effort. Favors reasoning depth over latency.
- `type: "max"`
- `"max"`
- `inference_geo: optional string or null`
Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo. On update, `model` is whole-object replacement — omitting inference_geo clears it.
- `speed: optional "standard" or "fast" or null`
Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time.
- `"standard"`
- `"fast"`
- `skills: optional array of BetaManagedAgentsSkillParams`
Replacement skill list. Full replacement: the provided array becomes the skills. Send an empty array to clear; omit to preserve the agent's skills.
- `BetaManagedAgentsAnthropicSkillParams object { skill_id, type, version }`
An Anthropic-managed skill.
- `skill_id: string`
Cut at 300 lines. The page has the rest.
api/beta/sessions/archive First recorded · 948 lines, first recorded
## Archive Session ### Path Parameters ### Header Parameters ### Returns ### Example #### Response
The first capture of this source. The page was already there, and this is what it said.
---
title: Archive Session
url: https://platform.claude.com/docs/en/api/beta/sessions/archive
---
## Archive Session
**post** `/v1/sessions/{session_id}/archive`
Archive Session
### Path Parameters
- `session_id: string`
### Header Parameters
- `"anthropic-beta": optional array of AnthropicBeta`
Optional header to specify the beta version(s) you want to use.
- `string`
- `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 30 more`
- `"message-batches-2024-09-24"`
- `"prompt-caching-2024-07-31"`
- `"computer-use-2024-10-22"`
- `"computer-use-2025-01-24"`
- `"pdfs-2024-09-25"`
- `"token-counting-2024-11-01"`
- `"token-efficient-tools-2025-02-19"`
- `"output-128k-2025-02-19"`
- `"files-api-2025-04-14"`
- `"mcp-client-2025-04-04"`
- `"mcp-client-2025-11-20"`
- `"dev-full-thinking-2025-05-14"`
- `"interleaved-thinking-2025-05-14"`
- `"code-execution-2025-05-22"`
- `"extended-cache-ttl-2025-04-11"`
- `"context-1m-2025-08-07"`
- `"context-management-2025-06-27"`
- `"model-context-window-exceeded-2025-08-26"`
- `"skills-2025-10-02"`
- `"fast-mode-2026-02-01"`
- `"output-300k-2026-03-24"`
- `"user-profiles-2026-03-24"`
- `"advisor-tool-2026-03-01"`
- `"managed-agents-2026-04-01"`
- `"cache-diagnosis-2026-04-07"`
- `"dreaming-2026-04-21"`
- `"thinking-token-count-2026-05-13"`
- `"server-side-fallback-2026-06-01"`
- `"server-side-fallback-2026-07-01"`
- `"fallback-credit-2026-06-01"`
- `"fallback-credit-2026-07-01"`
- `"agent-memory-2026-07-22"`
- `"mid-conversation-tool-changes-2026-07-01"`
### Returns
- `BetaManagedAgentsSession object { id, agent, archived_at, 14 more }`
A Managed Agents `session`.
- `id: string`
- `agent: BetaManagedAgentsSessionAgent`
Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.
- `id: string`
- `description: string or null`
- `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
- `name: string`
- `type: "url"`
- `"url"`
- `url: string`
- `model: BetaManagedAgentsModelConfig`
Model identifier and configuration.
- `id: BetaManagedAgentsModel`
The model that will power your agent.
See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
- `"claude-sonnet-5" or "claude-fable-5" or "claude-opus-5" or 10 more`
The model that will power your agent.
See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
- `"claude-sonnet-5"`
High-performance model for coding and agents
- `"claude-fable-5"`
Next generation of intelligence for the hardest knowledge work and coding problems
- `"claude-opus-5"`
Powerful intelligence for long-running agents and coding
- `"claude-opus-4-8"`
Powerful intelligence for long-running agents and coding
- `"claude-opus-4-7"`
Powerful intelligence for long-running agents and coding
- `"claude-opus-4-6"`
Powerful intelligence for long-running agents and coding
- `"claude-sonnet-4-6"`
Best combination of speed and intelligence
- `"claude-haiku-4-5"`
Fastest model with near-frontier intelligence
- `"claude-haiku-4-5-20251001"`
Fastest model with near-frontier intelligence
- `"claude-opus-4-5"`
Powerful intelligence for long-running agents and coding
- `"claude-opus-4-5-20251101"`
Powerful intelligence for long-running agents and coding
- `"claude-sonnet-4-5"`
High-performance model for agents and coding
- `"claude-sonnet-4-5-20250929"`
High-performance model for agents and coding
- `string`
- `effort: optional BetaManagedAgentsEffortLow or BetaManagedAgentsEffortMedium or BetaManagedAgentsEffortHigh or 2 more`
How hard Claude works on each turn. Sets `output_config.effort` on every Messages call the session makes.
- `BetaManagedAgentsEffortLow object { type }`
Low effort. Favors latency over reasoning depth.
- `type: "low"`
- `"low"`
- `BetaManagedAgentsEffortMedium object { type }`
Medium effort. Balances latency and reasoning depth.
- `type: "medium"`
- `"medium"`
- `BetaManagedAgentsEffortHigh object { type }`
High effort. Favors reasoning depth.
- `type: "high"`
- `"high"`
- `BetaManagedAgentsEffortXhigh object { type }`
Extra-high effort. Not all models accept this level.
- `type: "xhigh"`
- `"xhigh"`
- `BetaManagedAgentsEffortMax object { type }`
Maximum effort. Favors reasoning depth over latency.
- `type: "max"`
- `"max"`
- `inference_geo: optional string`
Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo.
- `speed: optional "standard" or "fast"`
Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time.
- `"standard"`
- `"fast"`
- `multiagent: BetaManagedAgentsSessionMultiagentCoordinator or null`
Resolved coordinator topology with full agent definitions for each roster member.
- `agents: array of BetaManagedAgentsSessionThreadAgent or BetaManagedAgentsAdvisor`
Full `agent` definitions the coordinator may spawn as session threads.
- `BetaManagedAgentsSessionThreadAgent object { id, description, mcp_servers, 7 more }`
Resolved `agent` definition for a single `session_thread`. Snapshot of the agent at thread creation time. The multiagent roster is not repeated here; read it from `Session.agent`.
- `id: string`
- `description: string or null`
- `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition`
- `name: string`
- `type: "url"`
- `url: string`
- `model: BetaManagedAgentsModelConfig`
Model identifier and configuration.
- `name: string`
- `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill`
- `BetaManagedAgentsAnthropicSkill object { skill_id, type, version }`
A resolved Anthropic-managed skill.
- `skill_id: string`
- `type: "anthropic"`
- `"anthropic"`
- `version: string`
- `BetaManagedAgentsCustomSkill object { skill_id, type, version }`
A resolved user-created custom skill.
- `skill_id: string`
- `type: "custom"`
- `"custom"`
- `version: string`
- `system: string or null`
Cut at 300 lines. The page has the rest.
api/beta/sessions/create First recorded · 1695 lines, first recorded
## Create Session ### Header Parameters ### Body Parameters ### Returns ### Example #### Response
The first capture of this source. The page was already there, and this is what it said.
---
title: Create Session
url: https://platform.claude.com/docs/en/api/beta/sessions/create
---
## Create Session
**post** `/v1/sessions`
Create Session
### Header Parameters
- `"anthropic-beta": optional array of AnthropicBeta`
Optional header to specify the beta version(s) you want to use.
- `string`
- `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 30 more`
- `"message-batches-2024-09-24"`
- `"prompt-caching-2024-07-31"`
- `"computer-use-2024-10-22"`
- `"computer-use-2025-01-24"`
- `"pdfs-2024-09-25"`
- `"token-counting-2024-11-01"`
- `"token-efficient-tools-2025-02-19"`
- `"output-128k-2025-02-19"`
- `"files-api-2025-04-14"`
- `"mcp-client-2025-04-04"`
- `"mcp-client-2025-11-20"`
- `"dev-full-thinking-2025-05-14"`
- `"interleaved-thinking-2025-05-14"`
- `"code-execution-2025-05-22"`
- `"extended-cache-ttl-2025-04-11"`
- `"context-1m-2025-08-07"`
- `"context-management-2025-06-27"`
- `"model-context-window-exceeded-2025-08-26"`
- `"skills-2025-10-02"`
- `"fast-mode-2026-02-01"`
- `"output-300k-2026-03-24"`
- `"user-profiles-2026-03-24"`
- `"advisor-tool-2026-03-01"`
- `"managed-agents-2026-04-01"`
- `"cache-diagnosis-2026-04-07"`
- `"dreaming-2026-04-21"`
- `"thinking-token-count-2026-05-13"`
- `"server-side-fallback-2026-06-01"`
- `"server-side-fallback-2026-07-01"`
- `"fallback-credit-2026-06-01"`
- `"fallback-credit-2026-07-01"`
- `"agent-memory-2026-07-22"`
- `"mid-conversation-tool-changes-2026-07-01"`
### Body Parameters
- `agent: string or BetaManagedAgentsAgentParams or BetaManagedAgentsAgentWithOverridesParams`
Agent identifier. Accepts the `agent` ID string, which pins the latest version for the session, or an `agent` object with both id and version specified.
- `string`
- `BetaManagedAgentsAgentParams object { id, type, version }`
Specification for an Agent. Provide a specific `version` or use the short-form `agent="agent_id"` for the most recent version
- `id: string`
The `agent` ID.
- `type: "agent"`
- `"agent"`
- `version: optional number`
The specific `agent` version to use. Omit to use the latest version. Must be at least 1 if specified.
- `BetaManagedAgentsAgentWithOverridesParams object { id, type, mcp_servers, 5 more }`
Reference to an `agent` plus optional configuration overrides. Each provided field replaces the agent's value for the caller's use; the agent resource is unchanged.
- `id: string`
The `agent` ID.
- `type: "agent_with_overrides"`
- `"agent_with_overrides"`
- `mcp_servers: optional array of BetaManagedAgentsURLMCPServerParams`
Replacement MCP server list. Full replacement: the provided array becomes the MCP servers. Send an empty array to clear; omit to preserve the agent's servers.
- `name: string`
Unique name for this server, referenced by mcp_toolset configurations. 1-255 characters.
- `type: "url"`
- `"url"`
- `url: string`
Endpoint URL for the MCP server.
- `model: optional BetaManagedAgentsModel or BetaManagedAgentsModelConfigParams`
Replacement model. Accepts the model string, e.g. `claude-opus-4-6`, or a `model_config` object. Omit to use the agent's model.
- `BetaManagedAgentsModel = "claude-sonnet-5" or "claude-fable-5" or "claude-opus-5" or 10 more or string`
The model that will power your agent.
See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
- `"claude-sonnet-5" or "claude-fable-5" or "claude-opus-5" or 10 more`
The model that will power your agent.
See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
- `"claude-sonnet-5"`
High-performance model for coding and agents
- `"claude-fable-5"`
Next generation of intelligence for the hardest knowledge work and coding problems
- `"claude-opus-5"`
Powerful intelligence for long-running agents and coding
- `"claude-opus-4-8"`
Powerful intelligence for long-running agents and coding
- `"claude-opus-4-7"`
Powerful intelligence for long-running agents and coding
- `"claude-opus-4-6"`
Powerful intelligence for long-running agents and coding
- `"claude-sonnet-4-6"`
Best combination of speed and intelligence
- `"claude-haiku-4-5"`
Fastest model with near-frontier intelligence
- `"claude-haiku-4-5-20251001"`
Fastest model with near-frontier intelligence
- `"claude-opus-4-5"`
Powerful intelligence for long-running agents and coding
- `"claude-opus-4-5-20251101"`
Powerful intelligence for long-running agents and coding
- `"claude-sonnet-4-5"`
High-performance model for agents and coding
- `"claude-sonnet-4-5-20250929"`
High-performance model for agents and coding
- `string`
- `BetaManagedAgentsModelConfigParams object { id, effort, inference_geo, speed }`
An object that defines additional configuration control over model use
- `id: BetaManagedAgentsModel`
The model that will power your agent.
See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
- `effort: optional "low" or "medium" or "high" or 2 more or BetaManagedAgentsEffortLow or BetaManagedAgentsEffortMedium or 3 more or null`
How hard Claude works on each inference call. Accepts a bare level string (`"high"`) or `{"type": "high"}`. On create, omitting it resolves the per-model default; on update, omitting it leaves the stored value unchanged.
- `BetaManagedAgentsEffortLevel = "low" or "medium" or "high" or 2 more`
How hard Claude works on each turn. Higher levels favor reasoning depth over latency. Not all models accept every level; invalid combinations are rejected at create time.
- `"low"`
- `"medium"`
- `"high"`
- `"xhigh"`
- `"max"`
- `BetaManagedAgentsEffortLow object { type }`
Low effort. Favors latency over reasoning depth.
- `type: "low"`
- `"low"`
- `BetaManagedAgentsEffortMedium object { type }`
Medium effort. Balances latency and reasoning depth.
- `type: "medium"`
- `"medium"`
- `BetaManagedAgentsEffortHigh object { type }`
High effort. Favors reasoning depth.
- `type: "high"`
- `"high"`
- `BetaManagedAgentsEffortXhigh object { type }`
Extra-high effort. Not all models accept this level.
- `type: "xhigh"`
- `"xhigh"`
- `BetaManagedAgentsEffortMax object { type }`
Maximum effort. Favors reasoning depth over latency.
- `type: "max"`
- `"max"`
- `inference_geo: optional string or null`
Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo. On update, `model` is whole-object replacement — omitting inference_geo clears it.
- `speed: optional "standard" or "fast" or null`
Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time.
- `"standard"`
- `"fast"`
- `skills: optional array of BetaManagedAgentsSkillParams`
Replacement skill list. Full replacement: the provided array becomes the skills. Send an empty array to clear; omit to preserve the agent's skills.
- `BetaManagedAgentsAnthropicSkillParams object { skill_id, type, version }`
An Anthropic-managed skill.
- `skill_id: string`
Identifier of the Anthropic skill (e.g., "xlsx").
Cut at 300 lines. The page has the rest.
api/beta/sessions/delete First recorded · 121 lines, first recorded
## Delete Session ### Path Parameters ### Header Parameters ### Returns ### Example #### Response
The first capture of this source. The page was already there, and this is what it said.
---
title: Delete Session
url: https://platform.claude.com/docs/en/api/beta/sessions/delete
---
## Delete Session
**delete** `/v1/sessions/{session_id}`
Delete Session
### Path Parameters
- `session_id: string`
### Header Parameters
- `"anthropic-beta": optional array of AnthropicBeta`
Optional header to specify the beta version(s) you want to use.
- `string`
- `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 30 more`
- `"message-batches-2024-09-24"`
- `"prompt-caching-2024-07-31"`
- `"computer-use-2024-10-22"`
- `"computer-use-2025-01-24"`
- `"pdfs-2024-09-25"`
- `"token-counting-2024-11-01"`
- `"token-efficient-tools-2025-02-19"`
- `"output-128k-2025-02-19"`
- `"files-api-2025-04-14"`
- `"mcp-client-2025-04-04"`
- `"mcp-client-2025-11-20"`
- `"dev-full-thinking-2025-05-14"`
- `"interleaved-thinking-2025-05-14"`
- `"code-execution-2025-05-22"`
- `"extended-cache-ttl-2025-04-11"`
- `"context-1m-2025-08-07"`
- `"context-management-2025-06-27"`
- `"model-context-window-exceeded-2025-08-26"`
- `"skills-2025-10-02"`
- `"fast-mode-2026-02-01"`
- `"output-300k-2026-03-24"`
- `"user-profiles-2026-03-24"`
- `"advisor-tool-2026-03-01"`
- `"managed-agents-2026-04-01"`
- `"cache-diagnosis-2026-04-07"`
- `"dreaming-2026-04-21"`
- `"thinking-token-count-2026-05-13"`
- `"server-side-fallback-2026-06-01"`
- `"server-side-fallback-2026-07-01"`
- `"fallback-credit-2026-06-01"`
- `"fallback-credit-2026-07-01"`
- `"agent-memory-2026-07-22"`
- `"mid-conversation-tool-changes-2026-07-01"`
### Returns
- `BetaManagedAgentsDeletedSession object { id, type }`
Confirmation that a `session` has been permanently deleted.
- `id: string`
- `type: "session_deleted"`
- `"session_deleted"`
### Example
```http
curl https://api.anthropic.com/v1/sessions/$SESSION_ID \
-X DELETE \
-H 'anthropic-version: 2023-06-01' \
-H 'anthropic-beta: managed-agents-2026-04-01' \
-H "X-Api-Key: $ANTHROPIC_API_KEY"
```
#### Response
```json
{
"id": "sesn_011CZkZAtmR3yMPDzynEDxu7",
"type": "session_deleted"
}
```
api/beta/sessions/events First recorded · 13925 lines, first recorded
# Events ## List Events ### Path Parameters ### Query Parameters ### Header Parameters ### Returns ### Example #### Response ## Send Events ### Path Parameters ### Header Parameters ### Body Parameters ### Returns ### Example #### Response ## Stream Events ### Path Parameters ### Query Parameters ### Header Parameters ### Returns ### Example #### Response ## Domain Types ### Beta Managed Agents Agent Custom Tool Use Event ### Beta Managed Agents Agent MCP Tool Result Event ### Beta Managed Agents Agent MCP Tool Use Event ### Beta Managed Agents Agent Message Event ### Beta Managed Agents Agent Thinking Event ### Beta Managed Agents Agent Thread Context Compacted Event ### Beta Managed Agents Agent Thread Message Received Event ### Beta Managed Agents Agent Thread Message Sent Event ### Beta Managed Agents Agent Tool Result Event ### Beta Managed Agents Agent Tool Use Event ### Beta Managed Agents Base64 Document Source ### Beta Managed Agents Base64 Image Source ### Beta Managed Agents Billing Error ### Beta Managed Agents Credential Host Unreachable Error ### Beta Managed Agents Document Block ### Beta Managed Agents Event Params ### Beta Managed Agents File Document Source ### Beta Managed Agents File Image Source ### Beta Managed Agents File Rubric ### Beta Managed Agents File Rubric Params ### Beta Managed Agents Image Block ### Beta Managed Agents MCP Authentication Failed Error ### Beta Managed Agents MCP Connection Failed Error ### Beta Managed Agents Model Overloaded Error ### Beta Managed Agents Model Rate Limited Error ### Beta Managed Agents Model Request Failed Error ### Beta Managed Agents Plain Text Document Source ### Beta Managed Agents Redacted Block ### Beta Managed Agents Retry Status Exhausted ### Beta Managed Agents Retry Status Retrying ### Beta Managed Agents Retry Status Terminal ### Beta Managed Agents Search Result Block ### Beta Managed Agents Search Result Citations ### Beta Managed Agents Search Result Content ### Beta Managed Agents Send Session Events ### Beta Managed Agents Session Budget Reached ### Beta Managed Agents Session Deleted Event ### Beta Managed Agents Session End Turn ### Beta Managed Agents Session Error Event ### Beta Managed Agents Session Event ### Beta Managed Agents Session Requires Action ### Beta Managed Agents Session Retries Exhausted ### Beta Managed Agents Session Status Idle Event ### Beta Managed Agents Session Status Rescheduled Event ### Beta Managed Agents Session Status Running Event ### Beta Managed Agents Session Status Terminated Event ### Beta Managed Agents Session Thread Created Event ### Beta Managed Agents Session Thread Status Idle Event ### Beta Managed Agents Session Thread Status Rescheduled Event ### Beta Managed Agents Session Thread Status Running Event ### Beta Managed Agents Session Thread Status Terminated Event ### Beta Managed Agents Session Usage Snapshot ### Beta Managed Agents Span Model Request End Event ### Beta Managed Agents Span Model Request Start Event ### Beta Managed Agents Span Model Usage ### Beta Managed Agents Span Outcome Evaluation End Event ### Beta Managed Agents Span Outcome Evaluation Ongoing Event ### Beta Managed Agents Span Outcome Evaluation Start Event ### Beta Managed Agents Stream Session Events ### Beta Managed Agents System Message Event Params ### Beta Managed Agents Text Block ### Beta Managed Agents Text Rubric ### Beta Managed Agents Text Rubric Params ### Beta Managed Agents Unknown Error ### Beta Managed Agents URL Document Source ### Beta Managed Agents URL Image Source ### Beta Managed Agents User Custom Tool Result Event ### Beta Managed Agents User Custom Tool Result Event Params ### Beta Managed Agents User Define Outcome Event ### Beta Managed Agents User Define Outcome Event Params ### Beta Managed Agents User Interrupt Event ### Beta Managed Agents User Interrupt Event Params ### Beta Managed Agents User Message Event ### Beta Managed Agents User Message Event Params ### Beta Managed Agents User Tool Confirmation Event ### Beta Managed Agents User Tool Confirmation Event Params ### Beta Managed Agents User Tool Result Event Params
This page is larger than the 256 KiB this site keeps, so one side of the diff below stops where the stored text does.
The first capture of this source. The page was already there, and this is what it said.
---
title: Events
url: https://platform.claude.com/docs/en/api/beta/sessions/events
---
# Events
## List Events
**get** `/v1/sessions/{session_id}/events`
List Events
### Path Parameters
- `session_id: string`
### Query Parameters
- `"created_at[gt]": optional string`
Return events created after this time (exclusive). Compared against the event's `processed_at` value.
- `"created_at[gte]": optional string`
Return events created at or after this time (inclusive). Compared against the event's `processed_at` value.
- `"created_at[lt]": optional string`
Return events created before this time (exclusive). Compared against the event's `processed_at` value.
- `"created_at[lte]": optional string`
Return events created at or before this time (inclusive). Compared against the event's `processed_at` value.
- `limit: optional number`
Query parameter for limit
- `order: optional "asc" or "desc"`
Sort direction for results, ordered by the event's `processed_at`. Defaults to asc (chronological).
- `"asc"`
- `"desc"`
- `page: optional string`
Opaque pagination cursor from a previous response's next_page.
- `types: optional array of string`
Filter by event type. Values match the `type` field on returned events (for example, `user.message` or `agent.tool_use`). Omit to return all event types.
### Header Parameters
- `"anthropic-beta": optional array of AnthropicBeta`
Optional header to specify the beta version(s) you want to use.
- `string`
- `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 30 more`
- `"message-batches-2024-09-24"`
- `"prompt-caching-2024-07-31"`
- `"computer-use-2024-10-22"`
- `"computer-use-2025-01-24"`
- `"pdfs-2024-09-25"`
- `"token-counting-2024-11-01"`
- `"token-efficient-tools-2025-02-19"`
- `"output-128k-2025-02-19"`
- `"files-api-2025-04-14"`
- `"mcp-client-2025-04-04"`
- `"mcp-client-2025-11-20"`
- `"dev-full-thinking-2025-05-14"`
- `"interleaved-thinking-2025-05-14"`
- `"code-execution-2025-05-22"`
- `"extended-cache-ttl-2025-04-11"`
- `"context-1m-2025-08-07"`
- `"context-management-2025-06-27"`
- `"model-context-window-exceeded-2025-08-26"`
- `"skills-2025-10-02"`
- `"fast-mode-2026-02-01"`
- `"output-300k-2026-03-24"`
- `"user-profiles-2026-03-24"`
- `"advisor-tool-2026-03-01"`
- `"managed-agents-2026-04-01"`
- `"cache-diagnosis-2026-04-07"`
- `"dreaming-2026-04-21"`
- `"thinking-token-count-2026-05-13"`
- `"server-side-fallback-2026-06-01"`
- `"server-side-fallback-2026-07-01"`
- `"fallback-credit-2026-06-01"`
- `"fallback-credit-2026-07-01"`
- `"agent-memory-2026-07-22"`
- `"mid-conversation-tool-changes-2026-07-01"`
### Returns
- `data: optional array of BetaManagedAgentsSessionEvent`
Events for the session, ordered by `processed_at`.
- `BetaManagedAgentsUserMessageEvent object { id, content, type, processed_at }`
A user message event in the session conversation.
- `id: string`
Unique identifier for this event.
- `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock or BetaManagedAgentsRedactedBlock`
Array of content blocks comprising the user message.
- `BetaManagedAgentsTextBlock object { text, type }`
Regular text content.
- `text: string`
The text content.
- `type: "text"`
- `"text"`
- `BetaManagedAgentsImageBlock object { source, type }`
Image content specified directly as base64 data or as a reference via a URL.
- `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
Union type for image source variants.
- `BetaManagedAgentsBase64ImageSource object { data, media_type, type }`
Base64-encoded image data.
- `data: string`
Base64-encoded image data.
- `media_type: string`
MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
- `type: "base64"`
- `"base64"`
- `BetaManagedAgentsURLImageSource object { type, url }`
Image referenced by URL.
- `type: "url"`
- `"url"`
- `url: string`
URL of the image to fetch.
- `BetaManagedAgentsFileImageSource object { file_id, type }`
Image referenced by file ID.
- `file_id: string`
ID of a previously uploaded file.
- `type: "file"`
- `"file"`
- `type: "image"`
- `"image"`
- `BetaManagedAgentsDocumentBlock object { source, type, context, title }`
Document content, either specified directly as base64 data, as text, or as a reference via a URL.
- `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
Union type for document source variants.
- `BetaManagedAgentsBase64DocumentSource object { data, media_type, type }`
Base64-encoded document data.
- `data: string`
Base64-encoded document data.
- `media_type: string`
MIME type of the document (e.g., "application/pdf").
- `type: "base64"`
- `"base64"`
- `BetaManagedAgentsPlainTextDocumentSource object { data, media_type, type }`
Plain text document content.
- `data: string`
The plain text content.
- `media_type: "text/plain"`
MIME type of the text content. Must be "text/plain".
- `"text/plain"`
- `type: "text"`
- `"text"`
- `BetaManagedAgentsURLDocumentSource object { type, url }`
Document referenced by URL.
- `type: "url"`
- `"url"`
- `url: string`
URL of the document to fetch.
- `BetaManagedAgentsFileDocumentSource object { file_id, type }`
Document referenced by file ID.
- `file_id: string`
ID of a previously uploaded file.
- `type: "file"`
- `"file"`
- `type: "document"`
- `"document"`
- `context: optional string or null`
Additional context about the document for the model.
- `title: optional string or null`
The title of the document.
- `BetaManagedAgentsRedactedBlock object { type }`
Placeholder for content withheld by Anthropic model policy.
- `type: "redacted"`
- `"redacted"`
- `type: "user.message"`
Cut at 300 lines. The page has the rest.
api/beta/sessions/events/list First recorded · 2155 lines, first recorded
## List Events ### Path Parameters ### Query Parameters ### Header Parameters ### Returns ### Example #### Response
The first capture of this source. The page was already there, and this is what it said.
---
title: List Events
url: https://platform.claude.com/docs/en/api/beta/sessions/events/list
---
## List Events
**get** `/v1/sessions/{session_id}/events`
List Events
### Path Parameters
- `session_id: string`
### Query Parameters
- `"created_at[gt]": optional string`
Return events created after this time (exclusive). Compared against the event's `processed_at` value.
- `"created_at[gte]": optional string`
Return events created at or after this time (inclusive). Compared against the event's `processed_at` value.
- `"created_at[lt]": optional string`
Return events created before this time (exclusive). Compared against the event's `processed_at` value.
- `"created_at[lte]": optional string`
Return events created at or before this time (inclusive). Compared against the event's `processed_at` value.
- `limit: optional number`
Query parameter for limit
- `order: optional "asc" or "desc"`
Sort direction for results, ordered by the event's `processed_at`. Defaults to asc (chronological).
- `"asc"`
- `"desc"`
- `page: optional string`
Opaque pagination cursor from a previous response's next_page.
- `types: optional array of string`
Filter by event type. Values match the `type` field on returned events (for example, `user.message` or `agent.tool_use`). Omit to return all event types.
### Header Parameters
- `"anthropic-beta": optional array of AnthropicBeta`
Optional header to specify the beta version(s) you want to use.
- `string`
- `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 30 more`
- `"message-batches-2024-09-24"`
- `"prompt-caching-2024-07-31"`
- `"computer-use-2024-10-22"`
- `"computer-use-2025-01-24"`
- `"pdfs-2024-09-25"`
- `"token-counting-2024-11-01"`
- `"token-efficient-tools-2025-02-19"`
- `"output-128k-2025-02-19"`
- `"files-api-2025-04-14"`
- `"mcp-client-2025-04-04"`
- `"mcp-client-2025-11-20"`
- `"dev-full-thinking-2025-05-14"`
- `"interleaved-thinking-2025-05-14"`
- `"code-execution-2025-05-22"`
- `"extended-cache-ttl-2025-04-11"`
- `"context-1m-2025-08-07"`
- `"context-management-2025-06-27"`
- `"model-context-window-exceeded-2025-08-26"`
- `"skills-2025-10-02"`
- `"fast-mode-2026-02-01"`
- `"output-300k-2026-03-24"`
- `"user-profiles-2026-03-24"`
- `"advisor-tool-2026-03-01"`
- `"managed-agents-2026-04-01"`
- `"cache-diagnosis-2026-04-07"`
- `"dreaming-2026-04-21"`
- `"thinking-token-count-2026-05-13"`
- `"server-side-fallback-2026-06-01"`
- `"server-side-fallback-2026-07-01"`
- `"fallback-credit-2026-06-01"`
- `"fallback-credit-2026-07-01"`
- `"agent-memory-2026-07-22"`
- `"mid-conversation-tool-changes-2026-07-01"`
### Returns
- `data: optional array of BetaManagedAgentsSessionEvent`
Events for the session, ordered by `processed_at`.
- `BetaManagedAgentsUserMessageEvent object { id, content, type, processed_at }`
A user message event in the session conversation.
- `id: string`
Unique identifier for this event.
- `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock or BetaManagedAgentsRedactedBlock`
Array of content blocks comprising the user message.
- `BetaManagedAgentsTextBlock object { text, type }`
Regular text content.
- `text: string`
The text content.
- `type: "text"`
- `"text"`
- `BetaManagedAgentsImageBlock object { source, type }`
Image content specified directly as base64 data or as a reference via a URL.
- `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource`
Union type for image source variants.
- `BetaManagedAgentsBase64ImageSource object { data, media_type, type }`
Base64-encoded image data.
- `data: string`
Base64-encoded image data.
- `media_type: string`
MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
- `type: "base64"`
- `"base64"`
- `BetaManagedAgentsURLImageSource object { type, url }`
Image referenced by URL.
- `type: "url"`
- `"url"`
- `url: string`
URL of the image to fetch.
- `BetaManagedAgentsFileImageSource object { file_id, type }`
Image referenced by file ID.
- `file_id: string`
ID of a previously uploaded file.
- `type: "file"`
- `"file"`
- `type: "image"`
- `"image"`
- `BetaManagedAgentsDocumentBlock object { source, type, context, title }`
Document content, either specified directly as base64 data, as text, or as a reference via a URL.
- `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource`
Union type for document source variants.
- `BetaManagedAgentsBase64DocumentSource object { data, media_type, type }`
Base64-encoded document data.
- `data: string`
Base64-encoded document data.
- `media_type: string`
MIME type of the document (e.g., "application/pdf").
- `type: "base64"`
- `"base64"`
- `BetaManagedAgentsPlainTextDocumentSource object { data, media_type, type }`
Plain text document content.
- `data: string`
The plain text content.
- `media_type: "text/plain"`
MIME type of the text content. Must be "text/plain".
- `"text/plain"`
- `type: "text"`
- `"text"`
- `BetaManagedAgentsURLDocumentSource object { type, url }`
Document referenced by URL.
- `type: "url"`
- `"url"`
- `url: string`
URL of the document to fetch.
- `BetaManagedAgentsFileDocumentSource object { file_id, type }`
Document referenced by file ID.
- `file_id: string`
ID of a previously uploaded file.
- `type: "file"`
- `"file"`
- `type: "document"`
- `"document"`
- `context: optional string or null`
Additional context about the document for the model.
- `title: optional string or null`
The title of the document.
- `BetaManagedAgentsRedactedBlock object { type }`
Placeholder for content withheld by Anthropic model policy.
- `type: "redacted"`
- `"redacted"`
- `type: "user.message"`
- `"user.message"`
Cut at 300 lines. The page has the rest.