Skip to main content
The SDK exposes utilities and types for parsing SSE output from /api/v1/chat when Accept: text/event-stream is set.

Parser

parseSSEStream yields typed events as they arrive.

Event union

SSEStreamEvent includes:
  • telemetry
  • result
  • error
  • stream_end
The SDK also exports:
  • TelemetryStreamEvent
  • ResultStreamEvent
  • ErrorStreamEvent
  • SSEStreamEndEvent

Example

Streaming errors

  • SSEParse
  • StreamingHttpError
  • StreamingResponseBodyNull
  • StreamingServerError

Typical lifecycle

  1. telemetry events (including connected and optional text_delta)
  2. result
  3. stream_end
  4. error appears when the stream fails
/api/v1/chat/stream may still be available in compatibility deployments, but /api/v1/chat is the canonical SDK target.

See also