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
GET /api/v1/beta/sessions/:id/events/list returns the same events as one JSON page. 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:

Notification feed

GET /api/v1/events/stream (allternit-api) is one SSE feed across all of the caller’s bots. Allternit Desktop uses it to raise native notifications while the window is hidden. It sends only events worth interrupting someone for, as event: notify with id: set to a ledger cursor:
kind is channel_message (a message reached a bot through a channel), missed_call (a call.ended marked missed, answered: false or reason missed/no_answer) needs_you (thread.needs_user, which includes an email held for approval) or inbox_changed (the owner dismissed, snoozed or approved an item in the Needs you inbox; clients refresh the list and never notify). It reads bot_events, so only the caller’s own bots appear and nothing is replayed on a fresh connection. Reconnect with Last-Event-ID (or ?after=) to resume. A keep-alive comment is sent every 20 seconds. The same classification decides which ledger rows go to the cloud event backbone. See Runtime events forwarder.