Inspect

Stream session events

Establish a WebSocket connection to receive real-time session events. This endpoint requires an `Upgrade: websocket` header and an API key passed as the `token` query parameter; the `Authorization` header is not used. Each server frame is a JSON text message with `type` and `payload`. Broadcast frames also carry a monotonically increasing `sequence`: - `agent`: a session event. `payload.type` names the event (for example `message.updated`, `message.part.updated` or `session.status`) and `payload.properties` carries its data. Message and part payloads use the shapes returned by GET /sessions/{session_id}/messages. - `replay_complete`: `payload` is `{ requestedAfter, sequence }`, sent after replaying missed frames. - `replay_unavailable`: `payload` is `{ requestedAfter, sequence, reason }`; refetch state over HTTP. - `sync_status`: `payload` is `{ requestId?, sequence }`. Events include assistant responses, tool calls, and other session activity.

Base URL
GET
/api/public/v1/sessions/{session_id}/events

Establish a WebSocket connection to receive real-time session events. This endpoint requires an Upgrade: websocket header and an API key passed as the token query parameter; the Authorization header is not used.

Each server frame is a JSON text message with type and payload. Broadcast frames also carry a monotonically increasing sequence:

  • agent: a session event. payload.type names the event (for example message.updated, message.part.updated or session.status) and payload.properties carries its data. Message and part payloads use the shapes returned by GET /sessions/{session_id}/messages.
  • replay_complete: payload is { requestedAfter, sequence }, sent after replaying missed frames.
  • replay_unavailable: payload is { requestedAfter, sequence, reason }; refetch state over HTTP.
  • sync_status: payload is { requestId?, sequence }.

Events include assistant responses, tool calls, and other session activity.

Path Parameters

session_id*string

The unique identifier of the session

Query Parameters

token*string

API key token used to authenticate the WebSocket connection

Header Parameters

upgrade*string

Must be websocket.

Response Body

Switching Protocols - WebSocket connection established

Example Request
curl -X GET 'https://your-org.inspect.com/api/public/v1/sessions/string/events?token=string' \  -H 'upgrade: string'
Example Response
Empty