Event Stream

Allternit exposes two real-time channels for observing beta session events:
  • Server-Sent Events (SSE) at GET /api/v1/beta/sessions/:id/events
  • WebSocket at GET /api/v1/beta/sessions/:id/events/ws
Both streams emit the same underlying events. Use SSE for simple one-way observation. Use WebSockets when you need bidirectional communication, such as closing the connection from the client side or sending an interrupt through a separate HTTP call.

Authentication

Both endpoints require a valid bearer token. See Authentication.

Event types

Only thinking_delta, content_block_delta, tool_calls, and refusal may be appended directly by callers. All other event types are emitted by the platform.

SSE example

Add ?after=<sequence> to resume from a known sequence number.

Stream format

WebSocket example

Each message is a JSON object: