Claude Platform Docs

Сеансы

Создать сеанс
$client->beta->sessions->create(Agent agent, string environmentID, ?BetaManagedAgentsBudgetLimit budget, ?list<InitialEvent> initialEvents, ?array<string,string> metadata, ?list<Resource> resources, ?string title, ?list<string> vaultIDs, ?list<AnthropicBeta> betas, ?string workspaceID): BetaManagedAgentsSession
POST/v1/sessions
Список сеансов
$client->beta->sessions->list(?string agentID, ?int agentVersion, ?\Datetime createdAtGt, ?\Datetime createdAtGte, ?\Datetime createdAtLt, ?\Datetime createdAtLte, ?string deploymentID, ?bool includeArchived, ?int limit, ?string memoryStoreID, ?Order order, ?string page, ?list<Status> statuses, ?list<AnthropicBeta> betas, ?string workspaceID): BidirectionalPageCursor<BetaManagedAgentsSession>
GET/v1/sessions
Получить сеанс
$client->beta->sessions->retrieve(string sessionID, ?list<AnthropicBeta> betas, ?string workspaceID): BetaManagedAgentsSession
GET/v1/sessions/{session_id}
Обновить сеанс
$client->beta->sessions->update(string sessionID, ?BetaManagedAgentsSessionAgentUpdate agent, ?BetaManagedAgentsBudgetLimit budget, ?array<string,string> metadata, ?string title, ?list<string> vaultIDs, ?list<AnthropicBeta> betas, ?string workspaceID): BetaManagedAgentsSession
POST/v1/sessions/{session_id}
Удалить сеанс
$client->beta->sessions->delete(string sessionID, ?list<AnthropicBeta> betas, ?string workspaceID): BetaManagedAgentsDeletedSession
DELETE/v1/sessions/{session_id}
Архивировать сеанс
$client->beta->sessions->archive(string sessionID, ?list<AnthropicBeta> betas, ?string workspaceID): BetaManagedAgentsSession
POST/v1/sessions/{session_id}/archive
Models
class BetaManagedAgentsAdvisorParams { $type; $model; }
Type type
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.

class BetaManagedAgentsAgentMessagePreview { $type; $id; }
Type type
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; }
Type type
string id

The agent ID.

?int version

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

class BetaManagedAgentsAgentThinkingPreview { $type; $id; }
Type type
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 */ }
Type type
string id

The agent ID.

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.

?Model model

Replacement model. Accepts the model string, e.g. claude-opus-5, or a model_config object. Omit to use the agent's model.

Replacement skill list. Full replacement: the provided array becomes the skills. Send an empty array to clear; omit to preserve the agent's skills.

?string system

Replacement system prompt. Up to 100,000 characters. Set to null to clear the agent's system prompt; omit to preserve it.

?list<Tool> tools

Replacement tool list. Full replacement: the provided array becomes the tool configuration. Send an empty array to clear; omit to preserve the agent's tools.

?int version

The specific agent version to use. Omit to use the latest version.

class BetaManagedAgentsBranchCheckout { $type; $name; }
Type type
string name

Branch name to check out.

class BetaManagedAgentsBudgetLimit { $type; $maxListCost; }
Type type
BetaMonetaryAmount maxListCost

A monetary amount in a specific currency.

class BetaManagedAgentsCacheCreationUsage { $ephemeral1hInputTokens; $ephemeral5mInputTokens; }
?int ephemeral1hInputTokens

Tokens used to create 1-hour ephemeral cache entries.

?int ephemeral5mInputTokens

Tokens used to create 5-minute ephemeral cache entries.

class BetaManagedAgentsCommitCheckout { $type; $sha; }
Type type
string sha

Full commit SHA to check out.

class BetaManagedAgentsDeletedSession { $type; $id; }
Type type
string id
class BetaManagedAgentsDeltaContent { $type; $content; $index; }
Type type

Regular text content.

?int 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.

class BetaManagedAgentsDeltaEvent { $type; $delta; $eventID; }
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.

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.

One of the following:
"agent.message"
"agent.thinking"
class BetaManagedAgentsFileResourceParams { $type; $fileID; $mountPath; }
Type type
string fileID

ID of a previously uploaded file.

?string mountPath

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

class BetaManagedAgentsGitHubRepositoryResourceParams { $type; $url; $authorizationToken; /* 2 more */ }
Type type
string url

Github URL of the repository

?string authorizationToken

GitHub authorization token used to clone the repository. Required for private repositories; optional for public ones.

?Checkout checkout

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

?string mountPath

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

class BetaManagedAgentsMemoryStoreResourceParam { $type; $memoryStoreID; $access; $instructions; }
Type type
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.

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

class BetaManagedAgentsMultiagent { $type; $agents; }
Type type
list<Agent> agents

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

class BetaManagedAgentsMultiagentParams { $type; $agents; }
Type type

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 { $type; $id; $version; }
Type type
string id

The agent ID.

?int version

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

Type type
class BetaManagedAgentsAdvisorParams { $type; $model; }
Type type
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.

class BetaManagedAgentsOutcomeEvaluationResource { $type; $completedAt; $description; /* 4 more */ }
Type type
?\Datetime completedAt

A timestamp in RFC 3339 format

string description

What the agent should produce.

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

int iteration

0-indexed revision cycle the outcome is currently on.

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.

class BetaManagedAgentsServerToolUsage { $webFetchRequests; $webSearchRequests; }
?int webFetchRequests

Number of server-executed web fetch requests.

?int webSearchRequests

Number of server-executed web search requests.

class BetaManagedAgentsSession { $type; $id; $agent; /* 14 more */ }
class BetaManagedAgentsSessionAgent { $type; $id; $description; /* 8 more */ }
Type type
string id
?string description

Model identifier and configuration.

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

string name
list<Skill> skills
?string system
list<Tool> tools
int version
class BetaManagedAgentsSessionAgentUpdate { $mcpServers; $tools; }

Replacement MCP server list. Full replacement: the provided array becomes the new value. Send an empty array to clear; omit to preserve.

?list<Tool> tools

Replacement tool list. Full replacement: the provided array becomes the new value. Send an empty array to clear; omit to preserve.

class BetaManagedAgentsSessionMultiagentCoordinator { $type; $agents; }
Type type
list<Agent> agents

Full agent definitions the coordinator may spawn as session threads.

class BetaManagedAgentsSessionStats { $activeSeconds; $durationSeconds; }
?float activeSeconds

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

?float durationSeconds

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

class BetaManagedAgentsSessionUpdatedEvent { $type; $id; $processedAt; /* 4 more */ }
Type type
string id

Unique identifier for this event.

\Datetime processedAt

A timestamp in RFC 3339 format

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.

?array<string,string> 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.

?string title

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

class BetaManagedAgentsSessionUsage { $activeSeconds; $cacheCreation; $cacheReadInputTokens; /* 4 more */ }
?float activeSeconds

Cumulative time in seconds during which the session had at least one thread in running status. Overlapping activity from concurrent threads is counted once, unlike stats.active_seconds, which sums each thread's own active time. This is the duration the session's runtime cost is priced on.

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

?int cacheReadInputTokens

Total tokens read from prompt cache.

?int inputTokens

Total input tokens consumed across all turns.

?BetaMonetaryAmount listCost

A monetary amount in a specific currency.

?int outputTokens

Total output tokens generated across all turns.

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

class BetaManagedAgentsSessionUsageEvent { $type; $id; $processedAt; /* 2 more */ }
Type type
string id

Unique identifier for this event.

\Datetime processedAt

A timestamp in RFC 3339 format

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.

class BetaManagedAgentsStartEvent { $type; $event; }
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; }
Type type
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; }
Type type
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; }
Type type
string text

The text content.

class BetaManagedAgentsSystemMessageEvent { $type; $id; $content; $processedAt; }
Type type
string id

Unique identifier for this event.

System content blocks. Text-only.

?\Datetime processedAt

A timestamp in RFC 3339 format

class BetaManagedAgentsUserToolResultEvent { $type; $id; $toolUseID; /* 4 more */ }
Type type
string id

Unique identifier for this event.

string toolUseID

The id of the agent.tool_use event this result corresponds to, which can be found in the last session.status_idle event's stop_reason.event_ids field.

?list<Content> content

The result content returned by the tool.

?bool isError

Whether the tool execution resulted in an error.

?\Datetime processedAt

A timestamp in RFC 3339 format

?string sessionThreadID

Set by the server to the subagent thread this result was routed to. Omitted when it was routed to the primary thread.

СеансыСобытия

Список событий
$client->beta->sessions->events->list(string sessionID, ?\Datetime createdAtGt, ?\Datetime createdAtGte, ?\Datetime createdAtLt, ?\Datetime createdAtLte, ?int limit, ?Order order, ?string page, ?list<string> types, ?list<AnthropicBeta> betas, ?string workspaceID): PageCursor<ManagedAgentsSessionEvent>
GET/v1/sessions/{session_id}/events
Отправить события
$client->beta->sessions->events->send(string sessionID, list<ManagedAgentsEventParams> events, ?list<AnthropicBeta> betas, ?string workspaceID): ManagedAgentsSendSessionEvents
POST/v1/sessions/{session_id}/events
Потоковая передача событий
$client->beta->sessions->events->stream(string sessionID, ?list<BetaManagedAgentsDeltaType> eventDeltas, ?list<AnthropicBeta> betas, ?string workspaceID): ManagedAgentsStreamSessionEvents
GET/v1/sessions/{session_id}/events/stream

СеансыРесурсы

Добавить ресурс сеанса
$client->beta->sessions->resources->add(string sessionID, string fileID, Type type, ?string mountPath, ?list<AnthropicBeta> betas, ?string workspaceID): ManagedAgentsFileResource
POST/v1/sessions/{session_id}/resources
Список ресурсов сеанса
$client->beta->sessions->resources->list(string sessionID, ?int limit, ?string page, ?list<AnthropicBeta> betas, ?string workspaceID): PageCursor<ManagedAgentsSessionResource>
GET/v1/sessions/{session_id}/resources
Получить ресурс сеанса
$client->beta->sessions->resources->retrieve(string resourceID, string sessionID, ?list<AnthropicBeta> betas, ?string workspaceID): ResourceGetResponse
GET/v1/sessions/{session_id}/resources/{resource_id}
Обновить ресурс сеанса
$client->beta->sessions->resources->update(string resourceID, string sessionID, string authorizationToken, ?list<AnthropicBeta> betas, ?string workspaceID): ResourceUpdateResponse
POST/v1/sessions/{session_id}/resources/{resource_id}
Удалить ресурс сеанса
$client->beta->sessions->resources->delete(string resourceID, string sessionID, ?list<AnthropicBeta> betas, ?string workspaceID): ManagedAgentsDeleteSessionResource
DELETE/v1/sessions/{session_id}/resources/{resource_id}

СеансыПотоки

Список потоков сеанса
$client->beta->sessions->threads->list(string sessionID, ?int limit, ?string page, ?list<AnthropicBeta> betas, ?string workspaceID): PageCursor<ManagedAgentsSessionThread>
GET/v1/sessions/{session_id}/threads
Получить поток сеанса
$client->beta->sessions->threads->retrieve(string threadID, string sessionID, ?list<AnthropicBeta> betas, ?string workspaceID): ManagedAgentsSessionThread
GET/v1/sessions/{session_id}/threads/{thread_id}
Архивировать поток сеанса
$client->beta->sessions->threads->archive(string threadID, string sessionID, ?list<AnthropicBeta> betas, ?string workspaceID): ManagedAgentsSessionThread
POST/v1/sessions/{session_id}/threads/{thread_id}/archive

СеансыПотокиСобытия

Список событий потока сеанса
$client->beta->sessions->threads->events->list(string threadID, string sessionID, ?int limit, ?string page, ?list<AnthropicBeta> betas, ?string workspaceID): PageCursor<ManagedAgentsSessionEvent>
GET/v1/sessions/{session_id}/threads/{thread_id}/events
Потоковая передача событий потока сеанса
$client->beta->sessions->threads->events->stream(string threadID, string sessionID, ?list<BetaManagedAgentsDeltaType> eventDeltas, ?list<AnthropicBeta> betas, ?string workspaceID): ManagedAgentsStreamSessionThreadEvents
GET/v1/sessions/{session_id}/threads/{thread_id}/stream