Skip to main content
GET
Stream events
Delivered over Server-Sent Events (text/event-stream) — browser-friendly (EventSource, httpx-sse, …). For scripts or agent loops, GET /messages/{id}/chunk (long-poll) is easier. The stream emits four event types, then closes:
  • message.delta — the next piece of the reply’s text
  • message.tool_use / message.tool_result — a tool started / finished (shown per the stream’s tool_visibility, see below)
  • message.completed / message.failed — the reply is done; the server then closes the stream
It’s text/event-stream, not JSON — don’t parse it as JSON, and curl will appear to “hang” (a healthy open connection). No Last-Event-ID resume yet; reconnect with a fresh subscription.

Controlling what the stream shows

By default the stream reports tool names (tool_visibility=names_only) and hides the agent’s reasoning (thinking_visibility=none). Append query params to change that for a subscription:
  • ?tool_visibility=none|names_only|full — hide tool activity, show tool names only, or show full tool inputs and results.
  • ?thinking_visibility=none|summary|full — hide the agent’s reasoning, summarize it, or stream it in full.
File references the agent produces are emitted regardless of tool_visibility, so you never miss a result by turning tools down.

Authorizations

Authorization
string
header
required

Requires an API key. See the Authentication guide.

Path Parameters

message_id
string
required

Response

200 - text/event-stream

SSE stream open (text/event-stream). Server emits message.delta, message.tool_use, message.tool_result, then message.completed or message.failed and closes.