Browse documentation

Messages

After session.ready, stream raw PCM as binary frames. Control messages are JSON text frames: finalize, stop, ping.

Client → Server

MessagePayloadDescription
session.finalize—Force the in-flight segment to close and emit its final.
session.stop—End the stream cleanly.
session.ping—Keepalive. Answered with session.pong.

Audio frames are raw pcm_s16le, 16 kHz, mono, up to 64 KB per frame. There is no frame header, no sequence number and no offset bookkeeping — send bytes in order and the server does the rest.

Server → Client

All server messages are JSON text frames with a type. sessionId is only on session.ready, not on every transcript or translation. segmentId is an opaque id; do not parse its prefix.

MessagePayloadDescription
session.readysessionId, audio, limits, store, regionThe stream is live. Start sending audio.
transcript.partialtext, language?, pending?, tail?, paragraphs?, tailTranslation?Preview snapshot. In sentence mode, paragraphs contains {speaker?, pieces: [{text, confirmed}], translation?} and tail/tailTranslation describe the unfinished sentence. pending is the flat fallback. Replace the snapshot; render aligned paragraph translations instead of aggregate translation.partial. Only transcript.final is permanent.
transcript.finalsegmentId, text, startMs?, endMs?, speaker?, language?A settled segment on the effective-audio clock.
translation.partialtext, sourceTextUnstable translation preview.
translation.finalsegmentId, text, sourceText, sourceLanguage, targetLanguage, enhanced?A settled translation. With aiEnhance on, the same segmentId is emitted a second time with enhanced: true.
digest.updatesections[]Rolling summary: { title, points[], confirmed }. Each push replaces the previous state.
usage.updateeffectiveSamples, discardedSamples, effectiveSeconds, discardedSeconds, priceCentsPerHour, accruedCents, collectedCents, uncollectedCents, balanceCentsEvery 15 seconds and at end.
session.errorcode, message, retryable, scopeA recoverable or fatal error.
session.endedreason, enhancement, storage, billingThe server closed the stream. Storage and enhancement each have their own status.
session.pong—Reply to session.ping.