Skip to content
中文

Stream Thread Events

Call Create session first and replace the example session ID with its returned ID.

GET/anthropic/v1/sessions/{session_id}/threads/{thread_id}/stream◐ Partial

Official Claude documentation ↗

Request parameters

  • session_idstringrequired

    path: Session ID (path or query parameter).

  • thread_idstringrequired

    path: Path parameter: the thread ID.

  • session_idstringrequired

    query: Session ID (path or query parameter).

  • event_deltasarrayoptional

    query: When set, the connection also receives streaming delta events.

Returns

200

Subscribes to the selected thread live ledger using the session SSE implementation; the /agent API also supports a read-only WebSocket. The parent stream includes child creation, status and message events. Child approvals carry session_thread_id; confirmations and interrupts targeting that id are routed to the owned child.

Errors follow the Claude Managed Agents format — see error codes

Request

curl
# Call Create session first and replace the example session ID with its returned ID.
curl https://api.deepraxis.com/anthropic/v1/sessions/sesn_123/threads/sthr_123/stream \
  -H "x-api-key: $PRAXIS_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "anthropic-beta: managed-agents-2026-04-01"
Python
# Call Create session first and replace the example session ID with its returned ID.
from anthropic import Anthropic

client = Anthropic(
    base_url="https://api.deepraxis.com/anthropic",
    api_key="$PRAXIS_API_KEY",
)

# 官方有、平台未支持:调用得到 501(not_implemented_error),无副作用。
result = client.beta.sessions.threads.events.stream("thread_123", {"session_id": "sample_id_123"})
print(result)
TypeScript
// Call Create session first and replace the example session ID with its returned ID.
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  baseURL: "https://api.deepraxis.com/anthropic",
  apiKey: "$PRAXIS_API_KEY",
});

// 官方有、平台未支持:调用得到 501(not_implemented_error),无副作用。
const result = await client.beta.sessions.threads.events.stream("thread_123", { session_id: "sample_id_123" });
console.log(result);

Response 200

: connected

event: user.message
data: {"id":"084bd36d-f355-45dc-a7ec-b028d0ea4074","type":"user.message","processed_at":null,"content":[{"type":"text","text":"你好"}]}

event: session.status_running
data: {"id":"9567a2c2-af68-4636-adc8-67880429d807","type":"session.status_running","processed_at":"2026-09-26T07:16:44.126Z"}

event: user.message
data: {"id":"084bd36d-f355-45dc-a7ec-b028d0ea4074","type":"user.message","processed_at":"2026-09-26T07:16:44.126Z","content":[{"type":"text","text":"你好"}]}

event: span.model_request_start
data: {"id":"mreq_bXNnX2NmZDAzMmQyLTVlN2UtNDc1Zi1hNzI2LWU0ZWM5ZWZjZWI0Zg","type":"span.model_request_start","processed_at":"2026-09-26T07:16:44.126Z"}

event: span.model_request_end
data: {"id":"3ee629ea-23ba-49aa-832e-d2cf5413d649","type":"span.model_request_end","processed_at":"2026-09-26T07:16:46.857Z","model_request_start_id":"mreq_bXNnX2NmZDAzMmQyLTVlN2UtNDc1Zi1hNzI2LWU0ZWM5ZWZjZWI0Zg","is_error":null,"model_usage":{"input_tokens":49,"output_tokens":108,"cache_read_input_tokens":0,"cache_creation_input_tokens":0}}

event: agent.message
data: {"id":"94cfee12-7475-4eff-a894-e60586f8f0b5","type":"agent.message","processed_at":"2026-09-26T07:16:46.857Z","content":[{"type":"text","text":"你好,请说。"}]}

event: session.usage
data: {"id":"fa3b85c4-8bdb-4649-b0fa-b81d35480ca2","type":"session.usage","processed_at":"2026-09-26T07:16:46.857Z","usage":{"input_tokens":85,"output_tokens":182,"cache_read_input_tokens":0}}

event: session.status_idle
data: {"id":"b0ab3970-2ece-44d9-abdb-756f2049bce3","type":"session.status_idle","processed_at":"2026-09-26T07:16:46.857Z","stop_reason":{"type":"end_turn"}}

Response

HTTP 200

Server-sent events

text/event-stream — chunk / event object

No field schema is declared.