Claude Platform Docs

Sesi

Buat Sesi
BetaManagedAgentsSession Beta.Sessions.Create(parameters, cancellationToken = default)
POST/v1/sessions
Daftar Sesi
SessionListPage Beta.Sessions.List(parameters, cancellationToken = default)
GET/v1/sessions
Dapatkan Sesi
BetaManagedAgentsSession Beta.Sessions.Retrieve(parameters, cancellationToken = default)
GET/v1/sessions/{session_id}
Perbarui Sesi
BetaManagedAgentsSession Beta.Sessions.Update(parameters, cancellationToken = default)
POST/v1/sessions/{session_id}
Hapus Sesi
BetaManagedAgentsDeletedSession Beta.Sessions.Delete(parameters, cancellationToken = default)
DELETE/v1/sessions/{session_id}
Arsipkan Sesi
BetaManagedAgentsSession Beta.Sessions.Archive(parameters, cancellationToken = default)
POST/v1/sessions/{session_id}/archive
Models
class BetaManagedAgentsAdvisorParams { Type; Model; }

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.

required Type Type
required 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
class BetaManagedAgentsAgentMessagePreview { Type; ID; }
required Type Type
required 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.

class BetaManagedAgentsAgentParams { Type; ID; Version; }

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

required Type Type
required string ID

The agent ID.

minLength1
maxLength128
int Version

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

formatint32
class BetaManagedAgentsAgentThinkingPreview { Type; ID; }
required Type Type
required string ID

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

class BetaManagedAgentsAgentWithOverridesParams { Type; ID; McpServers; /* 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.

class BetaManagedAgentsBranchCheckout { Type; Name; }
required Type Type
required string Name

Branch name to check out.

minLength1
maxLength255
class BetaManagedAgentsBudgetLimit { Type; MaxListCost; }

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

required Type Type
required BetaMonetaryAmount MaxListCost

A monetary amount in a specific currency.

required 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.

required 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.

class BetaManagedAgentsCacheCreationUsage { Ephemeral1hInputTokens; Ephemeral5mInputTokens; }

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

int Ephemeral1hInputTokens

Tokens used to create 1-hour ephemeral cache entries.

formatint32
int Ephemeral5mInputTokens

Tokens used to create 5-minute ephemeral cache entries.

formatint32
class BetaManagedAgentsCommitCheckout { Type; Sha; }
required Type Type
required string Sha

Full commit SHA to check out.

minLength7
maxLength64
class BetaManagedAgentsDeletedSession { Type; ID; }

Confirmation that a session has been permanently deleted.

required Type Type
required string ID
class BetaManagedAgentsDeltaContent { Type; Content; Index; }
required Type Type
required BetaManagedAgentsTextBlock Content

Regular text content.

required Type Type
required string Text

The text content.

minLength1
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 { Type; Delta; EventID; }

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.

required Type Type

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.

required Type Type
required BetaManagedAgentsTextBlock Content

Regular text content.

required Type Type
required string Text

The text content.

minLength1
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
required 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.

enum BetaManagedAgentsDeltaType

EventDeltaType enum

AgentMessage("agent.message")
AgentThinking("agent.thinking")
class BetaManagedAgentsFileResourceParams { Type; FileID; MountPath; }

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

required Type Type
required string FileID

ID of a previously uploaded file.

minLength1
maxLength128
string? MountPath

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

minLength1
maxLength4096
class BetaManagedAgentsGitHubRepositoryResourceParams { Type; Url; AuthorizationToken; /* 2 more */ }

Mount a GitHub repository into the session's container.

class BetaManagedAgentsMemoryStoreResourceParam { Type; MemoryStoreID; Access; Instructions; }

Parameters for attaching a memory store to an agent session.

required Type Type
required string MemoryStoreID

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

Access? Access

Access mode for an attached memory store.

One of the following:
ReadWrite("read_write")
ReadOnly("read_only")
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 { Type; Agents; }

Resolved coordinator topology with a concrete agent roster.

required Type Type
required IReadOnlyList<Agent> Agents

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

One of the following:
class BetaManagedAgentsAgentReference { Type; ID; Version; }

A resolved agent reference with a concrete version.

required Type Type
required string ID
required int Version
formatint32
class BetaManagedAgentsAdvisor { Type; Model; }

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

required Type Type
required string Model

The advisor model id.

class BetaManagedAgentsMultiagentParams { Type; Agents; }

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

class BetaManagedAgentsMultiagentRosterEntryParams: union

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

string
class BetaManagedAgentsAgentParams { Type; ID; Version; }

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

required Type Type
required string ID

The agent ID.

minLength1
maxLength128
int Version

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

formatint32
class BetaManagedAgentsMultiagentSelfParams { Type; }

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

required Type Type
class BetaManagedAgentsAdvisorParams { Type; Model; }

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.

required Type Type
required 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
class BetaManagedAgentsOutcomeEvaluationResource { Type; CompletedAt; Description; /* 4 more */ }

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

required Type Type
required DateTimeOffset? CompletedAt

A timestamp in RFC 3339 format

formatdate-time
required string Description

What the agent should produce.

required 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.

required int Iteration

0-indexed revision cycle the outcome is currently on.

formatint32
required string OutcomeID

Server-generated outc_ ID for this outcome.

required 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.

class BetaManagedAgentsServerToolUsage { WebFetchRequests; WebSearchRequests; }

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

int WebFetchRequests

Number of server-executed web fetch requests.

formatint32
int WebSearchRequests

Number of server-executed web search requests.

formatint32
class BetaManagedAgentsSession { Type; ID; Agent; /* 14 more */ }

A Managed Agents session.

class BetaManagedAgentsSessionAgent { Type; ID; Description; /* 8 more */ }

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

class BetaManagedAgentsSessionAgentUpdate { McpServers; Tools; }

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 { Type; Agents; }

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

required Type Type
required IReadOnlyList<Agent> Agents

Full agent definitions the coordinator may spawn as session threads.

One of the following:
class BetaManagedAgentsSessionThreadAgent { Type; ID; Description; /* 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.

class BetaManagedAgentsAdvisor { Type; Model; }

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

required Type Type
required string Model

The advisor model id.

class BetaManagedAgentsSessionStats { ActiveSeconds; DurationSeconds; }

Timing statistics for a session.

double ActiveSeconds

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

formatdouble
double DurationSeconds

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

formatdouble
class BetaManagedAgentsSessionUpdatedEvent { Type; ID; ProcessedAt; /* 4 more */ }

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.

class BetaManagedAgentsSessionUsage { ActiveSeconds; CacheCreation; CacheReadInputTokens; /* 4 more */ }

Cumulative token usage for a session across all turns.

class BetaManagedAgentsSessionUsageEvent { Type; ID; ProcessedAt; /* 2 more */ }

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

required Type Type
required string ID

Unique identifier for this event.

required DateTimeOffset ProcessedAt

A timestamp in RFC 3339 format

formatdate-time

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.

required Type Type
required BetaMonetaryAmount MaxListCost

A monetary amount in a specific currency.

required 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.

required 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.

class BetaManagedAgentsStartEvent { Type; Event; }

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.

required Type Type

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 { Type; ID; }
required Type Type
required 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.

class BetaManagedAgentsAgentThinkingPreview { Type; ID; }
required Type Type
required string ID

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

class BetaManagedAgentsStartEventPreview: union
class BetaManagedAgentsAgentMessagePreview { Type; ID; }
required Type Type
required 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.

class BetaManagedAgentsAgentThinkingPreview { Type; ID; }
required Type Type
required string ID

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

class BetaManagedAgentsSystemContentBlock { Type; Text; }

Regular text content.

required Type Type
required string Text

The text content.

minLength1
class BetaManagedAgentsSystemMessageEvent { Type; ID; Content; ProcessedAt; }

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

required Type Type
required string ID

Unique identifier for this event.

required IReadOnlyList<BetaManagedAgentsSystemContentBlock> Content

System content blocks. Text-only.

required Type Type
required string Text

The text content.

minLength1
DateTimeOffset? ProcessedAt

A timestamp in RFC 3339 format

formatdate-time
class BetaManagedAgentsUserToolResultEvent { Type; ID; ToolUseID; /* 4 more */ }

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.

SesiEvent

Daftar Event
EventListPage Beta.Sessions.Events.List(parameters, cancellationToken = default)
GET/v1/sessions/{session_id}/events
Kirim Event
BetaManagedAgentsSendSessionEvents Beta.Sessions.Events.Send(parameters, cancellationToken = default)
POST/v1/sessions/{session_id}/events
Stream Event
BetaManagedAgentsStreamSessionEvents Beta.Sessions.Events.StreamStreaming(parameters, cancellationToken = default)
GET/v1/sessions/{session_id}/events/stream

SesiResource

Tambah Resource Sesi
BetaManagedAgentsFileResource Beta.Sessions.Resources.Add(parameters, cancellationToken = default)
POST/v1/sessions/{session_id}/resources
Daftar Resource Sesi
ResourceListPage Beta.Sessions.Resources.List(parameters, cancellationToken = default)
GET/v1/sessions/{session_id}/resources
Dapatkan Resource Sesi
ResourceRetrieveResponse Beta.Sessions.Resources.Retrieve(parameters, cancellationToken = default)
GET/v1/sessions/{session_id}/resources/{resource_id}
Perbarui Resource Sesi
ResourceUpdateResponse Beta.Sessions.Resources.Update(parameters, cancellationToken = default)
POST/v1/sessions/{session_id}/resources/{resource_id}
Hapus Resource Sesi
BetaManagedAgentsDeleteSessionResource Beta.Sessions.Resources.Delete(parameters, cancellationToken = default)
DELETE/v1/sessions/{session_id}/resources/{resource_id}

SesiThread

Daftar Thread Sesi
ThreadListPage Beta.Sessions.Threads.List(parameters, cancellationToken = default)
GET/v1/sessions/{session_id}/threads
Dapatkan Thread Sesi
BetaManagedAgentsSessionThread Beta.Sessions.Threads.Retrieve(parameters, cancellationToken = default)
GET/v1/sessions/{session_id}/threads/{thread_id}
Arsipkan Thread Sesi
BetaManagedAgentsSessionThread Beta.Sessions.Threads.Archive(parameters, cancellationToken = default)
POST/v1/sessions/{session_id}/threads/{thread_id}/archive

SesiThreadEvent

Daftar Event Thread Sesi
EventListPage Beta.Sessions.Threads.Events.List(parameters, cancellationToken = default)
GET/v1/sessions/{session_id}/threads/{thread_id}/events
Stream Event Thread Sesi
BetaManagedAgentsStreamSessionThreadEvents Beta.Sessions.Threads.Events.StreamStreaming(parameters, cancellationToken = default)
GET/v1/sessions/{session_id}/threads/{thread_id}/stream