Skip to main content
CapOut supports two realtime transports:
  • WebSocket for long-lived interactive clients that may want to change subscriptions after connecting
  • SSE for simpler browser-friendly one-way event delivery
Both transports start with POST /ws/token.

1. Mint a realtime token

Example response:
If the response contains relative paths, resolve them against https://api.capout.ai or wss://api.capout.ai.

WebSocket example

SSE example

Scoping subscriptions

You can scope the initial stream in two ways:
  • Repeat document_id to follow specific documents
  • Send recent=10 to follow the latest organization-owned documents

Reconnect behavior

Handle disconnects with token expiry in mind:
  1. Detect closure or error.
  2. Mint a fresh realtime token.
  3. Re-open the connection with the same document scope.