Skip to content

Documentation

Developers

WebSockets and Streaming

Stream a run, cancel it, and resume it after a reload.

Interactive chat uses one WebSocket per tab at /api/v3/chat/ws. The socket carries many runs. Every client frame that acts on a session includes solomon_consumer_key, or an embed token. REST and server-sent events are the alternatives when you do not need a socket. Idle HTTP streams are not the path for interactive work.

Client frames

  • chat_message starts a run. It carries agent_id, session_id, message and/or attachments, and optionally context, active_workspace_id, and timezone.
  • cancel, also accepted as stop, stops the active run. Only the person who started it may send this. Anyone else receives stop_refused.
  • resume_run reconnects after a reload or from another tab. The server answers with run_status, replays the run's frames, and then continues live.
  • subscribe_session and unsubscribe_session receive session_updated when something else writes to the session: another tab, a schedule, an event, or a channel.
  • ping is answered with pong.

Server frames

Lifecycle frames are run_started, run_status, status, heartbeat, cancelled, stop_refused, error, and done. done is always last. A heartbeat arrives after 15 seconds of silence and names the active tool. RUN_ALREADY_ACTIVE means a run is already in progress. PERMISSION_DENIED means the caller cannot write in that session.

Content frames include text_delta, reasoning_delta, citation, and user_message. Tool frames include tool_call, tool_call_delta, tool_progress, tool_output, file_search_result, and ui_card. Artifacts arrive as image_generated, video_generated, video_job, attachment_generated, and document_updated. Delegation uses handoff, subagent_started, and subagent_completed. Accounting and safety use usage, guardrail_triggered, and warning.

File attachments are sent on the WebSocket. REST and server-sent events drop them. Frames emitted while the socket is disconnected stay with the run until you resume it.

Voice has its own sockets: /api/v3/voice/ws for the browser and /api/v3/voice/twilio/stream for phone audio. Meeting events arrive on the meetings socket. Those sockets are separate from the chat socket.