Claude Platform Docs

Sessions

Create Session
BetaManagedAgentsSession beta().sessions().create(SessionCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/v1/sessions
List Sessions
SessionListPage beta().sessions().list(SessionListParamsparams = SessionListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/v1/sessions
Get Session
BetaManagedAgentsSession beta().sessions().retrieve(SessionRetrieveParamsparams = SessionRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/v1/sessions/{session_id}
Update Session
BetaManagedAgentsSession beta().sessions().update(SessionUpdateParamsparams = SessionUpdateParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
POST/v1/sessions/{session_id}
Delete Session
BetaManagedAgentsDeletedSession beta().sessions().delete(SessionDeleteParamsparams = SessionDeleteParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
DELETE/v1/sessions/{session_id}
Archive Session
BetaManagedAgentsSession beta().sessions().archive(SessionArchiveParamsparams = SessionArchiveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
POST/v1/sessions/{session_id}/archive
Models
class BetaManagedAgentsAdvisorParams:

Platform advisor roster entry: a model the session's primary thread may consult mid-turn. At most one per roster; the entry occupies the roster name anthropic.advisor.

String model

A Claude model id. The model must be permitted as an advisor for this agent's model — see the sessions/threads/advisor spec.

minLength1
maxLength256
Type type
class BetaManagedAgentsAgentMessagePreview:
String id

The id the buffered agent.message will carry if it is emitted. Matches the event_id on this preview's event_delta events.

Type type
class BetaManagedAgentsAgentParams:

Specification for an Agent. Provide a specific version or use the short-form agent="agent_id" for the most recent version

String id

The agent ID.

minLength1
maxLength128
Type type
Optional<Long> version

The specific agent version to use. Omit to use the latest version. Must be at least 1 if specified.

formatint32
class BetaManagedAgentsAgentThinkingPreview:
String id

The id the buffered agent.thinking will carry if it is emitted. Start-only — no event_delta events follow.

Type type
class BetaManagedAgentsAgentWithOverridesParams:

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.

class BetaManagedAgentsBranchCheckout:
String name

Branch name to check out.

minLength1
maxLength255
Type type
class BetaManagedAgentsBudgetLimit:

A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches max_list_cost.

BetaMonetaryAmount maxListCost

A monetary amount in a specific currency.

String amount

Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a number so no float rounding is ever applied.

BetaCurrency currency

Uppercase ISO-4217 currency code. USD is the only currency currently supported; the accepted set is closed and grows only when a new currency is priced.

Type type
class BetaManagedAgentsCacheCreationUsage:

Prompt-cache creation token usage broken down by cache lifetime.

Optional<Long> ephemeral1hInputTokens

Tokens used to create 1-hour ephemeral cache entries.

formatint32
Optional<Long> ephemeral5mInputTokens

Tokens used to create 5-minute ephemeral cache entries.

formatint32
class BetaManagedAgentsCommitCheckout:
String sha

Full commit SHA to check out.

minLength7
maxLength64
Type type
class BetaManagedAgentsDeletedSession:

Confirmation that a session has been permanently deleted.

String id
Type type
class BetaManagedAgentsDeltaContent:

Regular text content.

String text

The text content.

minLength1
Type type
Type type
Optional<Long> index

Which entry in the previewed event's content array this fragment lands in. Insert content as that entry when the index is new; append to the existing entry otherwise.

formatuint32
class BetaManagedAgentsDeltaEvent:

An incremental update to an event that is still being streamed. Deltas are best-effort and may stop early; when the buffered event with id == event_id is produced it carries the complete content. A model request that ends early (an error or interrupt) produces no buffered event — its terminal span.model_request_end closes the preview. Only sent on stream connections that opt in via event_deltas; never appears in event history.

One fragment of the previewed event. The delta type is named for the previewed event's field it streams into: agent.message events stream content_delta fragments, each a partial element of the content array.

Regular text content.

String text

The text content.

minLength1
Type type
Type type
Optional<Long> index

Which entry in the previewed event's content array this fragment lands in. Insert content as that entry when the index is new; append to the existing entry otherwise.

formatuint32
String eventId

The id of the event being previewed. Matches event.id on the corresponding event_start and the buffered event that reconciles the preview.

Type type
enum BetaManagedAgentsDeltaType:

EventDeltaType enum

AGENT_MESSAGE("agent.message")
AGENT_THINKING("agent.thinking")
class BetaManagedAgentsFileResourceParams:

Mount a file uploaded via the Files API into the session.

String fileId

ID of a previously uploaded file.

minLength1
maxLength128
Type type
Optional<String> mountPath

Mount path in the container. Defaults to /mnt/session/uploads/<file_id>.

minLength1
maxLength4096
class BetaManagedAgentsGitHubRepositoryResourceParams:

Mount a GitHub repository into the session's container.

String authorizationToken

GitHub authorization token used to clone the repository.

minLength1
maxLength4096
Type type
String url

Github URL of the repository

minLength1
maxLength2048
Optional<Checkout> checkout

Branch or commit to check out. Defaults to the repository's default branch.

One of the following:
class BetaManagedAgentsBranchCheckout:
String name

Branch name to check out.

minLength1
maxLength255
Type type
class BetaManagedAgentsCommitCheckout:
String sha

Full commit SHA to check out.

minLength7
maxLength64
Type type
Optional<String> mountPath

Mount path in the container. Defaults to /workspace/<repo-name>.

minLength1
maxLength4096
class BetaManagedAgentsMemoryStoreResourceParam:

Parameters for attaching a memory store to an agent session.

String memoryStoreId

The memory store ID (memstore_...). Must belong to the caller's organization and workspace.

Type type
Optional<Access> access

Access mode for an attached memory store.

One of the following:
READ_WRITE("read_write")
READ_ONLY("read_only")
Optional<String> instructions

Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.

maxLength4096
class BetaManagedAgentsMultiagent:

Resolved coordinator topology with a concrete agent roster.

List<Agent> agents

Agents the coordinator may spawn as session threads, each resolved to a specific version.

One of the following:
class BetaManagedAgentsAgentReference:

A resolved agent reference with a concrete version.

String id
Type type
long version
formatint32
class BetaManagedAgentsAdvisor:

Platform advisor roster entry: a model the session's primary thread may consult mid-turn.

String model

The advisor model id.

Type type
Type type
class BetaManagedAgentsMultiagentParams:

A coordinator topology: the session's primary thread orchestrates work by spawning session threads, each running an agent drawn from the agents roster.

Agents the coordinator may spawn as session threads. 1–20 entries. Each entry is an agent ID string, a versioned {"type":"agent","id","version"} reference, or {"type":"self"} to allow recursive self-invocation. Entries must reference distinct agents (after resolving self and string forms); at most one self. Referenced agents must exist, must not be archived, and must not themselves have multiagent set (depth limit 1).

One of the following:
String
class BetaManagedAgentsAgentParams:

Specification for an Agent. Provide a specific version or use the short-form agent="agent_id" for the most recent version

String id

The agent ID.

minLength1
maxLength128
Type type
Optional<Long> version

The specific agent version to use. Omit to use the latest version. Must be at least 1 if specified.

formatint32
class BetaManagedAgentsMultiagentSelfParams:

Sentinel roster entry meaning "the agent that owns this configuration". Resolved server-side to a concrete agent reference.

Type type
class BetaManagedAgentsAdvisorParams:

Platform advisor roster entry: a model the session's primary thread may consult mid-turn. At most one per roster; the entry occupies the roster name anthropic.advisor.

String model

A Claude model id. The model must be permitted as an advisor for this agent's model — see the sessions/threads/advisor spec.

minLength1
maxLength256
Type type
Type type
class BetaManagedAgentsMultiagentRosterEntryParams: A class that can be one of several variants.union

An entry in a multiagent roster: an agent ID string, a versioned agent reference, or self.

String
class BetaManagedAgentsAgentParams:

Specification for an Agent. Provide a specific version or use the short-form agent="agent_id" for the most recent version

String id

The agent ID.

minLength1
maxLength128
Type type
Optional<Long> version

The specific agent version to use. Omit to use the latest version. Must be at least 1 if specified.

formatint32
class BetaManagedAgentsMultiagentSelfParams:

Sentinel roster entry meaning "the agent that owns this configuration". Resolved server-side to a concrete agent reference.

Type type
class BetaManagedAgentsAdvisorParams:

Platform advisor roster entry: a model the session's primary thread may consult mid-turn. At most one per roster; the entry occupies the roster name anthropic.advisor.

String model

A Claude model id. The model must be permitted as an advisor for this agent's model — see the sessions/threads/advisor spec.

minLength1
maxLength256
Type type
class BetaManagedAgentsOutcomeEvaluationResource:

Evaluation state for a single outcome defined via a define_outcome event.

Optional<LocalDateTime> completedAt

A timestamp in RFC 3339 format

formatdate-time
String description

What the agent should produce.

Optional<String> explanation

Grader's verdict text from the most recent evaluation. For satisfied, explains why criteria are met; for needs_revision (intermediate), what's missing; for failed, why unrecoverable.

long iteration

0-indexed revision cycle the outcome is currently on.

formatint32
String outcomeId

Server-generated outc_ ID for this outcome.

String result

Current evaluation state. pending before the agent begins work; running while producing or revising; evaluating while the grader scores; satisfied/max_iterations_reached/failed/interrupted are terminal.

Type type
class BetaManagedAgentsServerToolUsage:

Cumulative count of server-executed tool invocations, broken down by tool.

Optional<Long> webFetchRequests

Number of server-executed web fetch requests.

formatint32
Optional<Long> webSearchRequests

Number of server-executed web search requests.

formatint32
class BetaManagedAgentsSession:

A Managed Agents session.

class BetaManagedAgentsSessionAgent:

Resolved agent definition for a session. Snapshot of the agent at session creation time.

class BetaManagedAgentsSessionAgentUpdate:

Mid-session agent configuration update. Only tools and mcp_servers are updatable. Full replacement: the provided array becomes the new value. To preserve existing entries, GET the session, modify the array, and POST it back.

class BetaManagedAgentsSessionMultiagentCoordinator:

Resolved coordinator topology with full agent definitions for each roster member.

List<Agent> agents

Full agent definitions the coordinator may spawn as session threads.

One of the following:
class BetaManagedAgentsSessionThreadAgent:

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.

class BetaManagedAgentsAdvisor:

Platform advisor roster entry: a model the session's primary thread may consult mid-turn.

String model

The advisor model id.

Type type
Type type
class BetaManagedAgentsSessionStats:

Timing statistics for a session.

Optional<Double> activeSeconds

Cumulative time in seconds the session spent in running status. Excludes idle time.

formatdouble
Optional<Double> durationSeconds

Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.

formatdouble
class BetaManagedAgentsSessionUpdatedEvent:

Emitted when an UpdateSession request changed at least one field. Carries only the fields that changed; absent fields were not part of the update. The new configuration applies from the next turn.

String id

Unique identifier for this event.

LocalDateTime processedAt

A timestamp in RFC 3339 format

formatdate-time
Type type

Resolved agent definition for a session. Snapshot of the agent at session creation time.

A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches max_list_cost.

BetaMonetaryAmount maxListCost

A monetary amount in a specific currency.

String amount

Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a number so no float rounding is ever applied.

BetaCurrency currency

Uppercase ISO-4217 currency code. USD is the only currency currently supported; the accepted set is closed and grows only when a new currency is priced.

Type type
Optional<Metadata> metadata

The session's full metadata bag after the update. Present when the update set non-empty metadata; absent when metadata was unchanged or cleared to empty.

Optional<String> title

The session's new title. Present only when the update changed it.

class BetaManagedAgentsSessionUsage:

Cumulative token usage for a session across all turns.

class BetaManagedAgentsSessionUsageEvent:

Periodic snapshot of the session's cumulative usage and tracked list cost.

String id

Unique identifier for this event.

LocalDateTime processedAt

A timestamp in RFC 3339 format

formatdate-time
Type type

Point-in-time snapshot of a session's cumulative usage.

A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches max_list_cost.

BetaMonetaryAmount maxListCost

A monetary amount in a specific currency.

String amount

Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a number so no float rounding is ever applied.

BetaCurrency currency

Uppercase ISO-4217 currency code. USD is the only currency currently supported; the accepted set is closed and grows only when a new currency is priced.

Type type
class BetaManagedAgentsStartEvent:

Opens a preview of a buffered event. Carries the previewed event's type and id only. Followed by zero or more event_delta events with the same event id, normally concluded by the buffered event carrying that id. If the producing model request ends without that event (an error or interrupt mid-stream), its terminal span.model_request_end closes the preview. Only sent on stream connections that opt in via event_deltas; never appears in event history.

The previewed event's type and id. The event type determines which delta types the preview's event_delta events carry: agent.message events stream content_delta fragments; agent.thinking previews are start-only — no deltas follow, and the buffered agent.thinking with the same id concludes them.

One of the following:
class BetaManagedAgentsAgentMessagePreview:
String id

The id the buffered agent.message will carry if it is emitted. Matches the event_id on this preview's event_delta events.

Type type
class BetaManagedAgentsAgentThinkingPreview:
String id

The id the buffered agent.thinking will carry if it is emitted. Start-only — no event_delta events follow.

Type type
Type type
class BetaManagedAgentsStartEventPreview: A class that can be one of several variants.union
class BetaManagedAgentsAgentMessagePreview:
String id

The id the buffered agent.message will carry if it is emitted. Matches the event_id on this preview's event_delta events.

Type type
class BetaManagedAgentsAgentThinkingPreview:
String id

The id the buffered agent.thinking will carry if it is emitted. Start-only — no event_delta events follow.

Type type
class BetaManagedAgentsSystemContentBlock:

Regular text content.

String text

The text content.

minLength1
Type type
class BetaManagedAgentsSystemMessageEvent:

A mid-conversation system message event. Carries system-role content that is appended to the session as a role: "system" turn.

String id

Unique identifier for this event.

System content blocks. Text-only.

String text

The text content.

minLength1
Type type
Type type
Optional<LocalDateTime> processedAt

A timestamp in RFC 3339 format

formatdate-time
class BetaManagedAgentsUserToolResultEvent:

Event sent by the client providing the result of an agent-toolset tool execution. Only valid on self_hosted environments, where sandbox-routed tools are executed by the client rather than the server.

SessionsEvents

List Events
EventListPage beta().sessions().events().list(EventListParamsparams = EventListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/v1/sessions/{session_id}/events
Send Events
BetaManagedAgentsSendSessionEvents beta().sessions().events().send(EventSendParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/v1/sessions/{session_id}/events
Stream Events
BetaManagedAgentsStreamSessionEvents beta().sessions().events().streamStreaming(EventStreamParamsparams = EventStreamParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/v1/sessions/{session_id}/events/stream

SessionsResources

Add Session Resource
BetaManagedAgentsFileResource beta().sessions().resources().add(ResourceAddParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/v1/sessions/{session_id}/resources
List Session Resources
ResourceListPage beta().sessions().resources().list(ResourceListParamsparams = ResourceListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/v1/sessions/{session_id}/resources
Get Session Resource
ResourceRetrieveResponse beta().sessions().resources().retrieve(ResourceRetrieveParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
GET/v1/sessions/{session_id}/resources/{resource_id}
Update Session Resource
ResourceUpdateResponse beta().sessions().resources().update(ResourceUpdateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/v1/sessions/{session_id}/resources/{resource_id}
Delete Session Resource
BetaManagedAgentsDeleteSessionResource beta().sessions().resources().delete(ResourceDeleteParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
DELETE/v1/sessions/{session_id}/resources/{resource_id}

SessionsThreads

List Session Threads
ThreadListPage beta().sessions().threads().list(ThreadListParamsparams = ThreadListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/v1/sessions/{session_id}/threads
Get Session Thread
BetaManagedAgentsSessionThread beta().sessions().threads().retrieve(ThreadRetrieveParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
GET/v1/sessions/{session_id}/threads/{thread_id}
Archive Session Thread
BetaManagedAgentsSessionThread beta().sessions().threads().archive(ThreadArchiveParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/v1/sessions/{session_id}/threads/{thread_id}/archive

SessionsThreadsEvents

List Session Thread Events
EventListPage beta().sessions().threads().events().list(EventListParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
GET/v1/sessions/{session_id}/threads/{thread_id}/events
Stream Session Thread Events
BetaManagedAgentsStreamSessionThreadEvents beta().sessions().threads().events().streamStreaming(EventStreamParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
GET/v1/sessions/{session_id}/threads/{thread_id}/stream