Stream AI assistant responses for a widget session via Server-Sent Events.
Authorization: Bearer <sessionToken> or X-Widget-Token header).
Content-Type: text/event-stream. The connection stays open for the lifetime of the session. Reconnect with the same session token if disconnected.Bearer <sessionToken>. Obtain from Create widget session.| Event type | Description |
|---|---|
message.start | Assistant has started generating a response |
message.delta | Incremental token chunk from the assistant response |
message.complete | Full response assembled — includes final text |
message.error | Assistant error (retry or report to support) |
session.expiry_warning | Session expires in 15 minutes |
ping | Keepalive heartbeat every 30 seconds |
event: / data: format:
Last-Event-ID header with the last received event ID. The server resumes from the next event.