Cosmo Realtime SDK
Concepts

Concepts

The realtime model behind every SDK — how a session works, what flows through it, and what happens when something goes wrong.

These pages explain the model; they don't walk you through using it. If you haven't run a session yet, do a quickstart first — the concepts land better with one behind you.

The session model

What a session is and what it runs on.

  • Sessions — the HTTP handshake, the LiveKit room, and the control plane.
  • Clients, agents, and sessions — the three-tier model: credential, reusable persona, one live run.
  • Lifecycle — the event sequence from start to end, in six phases.
  • Transport — how audio, control messages, and the handshake flow between client and server.

The conversation

What moves through a live session.

  • Realtime events — every message on the data channel, grouped by direction and family.
  • Audio — mic capture, agent playback, echo cancellation, and gating modes.
  • Turn-taking — voice activity detection, barge-in, and silence handling.
  • Transcripts — what was spoken vs what the model emitted, and which to subscribe to.

When things change or break

  • Errors — the full error-code table and how to recover from each.
  • Protocol version — how wire-protocol breaking changes are signaled.

On this page