Skip to main content
Session creation returns three event URLs:
  • streamUrl for the live native event stream
  • turnStreamUrl for turn-oriented live delivery
  • replayUrl for durable event recovery
Use the live stream for responsive interfaces. Persist the latest sequence number and use the router replay endpoints after reconnecting.

Replay native events

cursor is exclusive: the response contains events with a sequence number greater than the cursor. afterSeq is an alias, and excludeEventTypes accepts a comma-separated list.

Replay completed messages

Use the stable message read model when you need conversation history rather than every native runtime event:
The response includes completed messages, their source sequence numbers, the native session ID, and the resumable session-file path. Both events and messages remain available after a session ends.

Reconnect safely

  1. Track the highest processed seq.
  2. Reconnect the live stream when possible.
  3. Replay from the stored cursor to fill any gap.
  4. De-duplicate by sequence number.
This keeps clients correct across network interruptions, sandbox idle stops, and process restarts.