Skip to main content
WSS
Real-time conversation analysis over WebSocket. Stream audio to the server and receive analysis events as they are produced: transcribed clips, the inferred conversation type, participant roles, behavior detections, topics, per-speaker topic sentiment, and a summary, plus optional conversation dynamics, LLM-judged assessments, and a per-speaker deepfake summary. The stream terminates with a final done event.

Endpoint

Authentication

Pass your API key as a query parameter when opening the connection.
Unlike the batch endpoint, the streaming API does not use an X-API-Key header. The key must be in the query string at connection time.
See Authentication and rate limits for how to obtain and manage API keys.

Connection parameters

Connection parameters carry only the API key and audio-format hints. All analysis configuration is sent in the config frame, not the query string.

Supported audio formats

Self-describing formats (auto-detected from file headers — no extra parameters needed): AAC, AIFF, FLAC, MP3, OGG, WAV, WebM
OGG / Opus: OGG is a container that may carry Opus-encoded audio. Pass audio_format=ogg, not audio_format=opus.
Raw / headerless formats (require audio_format, sample_rate, and num_channels): s8, s16le, s16be, s24le, s24be, s32le, s32be, u8, u16le, u16be, u24le, u24be, u32le, u32be, f32le, f32be, f64le, f64be, mulaw, alaw Valid sample rates: 8000, 11025, 16000, 22050, 32000, 44100, 48000, 96000

Configuration

After the connection opens, send exactly one text frame before any audio:
  • The literal string default to use the built-in default configuration, or
  • A JSON-encoded BatchConfig describing the conversation types, participant roles, behaviors, STT options, and which aggregate outputs (topics, sentiments, summary) to produce.
The BatchConfig schema is shared with the batch endpoint — see the Batch reference for the full field list. Behaviors may be referenced from the preset catalog with the preset:<identifier> syntax; list available presets with List behavior presets.
You must send the config frame before any audio. Sending a binary audio frame before the config frame is a protocol error and closes the connection with code 1003.

Streaming-specific keys

These keys select the events that are only emitted on request. All of them are shared with batch, which returns the same data as response fields instead of events.

Connection flow

  1. Connect to the WebSocket endpoint with api_key (and audio_format, sample_rate, num_channels for raw formats).
  2. Send one text frame: either the literal string default or a JSON-encoded BatchConfig.
  3. Stream audio as binary WebSocket frames. Frames can be any size.
  4. Receive analysis events as JSON text frames as results are produced.
  5. Send an empty text frame ("") to signal end of audio.
  6. Receive a final done event with the total audio duration.
  7. The connection closes automatically.

Server events

The server emits JSON text frames as results are produced. Every event carries a type discriminator. The payload objects (clip, conversation-type pick, participant-role pick, behavior detection, topic sentiment, speaker entries, conversation dynamics, assessments) use the same schemas the batch endpoint returns — see the Batch reference for full field definitions. The partial_clip, clip_update, and deepfake_summary payloads are streaming-only and documented below. On clean completion, the final conversation_dynamics event, the assessments event, and the final deepfake_summary event all precede done.

clip

A transcribed clip. Emitted progressively as speech is processed.
The emotion, accent, and deepfake_score fields are null unless the corresponding STT options are enabled in the config frame. audio_quality is always null on the clip event; when stt.audio_quality_signal is on, the measurement of the clip’s own audio arrives on its clip_update event. On a finalized clip, deepfake_score is the latest in-progress estimate, from 0 to 1, that the voice is synthetic. It is null when the clip is too short to score or the stream has no reading yet.
Worth knowing: a clip’s first deepfake_score is not necessarily its own. Until the clip has a reading, the field repeats the most recent reading from earlier in the stream, which can belong to a different speaker. The score for the whole clip arrives in a later clip_update. Act on that one.
deepfake carries the standalone and context deepfake readings, computed once from a reading of this clip’s own audio. It is null whenever the clip never had a reading of its own, even when deepfake_score shows a carried-forward value from elsewhere in the stream. It is not recomputed when a later clip_update refines deepfake_score.
Excerpt
standalone is read from this clip’s deepfake_score alone, with no context from other clips. context is informed by this speaker’s earlier clips: recency and clip duration weight the context, older clips decay, and strong contrary evidence flips the verdict within one clip. context is the value to display and act on. changed is true when the context verdict differs from this speaker’s previous scored clip. Readings are built separately per speaker_label; one speaker never affects another. verdict is synthetic or non-synthetic, and confidence ranges from 0 to 1.

partial_clip

An in-progress clip streamed while an utterance is still being spoken, before it finalizes. Multiple partials may be emitted for the same clip_uuid as the utterance grows; the eventual clip event for that utterance reuses the same clip_uuid, so a run of partials can be correlated with its final clip.
end_ms is the current end of the in-progress utterance and grows as the utterance extends; it is null until available. The finalized clip reports duration_ms instead of end_ms. speaker_label is null until diarization resolves the speaker. emotion and accent carry the latest in-progress values, or null when no value is available yet. deepfake_score carries the most recent reading in the stream until the clip has one of its own, so it is null only before the stream’s first reading.

clip_update

Refined values for a previously finalized clip; clip_update.clip_uuid matches the clip_uuid of an earlier clip event. A finalized clip may receive any number of clip_update events (including none), each emitted after that clip’s clip event — possibly interleaved with events for other clips — and always before the done event on clean completion. For each field present, the latest received value supersedes the value on the clip event and on any earlier clip_update for that clip.
deepfake_score on a clip_update is the score for the whole clip, from 0 to 1, and supersedes the in-progress value on the clip event. It is null when no reading is available, for example when the clip is too short or contains no scorable speech. audio_quality is the measurement of this clip’s own audio when stt.audio_quality_signal is on. It is null when the option is off, when the clip’s audio could not be measured, or when the stream’s analyzed-audio cap was already reached.

conversation_type

The conversation-type classification for the session.
selection_source is one of inferred, auto_selected_single_option, or default.

participant_role

A role assignment for one speaker. Emitted once per identified speaker.

behavior_detection

A per-behavior detection result. By default, emitted at most once per configured behavior and speaker. Set trigger_limit on the behavior to allow more than one detection per speaker. See Detecting a behavior more than once.

topics

The aggregated list of conversation topics. May be emitted more than once as the stream progresses; each event fully replaces the previous topics event, so always treat the latest as authoritative and never merge with earlier ones.

topic_sentiment

Per-speaker sentiment for one aggregated topic, keyed by topic and speaker. May be emitted more than once as the stream progresses; a later event supersedes an earlier one for the same topic and speaker.
sentiment_score ranges from -1.0 (most negative) to 1.0 (most positive).

summary

A free-form summary of the conversation. May be emitted more than once as the stream progresses; each event fully replaces the previous summary event, so always treat the latest as authoritative.

conversation_dynamics

The speaker entries and the conversation-level block over the transcript so far. Emitted after each finalized clip, and once more before done with the stream’s duration known. Each event fully replaces the previous one; treat the latest as authoritative. Only emitted when conversation_dynamics is true. Timing comes from transcript clip boundaries, not acoustic measurement. The role picks that mark a speaker as evaluated arrive over the stream, so that flag can change between events.
Each entry in speakers is one diarized speaker over the transcript so far. evaluated is true on the speaker the role picks identify as the party under evaluation: the one picked for a built-in representative role (customer service representative, support specialist, salesperson), with the most speech when several are. role is the name of the speaker’s participant role pick, or null without a pick. turn_count counts runs of the speaker’s consecutive clips with no other participant speaking in between. response_delay_ms and stop_delay_ms are distributions (p50, p90, max, count) in milliseconds, or null when nothing was measurable: response delay is measured over each of the speaker’s turns that follows another speaker’s turn of at least 400 ms, and stop delay over interruptions with measured overlap only. interruptions_made, interruptions_received, and interruption_ms count the entries in conversation_dynamics.interruptions that involve the speaker. audio_quality is the rollup over all of the speaker’s analyzed audio when stt.audio_quality_signal is on, with per-clip glitch and dropout events rolled up into counts, or null when none of the speaker’s audio has been measured. A speaker with under a tenth of the loudest speaker’s speech is listed but treated as a diarization fragment: its timing fields are null and it takes part in no interruption, so a single-speaker stream does not report turn-taking against a phantom. In conversation_dynamics, longest_silence_ms is the longest gap with nobody speaking: between speech spans of any speaker, before the first word, and in the final event after the last word to the end of the stream. It is 0 when speech leaves no gap and null when no speech is available. talk_over_count is the number of turns that overlapped another speaker’s speech and talk_over_ms the total overlap between the speech of each pair of speakers. interruptions and false_starts are in call order. The full field definitions are rendered on the Batch reference, which returns the same speakers and conversation_dynamics shapes.

interruption

One speaker cutting in on another. Emitted the first time the interruption is found and never again; later conversation_dynamics events keep listing it in interruptions. Only emitted when conversation_dynamics is true.
The event is located on the clip that cut in (clip_uuid, start_ms, end_ms) and names the clip it cut off (interrupted_clip_uuid). The interrupting clip lasts at least 300 ms. evidence is overlap when the two clips overlap in time. Otherwise it records how a turn boundary within 500 ms was read: cue for an opening interruption word, cut_off for visibly truncated preceding text, resume for the cut speaker picking up again right after a short interjection, and tight_handoff for the new speaker starting within 200 ms of the other finishing a sentence. A fast reply to a question, and a short acknowledgment on a tight hand-off alone, do not count. yield_ms (how long the interrupted speaker kept talking after the interruption began) and overlap_ms are measured for overlap events only and are null otherwise.

false_start

A speaker stopping mid-sentence and restarting within 2.5 s with nobody else speaking in between. Emitted the first time the false start is found and never again. Only emitted when conversation_dynamics is true.
clip_uuid is the restart and interrupted_clip_uuid the truncated clip. evidence is cut_off when the fragment visibly trails off, or restart when the restart opens with the fragment’s own first words. The cause is not visible in the transcript. A clip that restarts a false start is reported only as the false start, never as a repeat.

repeat

A clip whose text closely repeats one of the same speaker’s recent clips. Emitted the first time the repeat is found and never again. Only emitted when conversation_dynamics is true.
similarity ranges from 0 to 1.

assessment

One judged outcome for one clip of the requesting speaker, for one of the enabled assessment signals. Emitted when the pass that judged it completes. Passes run periodically over the clips that have enough following context, and once more at end of stream, so an event can arrive well after its clip. Non-applicable outcomes emit no event. Only emitted when the signal is true in assessments.
signal is requests, corrections, or interruption_recovery. speaker_label is the speaker whose request, correction, or interruption is assessed, and responder_speaker_label the speaker expected to respond: the one the role picks mark as evaluated in the conversation_dynamics speaker entries. clip_uuid is the requesting speaker’s clip the assessment is anchored to, and evidence_clip_uuids the clips the judgment cites. start_ms and end_ms span the cited evidence and are computed from clip boundaries; they are not response latency. evidence_strength is low, medium, or high.

assessments

Coverage of every enabled assessment over the whole stream. Emitted once, before done. Only emitted when at least one flag in assessments is true.
A signal is null when its flag was off, or when no responding and requesting speaker could be identified. turns_total is all of the requesting speaker’s clips with positive duration in the stream, and turns_assessed how many were assessed successfully, including non-applicable assessments. Each clip is assessed at most once per signal with neighboring context. Analysis is bounded: clips that were not assessed reduce turns_assessed and are not negatives, so empty events with incomplete coverage must not be interpreted as healthy. The events lists repeat what the assessment events already delivered.

deepfake_summary

Per-speaker deepfake assessment summary for the conversation so far. Only emitted when produce_deepfake_summary is true. With deepfake_summary_interval_seconds at 0 (the default), emitted once, immediately before done. With an interval of 5 to 300, emitted on that interval of wall clock from connection start, even with no change, so it can be treated as a heartbeat, plus one final, authoritative event immediately before done regardless of timing.
speakers has one entry per speaker with at least one scored clip; unscored clips are not counted. as_of_ms is the end time in the audio of the latest finalized clip, scored or not, so an unscored clip advances it even though it is excluded from speakers. It is 0 before any clip finalizes. Clip counts and durations are split by each clip’s context verdict. assessment.verdict is synthetic, non-synthetic, or mixed; it is mixed once the speaker has had both context verdicts, including a single flip that later reversed. assessment.confidence is the mean of context.confidence over the speaker’s counted clips.

done

Sent after all audio has been processed, in response to the end-of-stream signal.

error

Sent if processing fails. The connection closes after this event.

WebSocket close codes

An error JSON message is sent before the connection closes (except on 1000).

Rate limits

  • Concurrent connection limits apply per model.
  • Connections that exceed limits are rejected during the WebSocket handshake with close code 4030.
See Authentication and rate limits for retry guidance.

Examples

The examples below send a JSON BatchConfig as the config frame. To use the built-in defaults instead, send the literal string "default" in place of the JSON.
WebSocket APIs cannot be tested with cURL. For command-line testing, use websocat.
query
type:object
Clip
type:object

A transcribed clip with metadata.

Partial Clip
type:object

An in-progress clip streamed while an utterance is still being spoken, before it finalizes. Multiple partials may be emitted for the same clip_uuid as the utterance grows; the eventual clip event for that utterance reuses the same clip_uuid, so a run of partials can be correlated with its final clip.

Clip Update
type:object

Refined values for a previously finalized clip; clip_update.clip_uuid matches the clip_uuid of an earlier clip event. A finalized clip may receive any number of clip_update events (including none), each emitted after that clip's clip event (possibly interleaved with events for other clips) and always before the done event on clean completion. For each field present, the latest received value supersedes the value on the clip event and on any earlier clip_update for that clip. If refinement is unavailable for a clip, its previously available values are retained.

Conversation Type Pick
type:object

Inferred or default conversation-type pick for the session. May be updated as the conversation progresses; the latest pick replaces the previous one. When conversation_type_uuid changes, or the first type arrives after role events, discard all previous participant-role picks. Subsequent participant_role events establish the current assignments; a speaker may remain unassigned if no applicable role is available. Ending the audio does not force a final type or role reassessment; already pending updates may still arrive before done.

Participant Role Pick
type:object

Inferred or default participant-role pick for a speaker. A later event replaces the earlier pick for the same speaker_label. Role inference is reconsidered only after additional finalized speech from that speaker. Following a conversation-type change, a compatible earlier role may be carried forward in a new event without reassessment.

Behavior Detection
type:object

Positive detection for a behavior and speaker. By default (trigger_limit unset) a behavior is detected at most once per speaker (voice); each speaker is capped independently. Setting trigger_limit to a higher number, or explicitly to null for no limit, allows it to be detected more than once for that speaker - up to that many occurrences, or for every distinct occurrence found when unlimited. Detections may arrive after end of audio; continue reading until done to receive completed analysis. Emitted detections remain historical when conversation types or roles change. Updated classifications govern subsequent checks; previous detections are not withdrawn or re-emitted. Detections may arrive while an utterance is still in progress, after its partial_clip event, and before type or role picks are available.

Topics
type:object

Aggregated list of conversation topics. May be emitted more than once as the stream progresses; each event fully replaces the previous topics event, so always treat the latest as authoritative and never merge with earlier ones.

Topic Sentiment
type:object

Per-speaker sentiment for an aggregated topic, keyed by topic and speaker. May be emitted more than once as the stream progresses; a later event supersedes an earlier one for the same topic and speaker.

Summary
type:object

Free-form summary of the conversation. May be emitted more than once as the stream progresses; each event fully replaces the previous summary event, so always treat the latest as authoritative.

Deepfake Summary
type:object

Per-speaker deepfake assessment summary for the conversation so far, emitted only when produce_deepfake_summary is true. With deepfake_summary_interval_seconds at 0 (the default), emitted once, immediately before done. With an interval of 5 to 300, emitted on that interval of wall clock from connection start - even with no change, so it can be treated as a heartbeat - plus one final, authoritative event immediately before done regardless of timing.

Conversation Dynamics
type:object

The speaker entries and the conversation-level block over the transcript so far, emitted after each finalized clip and once more before done with the stream's duration known. Each event fully replaces the previous one; treat the latest as authoritative. Only emitted when conversation_dynamics is on. The role picks that mark a speaker as evaluated arrive over the stream, so that flag can change between events.

Interruption
type:object

One located interruption, emitted the first time it is found and never again; later conversation_dynamics events keep listing it. Only emitted when conversation_dynamics is on.

False Start
type:object

One located false start, emitted the first time it is found and never again. Only emitted when conversation_dynamics is on.

Repeat
type:object

One located repeated turn, emitted the first time it is found and never again. Only emitted when conversation_dynamics is on.

Assessment
type:object

One judged outcome for a clip of the requesting speaker, for one of the enabled assessment signals, emitted when the pass that judged it completes. Passes run periodically over the clips that have enough following context and once more at end of stream, so an event can arrive well after its clip. Non-applicable outcomes emit no event. Only emitted when the signal is on in assessments.

Assessments
type:object

Coverage of every enabled assessment over the whole stream, emitted once before done. Its events lists repeat what the assessment events already delivered. Only emitted when any assessment is on.

Error
type:object

An error occurred during processing.

Done
type:object

Streaming completed.

Stream Configuration

First text frame: either the literal string default (to use the built-in default configuration) or a JSON-encoded BatchConfig object. To set STT options such as custom_terms, include an stt key in the JSON-encoded BatchConfig.

Audio Data Chunk
type:string

Raw audio data chunk.

End of Audio Stream
type:string

Empty text frame signalling end of audio stream.