Reference

voice.startSession

Starts a live, interruptible voice session and returns it (prompts for the microphone).
voice.startSession(options?) → Promise<VoiceSession>

Prompts for microphone permission, mints a session from the platform, connects to the realtime room, and publishes the mic. The returned session is where the whole conversation lives, its events and its controls. It throws microphone_denied on refusal, voice_concurrency_limit or voice_visitor_limit at the app's session caps, and auth_required or role_required when the interface's auth block denies the caller, which is the cue to route to sign-in.

Parameters
options
{ signal? }
Optional. An AbortSignal to cancel the connection attempt (the promise rejects with AbortError).
Open a session and wire the UI
const session = await voice.startSession();
session.on('stateChange', (s) => setOrbState(s)); // connecting | listening | thinking | speaking | ended
session.on('transcript', ({ role, segmentId, text, final }) => upsertCaption(segmentId, role, text, final));
session.on('toolCall', ({ method, status, result }) => showActivity(method, status));