Claude Platform Docs

Threads

List Session Threads
$client->beta->sessions->threads->list(string sessionID, ?int limit, ?string page, ?list<AnthropicBeta> betas, ?string workspaceID): PageCursor<ManagedAgentsSessionThread>
GET/v1/sessions/{session_id}/threads
Get Session Thread
$client->beta->sessions->threads->retrieve(string threadID, string sessionID, ?list<AnthropicBeta> betas, ?string workspaceID): ManagedAgentsSessionThread
GET/v1/sessions/{session_id}/threads/{thread_id}
Archive Session Thread
$client->beta->sessions->threads->archive(string threadID, string sessionID, ?list<AnthropicBeta> betas, ?string workspaceID): ManagedAgentsSessionThread
POST/v1/sessions/{session_id}/threads/{thread_id}/archive
Models
class ManagedAgentsSessionThread { $type; $id; $agent; /* 8 more */ }
Type type
string id

Unique identifier for this thread.

Agent agent

Resolved agent definition for this thread. Snapshot of the agent at thread creation time.

?\Datetime archivedAt

When the thread was archived. Null if not archived.

\Datetime createdAt

When the thread was created.

?string parentThreadID

Parent thread that spawned this thread. Null for the primary thread.

string sessionID

The session this thread belongs to.

Timing statistics for this thread. Null until the thread's first status transition.

Current execution status of the thread.

\Datetime updatedAt

When the thread was last updated.

Cumulative token usage for this thread. Null until the thread's first idle transition.

class ManagedAgentsSessionThreadStats { $activeSeconds; $durationSeconds; $startupSeconds; }
?float activeSeconds

Cumulative time in seconds the thread spent actively running. Excludes idle time.

?float durationSeconds

Elapsed time since thread creation in seconds. For archived threads, frozen at the final update.

?float startupSeconds

Time in seconds for the thread to begin running. Zero for child threads, which start immediately.

One of the following:
"running"
"idle"
"rescheduling"
"terminated"
class ManagedAgentsSessionThreadUsage { $activeSeconds; $cacheCreation; $cacheReadInputTokens; /* 4 more */ }
?float activeSeconds

Cumulative time in seconds this thread spent in running status. Equal to stats.active_seconds; surfaced here so a thread's usage carries every quantity its cost is priced on.

Tokens used to create prompt cache entries, broken down by cache TTL.

?int cacheReadInputTokens

Total tokens read from prompt cache.

?int inputTokens

Total input tokens consumed across all turns.

?BetaMonetaryAmount listCost

Cumulative list cost of this thread across all turns, priced at public list rates. Absent until cost tracking is available for the thread. Each figure is rounded to the nearest cent independently and the session's aggregate usage.list_cost additionally includes session runtime, so per-thread costs do not sum exactly to the session figure; the session figure is authoritative and is what a budget is enforced against.

?int outputTokens

Total output tokens generated across all turns.

Cumulative server-executed tool usage across all turns of this thread. Absent until server-tool tracking is available for the thread.

One of the following:

ThreadsEvents

List Session Thread Events
$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
Stream Session Thread 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