Low-latency English speech-to-text over WebSocket. Emits rolling partial transcripts during streaming, with optional utterance segmentation at pauses (endpointing), optional speaker labels (diarize), and optional word timings (time_stamps). No other enrichments.
WSS
/
api
/
velma-2-stt-streaming-english-v2
Low-latency English speech-to-text over WebSocket. Emits a rolling partial transcript every ~1.5 seconds while audio streams in, then delivers one complete final transcript at end-of-stream — or, with endpointing enabled, a final transcript for each utterance as the speaker pauses. With diarize=true, each final utterance also carries a speaker label, and with time_stamps=true, the timing of every word. No emotion detection, accent detection, or PII/PHI tagging.
The MP4-family values (mp4, m4a, m4b, m4r, m4v, 3gp, 3gpp, 3ga, 3g2, f4a, f4b) must be sent in a streamable layout; otherwise the connection ends with an audio-processing error.Opus audio is accepted either as opus or, for Opus-in-Ogg streams, as ogg.Raw PCM formats — sample_rate and num_channels are required:s8, s16le, s16be, s24le, s24be, s32le, s32be, u8, u16le, u16be, u24le, u24be, u32le, u32be, f32le, f32be, f64le, f64be, mulaw, alaw, g722, voxg722 and vox are mono-only: num_channels must be 1.Valid sample rates: 8000, 11025, 16000, 22050, 32000, 44100, 48000, 96000For lowest end-to-end latency, send audio_format=s16le&sample_rate=16000&num_channels=1. This matches the model’s native input format and bypasses the server’s audio decoder entirely.
Query parameters
Parameter
Required
Description
api_key
Yes
Your API key
audio_format
Yes
Container or raw PCM format of the audio you will stream. See supported formats above.
sample_rate
Raw PCM only
Source sample rate in Hz. Required when audio_format is a raw PCM type; ignored for container formats.
num_channels
Raw PCM only
Number of audio channels (1–8). Required when audio_format is a raw PCM type; ignored for container formats. The server downmixes to mono internally.
endpointing
No
true or false (default false). When true, speech is segmented into utterances at pauses — see Utterance segmentation. Any other value is rejected with close code 1003.
diarize
No
true or false (default false). When true, each final utterance carries speaker fields — see Speaker labels. Any other value is rejected with close code 1003.
time_stamps
No
true or false (default false). When true, each final utterance carries words — see Word timings.
endpointing, diarize, and time_stamps are independent; every combination is valid.This endpoint accepts no other enrichment toggles. Emotion, accent, and PII parameters are not recognized and have no effect. Use STT Streaming if you need those.
Utterance segmentation (endpointing)
By default, the connection produces one final utterance at end-of-stream covering everything you sent, and each partial_utterance reflects the whole stream so far.With endpointing=true, speech is segmented at pauses:
Each partial_utterance contains the complete transcript of the current segment so far (still replace, never append).
Each time a pause ends a segment, you immediately receive a final utterance for it — final text arrives shortly after the speaker stops, instead of at end-of-stream. Each final carries start_ms and duration_ms for its speech.
The full transcript is the concatenation of the final utterance texts, in order.
Every connection still ends with at least one final utterance (a stream containing no speech yields one with empty text), followed by done.
Use endpointing for live conversations — voice agents, assistants, meeting captions — where you want final text per utterance as it happens. Leave it off for whole-recording transcription where one final transcript is simpler to consume.
Speaker labels
Set diarize=true to label which speaker produced each utterance. Labels are attached to final utterance messages only, never to partial_utterance.speaker is a zero-based index, stable for the lifetime of one connection and meaningless outside it. The same person on a new connection may receive a different index, so the value identifies a speaker within a conversation and is not an identity that can be matched across connections or sessions.A label is assigned when an utterance is finalized and is never revised. There is no back-patching, so an early utterance keeps whatever label it was given.speaker is null when diarization was requested but no speaker could be determined for that utterance, which happens on very short or silent segments and on a brand-new voice that has not yet accumulated enough evidence. That is distinct from the field being absent, which means diarize=true was not requested.
Speaker capacity
Up to ten distinct speakers are labeled per connection. Past that, further speakers are merged into existing labels rather than reported separately: their speech is still transcribed, but speaker is wrong for some utterances.
Worth knowing:speakers_capped is the only signal that this happened. Nothing in the transcript or in speaker itself indicates a merged speaker, so a client acting on speaker identity should check speakers_capped alongside n_speakers.
Utterances that span a speaker change
Segments are cut at pauses regardless of diarize. An utterance that spans a fast exchange with no pause between turns carries the speaker who produced most of it, and speaker_purity reports what proportion that was. 1.0 means the utterance was cleanly single-speaker; a lower value means the single label describes only the majority of it.
With endpointing off
diarize=true&endpointing=false produces one final utterance for the whole stream, so a single speaker cannot describe it. Read n_speakers in that mode and treat speaker as indicative only.
Word timings
Set time_stamps=true to receive the timing of every word. Each final utterance then carries words: the words of its text, in order, each with word, start_ms, and duration_ms. Partials never carry it.start_ms is milliseconds from the start of the stream, the same clock as the utterance’s start_ms. Both values are approximate. Joined with single spaces, the word values spell text exactly, punctuation included.
Worth knowing:words can be missing from an utterance even with time_stamps=true. It is omitted when that utterance’s word timings are unavailable, with no marker in its place, so check for the key rather than assuming it.
Worth knowing: the word shape differs from Multilingual Fast Transcription (streaming), which reports end_ms per word rather than duration_ms. A client that handles both endpoints needs to read each one’s shape.
Connection flow
Connect to the WebSocket endpoint with api_key, audio_format, (for raw PCM) sample_rate and num_channels, and optionally endpointing, diarize, and time_stamps.
Stream audio as binary WebSocket frames. Frames can be any size; 4–64 KB is typical.
Receive partial_utterance JSON messages every ~1.5 seconds. Each contains the complete transcript of its scope so far — replace any previously displayed partial, do not append.
With endpointing=true, receive a final utterance message each time a pause ends a segment.
Send an empty text frame ("") to signal end of audio.
Receive the final utterance for any content not already finalized at a pause (the whole stream with endpointing off; skipped when the last segment was already finalized mid-stream).
Receive a done message with total audio duration.
The connection closes automatically.
Server messages
partial_utterance
Sent roughly every 1.5 seconds while audio is streaming. Each message contains the complete transcript built so far for the current scope — the whole connection by default, or the current speech segment when endpointing=true. It is not a delta from the previous message: replace your displayed partial text with each new value — never append.
{ "type": "partial_utterance", "partial_utterance": { "text": "Hello, how are you", "is_final": false }}
Field
Type
Description
type
string
Always "partial_utterance"
partial_utterance.text
string
Complete transcript so far. Replace, don’t append.
partial_utterance.is_final
boolean
Always false
Partials never carry speaker labels, even with diarize=true. Speaker fields appear on final utterance messages only.
utterance
The final transcript for one utterance. Will not be revised. With endpointing off, sent exactly once at end-of-stream, covering the entire audio stream. With endpointing=true, sent each time a pause ends a segment; the full transcript is the concatenation of every utterance text in order.
{ "type": "utterance", "utterance": { "text": "Hello, how are you doing today?", "is_final": true, "start_ms": 0, "duration_ms": 2360 }}
With diarize=true, the same message carries four additional fields:
Final transcript for this utterance. Will not be revised.
utterance.is_final
boolean
Always true
utterance.start_ms
integer
Start of this utterance’s speech, in milliseconds from the beginning of the stream. Approximate. 0 with endpointing off.
utterance.duration_ms
integer
Duration of this utterance’s speech in milliseconds, excluding the pause that ended it. Approximate. With endpointing off, covers the whole stream including any leading and trailing silence.
utterance.speaker
integer | null
Present only with diarize=true. Zero-based index of the speaker who produced this utterance. null when no speaker could be determined.
utterance.n_speakers
integer
Present only with diarize=true. Distinct speakers detected on the connection so far.
utterance.speakers_capped
boolean
Present only with diarize=true. true once every speaker slot is in use.
utterance.speaker_purity
number
Present only with diarize=true. Proportion of this utterance’s speech attributed to speaker, from 0 to 1.
utterance.words
array
Present only with time_stamps=true, and omitted when the utterance’s word timings are unavailable. One { word, start_ms, duration_ms } entry per word of text.
With diarize=false no speaker field appears in any message, and the payloads are byte-identical to a non-diarized connection. With time_stamps=false, no words field appears.With time_stamps=true:
{ "type": "error", "error": "diarize=true is not available on this endpoint." }
The second means speaker labelling is not enabled on the serving instance. Retrying does not clear it; reconnect without diarize.
WebSocket close codes
Code
Meaning
1000
Normal closure after the done message
1003
Invalid query parameters — missing audio_format, invalid sample_rate, invalid endpointing, invalid diarize, unsupported value, etc. Also returned when diarize=true is requested but speaker labelling is not enabled on the serving instance.
1011
Internal server error. An error message is sent before the close.
1013
The service is temporarily at capacity. Not an account or billing condition — retry the connection. Connections requesting diarize=true have a lower concurrency ceiling than plain transcription, so a diarized connection can be refused while a plain one succeeds.
4001
The api_key query parameter is missing or invalid
4002
Audio bytes did not match the declared raw PCM format, or the audio could not be decoded mid-stream
4003
The request is not permitted
4004
The API key does not have access to this model
4029
Insufficient credits
4030
Concurrent request limit reached
4031
Monthly usage limit reached
Rate limits
Concurrent connection limits apply per model; exceeding them rejects the handshake with close code 4030.
import asyncioimport jsonimport osimport websocketsAPI_KEY = os.environ["MODULATE_API_KEY"]AUDIO_FILE = "recording.ogg"CHUNK_SIZE = 8192async def transcribe(): url = ( f"wss://platform.modulate.ai/api/velma-2-stt-streaming-english-v2" f"?api_key={API_KEY}&audio_format=ogg" ) async with websockets.connect(url, max_size=None) as ws: async def send_audio(): with open(AUDIO_FILE, "rb") as f: while chunk := f.read(CHUNK_SIZE): await ws.send(chunk) await ws.send("") # signal end-of-stream send_task = asyncio.create_task(send_audio()) try: async for msg in ws: data = json.loads(msg) if data["type"] == "partial_utterance": # Replace any previously displayed partial — not a delta print(f"\r[partial] {data['partial_utterance']['text']}", end="", flush=True) elif data["type"] == "utterance": u = data["utterance"] # "speaker" is present only with diarize=true; None means undetermined who = f" speaker {u['speaker']}" if u.get("speaker") is not None else "" print(f"\n[final{who}] {u['text']}") elif data["type"] == "done": print(f"\nDone. Duration: {data['duration_ms']}ms") break elif data["type"] == "error": print(f"\nError: {data['error']}") break finally: if not send_task.done(): send_task.cancel()asyncio.run(transcribe())
const WebSocket = require("ws");const fs = require("fs");const API_KEY = process.env.MODULATE_API_KEY;const AUDIO_FILE = "recording.ogg";const CHUNK_SIZE = 8192;const url = new URL("wss://platform.modulate.ai/api/velma-2-stt-streaming-english-v2");url.searchParams.set("api_key", API_KEY);url.searchParams.set("audio_format", "ogg");const ws = new WebSocket(url.toString());ws.on("open", () => { const stream = fs.createReadStream(AUDIO_FILE, { highWaterMark: CHUNK_SIZE }); stream.on("data", (chunk) => ws.send(chunk)); stream.on("end", () => ws.send("")); // signal end-of-stream});ws.on("message", (data) => { const msg = JSON.parse(data.toString()); if (msg.type === "partial_utterance") { // Each partial is the full transcript so far — replace, don't append process.stdout.write(`\r[partial] ${msg.partial_utterance.text}`); } else if (msg.type === "utterance") { // "speaker" is present only with diarize=true; null means undetermined const who = msg.utterance.speaker != null ? ` speaker ${msg.utterance.speaker}` : ""; console.log(`\n[final${who}] ${msg.utterance.text}`); } else if (msg.type === "done") { console.log(`\nDone. Duration: ${msg.duration_ms}ms`); ws.close(); } else if (msg.type === "error") { console.error("\nError:", msg.error); ws.close(); }});ws.on("error", (err) => console.error("WebSocket error:", err.message));ws.on("close", (code) => console.log(`Connection closed: ${code}`));
The examples above work unchanged with endpointing and diarization: append &endpointing=true to the URL and the same message loop prints one [final] line per pause instead of a single one at the end; add &diarize=true as well and each of those lines is prefixed with its speaker label.
WebSocket APIs cannot be tested with cURL. For command-line testing, use websocat.
{ "type": "error", "error": "Internal server error" }
{ "type": "done", "duration_ms": 14253 }
{}
{ "type": "finalize" }
""
query
type:object
Partial Utterance Result
type:object
In-progress transcript snapshot for the CURRENT speech segment. Sent
zero or more times per segment, roughly every 1.5 seconds. The text
field contains the current segment's transcript so far - not a delta,
and not the whole stream - with auto-capitalization and
auto-punctuation already applied. Clients should REPLACE the current
segment's previously displayed partial text, not append. Partials
never carry speaker labels, even with diarize=true.
Final Utterance Result
type:object
The final transcript for one segment of speech, with
auto-capitalization and auto-punctuation applied, plus the segment's
start time and duration. With diarize=true it also carries the
speaker who produced it. Sent once per segment (when the segment ends
at a pause, and once more for the last segment after end-of-stream),
and supersedes the partial_utterance messages for that segment. The
full transcript is the concatenation of these texts in order.
Speech Started
type:object
A segment of speech began. Sent only with agent_events=true.
Carries no transcript.
Eager End of Turn
type:object
The speaker has probably finished their turn, sent before the final
utterance so an agent can start preparing its reply. A
turn_resumed follows if the speaker carries on instead. Sent only
with agent_events=true.
Turn Resumed
type:object
The speaker carried on after an eager_end_of_turn: the turn is not
over. Sent only with agent_events=true.
Error
type:object
An error occurred during transcription. Sent at most once per
connection; the WebSocket closes shortly after. No further
messages follow an error.
Transcription Complete
type:object
Transcription completed successfully. Sent exactly once, immediately
after the final utterance message. After this message the server
closes the WebSocket.
Audio Data Chunk
type:string
Raw audio data chunk for transcription. Sent zero or more times
by the client during the stream lifetime. Each chunk's bytes are
decoded by the server according to the connection's
audio_format query parameter.
Finalize Now
type:object
Text frame asking for the final utterance of everything spoken so
far, now, without ending the stream. With agent_events=true, the
text already recognized is sent first as a partial_utterance. With
16 kHz mono s16le, which is passed through undecoded, the final covers
all audio sent before this message. With any other format (another raw
encoding, sample rate or channel count, or a container such as ogg,
webm or mp3), audio the decoder still holds when the message arrives -
an incomplete sample frame, codec or resampler output, or container
data not yet decoded - begins the next utterance instead; no audio is
lost.
End of Audio Stream
type:string
Empty text frame signaling end of audio. Sent exactly once by the
client after the last audio chunk. The server responds with a
final utterance message followed by a done message, then
closes the connection.
Messages
{ "type": "partial_utterance", "partial_utterance": { "text": "Hello, how are you", "is_final": false } }
{ "type": "utterance", "utterance": { "text": "Hello, how are you doing today?", "is_final": true, "start_ms": 0, "duration_ms": 2360 } }
{ "type": "error", "error": "Internal server error" }
{ "type": "done", "duration_ms": 14253 }
{}
{ "type": "finalize" }
""
{"docsConfig":{"theme":"sequoia","$schema":"https://mintlify.com/docs.json","name":"Modulate","description":"Build with the modulate.ai models — real-time transcription, deepfake detection, and PII/PHI redaction at scale.","colors":{"primary":"#285FEB","light":"#5B82F0","dark":"#285FEB"},"logo":{"light":"https://mintcdn.com/modulateai/0NHKM9zXEnghoEfZ/images/wordmark-navy.svg?fit=max\u0026auto=format\u0026n=0NHKM9zXEnghoEfZ\u0026q=85\u0026s=7ee7a19111bb0154aa2e6934ebd29607","dark":"https://mintcdn.com/modulateai/0NHKM9zXEnghoEfZ/images/wordmark-white.svg?fit=max\u0026auto=format\u0026n=0NHKM9zXEnghoEfZ\u0026q=85\u0026s=98ae552c2cd0d6bf2268f8374825c88a","href":"https://modulate.ai"},"favicon":"https://mintcdn.com/modulateai/0NHKM9zXEnghoEfZ/images/favicon.svg?fit=max\u0026auto=format\u0026n=0NHKM9zXEnghoEfZ\u0026q=85\u0026s=d8e2a95af577097e3287379354855376","appearance":{"default":"system"},"navbar":{"links":[{"href":"https://platform.modulate.ai/signin","label":"Sign in"}],"primary":{"type":"button","label":"Start building free","href":"https://platform.modulate.ai/signup-request"}},"footer":{"socials":{"website":"https://modulate.ai"},"links":[{"header":"Product","items":[{"label":"Modulate","href":"https://modulate.ai"},{"label":"Velma Preview","href":"https://preview.modulate.ai"}]},{"header":"Support","items":[{"label":"Email support","href":"mailto:support@modulate.ai"},{"label":"Privacy policy","href":"https://www.modulate.ai/privacy-policy"},{"label":"Report a vulnerability","href":"/security"}]}]},"integrations":{"ga4":{"measurementId":"G-0WV1JKWMB3"}},"contextual":{"options":["copy","view","assistant","chatgpt","claude","perplexity"],"display":"header"},"markdown":{"schema":true},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"modulateai","hasAudioNarration":false,"actualSubdomain":"modulateai","customDomains":["docs.modulate.ai"],"gitSource":{"type":"gitlab","owner":"modulate","repo":"modulate-user-docs","projectId":81929608,"deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"","_id":"6b10e7219ffae5051c413ba7"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6b05a624d27cdf3511707941","clientVersion":"0.0.4436","searchFilterCounts":[{"language":"default","tag":"API Reference","count":31},{"language":"default","tag":"Velma","count":17},{"language":"default","tag":"Get Started","count":16},{"language":"default","tag":"By capability","count":10},{"language":"default","tag":"Speech-to-text Transcription","count":7},{"language":"default","tag":"Detection packages","count":7},{"language":"default","tag":"Benchmarks","count":6},{"language":"default","tag":"Support","count":4},{"language":"default","tag":"Behaviors","count":4},{"language":"default","tag":"AI Music Detection","count":3}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"support@modulate.ai","showHelpButton":true}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"api-reference/stt/streaming-vfast","slug":"/api-reference/stt/streaming-vfast","pageMetadata":{"title":"Speech-to-Text Streaming English","sidebarTitle":"Streaming English","asyncapi":"api/velma_2_stt_streaming_english_v2.yaml velma2SttStreamingEnglishV2","description":"Low-latency English speech-to-text over WebSocket. Emits rolling partial transcripts during streaming, with optional utterance segmentation at pauses (endpointing), optional speaker labels (diarize), and optional word timings (time_stamps). No other enrichments.","href":"/api-reference/stt/streaming-vfast"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Low-latency English speech-to-text over WebSocket. Emits rolling partial transcripts during streaming, with optional utterance segmentation at pauses (endpointing), optional speaker labels (diarize), and optional word timings (time_stamps). No other enrichments.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Accordion,CodeBlock,Heading,Note,Tab,Table,Tabs,Warning}=_components;if(!Accordion)_missingMdxReference(`Accordion`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Low-latency English speech-to-text over WebSocket. Emits a rolling partial transcript every ~1.5 seconds while audio streams in, then delivers one complete final transcript at end-of-stream — or, with `,_jsx(_components.a,{href:`#utterance-segmentation-endpointing`,children:`endpointing enabled`}),`, a final transcript for each utterance as the speaker pauses. With `,_jsx(_components.a,{href:`#speaker-labels`,children:_jsx(_components.code,{children:`diarize=true`})}),`, each final utterance also carries a speaker label, and with `,_jsx(_components.a,{href:`#word-timings`,children:_jsx(_components.code,{children:`time_stamps=true`})}),`, the timing of every word. No emotion detection, accent detection, or PII/PHI tagging.`]}),`\n`,_jsx(Heading,{level:`2`,id:`endpoint`,children:`Endpoint`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`wss://platform.modulate.ai/api/velma-2-stt-streaming-english-v2`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`authentication`,children:`Authentication`}),`\n`,_jsx(_components.p,{children:`Pass your API key as a query parameter when opening the connection.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`wss://platform.modulate.ai/api/velma-2-stt-streaming-english-v2?api_key=YOUR_API_KEY\u0026audio_format=ogg`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Unlike the batch endpoints, this API does not use an `,_jsx(_components.code,{children:`X-API-Key`}),` header. The key must be in the query string at connection time.`]})}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/guides/authentication`,children:`Authentication and rate limits`}),` for how to obtain and manage API keys.`]}),`\n`,_jsx(Heading,{level:`2`,id:`supported-audio-formats`,children:`Supported audio formats`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Container formats`}),` — `,_jsx(_components.code,{children:`sample_rate`}),` and `,_jsx(_components.code,{children:`num_channels`}),` are ignored if supplied:`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`mp3`}),`, `,_jsx(_components.code,{children:`wav`}),`, `,_jsx(_components.code,{children:`flac`}),`, `,_jsx(_components.code,{children:`m4a`}),`, `,_jsx(_components.code,{children:`mp4`}),`, `,_jsx(_components.code,{children:`ogg`}),`, `,_jsx(_components.code,{children:`opus`}),`, `,_jsx(_components.code,{children:`webm`}),`, `,_jsx(_components.code,{children:`aac`}),`, `,_jsx(_components.code,{children:`aiff`}),`, `,_jsx(_components.code,{children:`wma`}),`, `,_jsx(_components.code,{children:`amr`}),`, and `,_jsx(_components.code,{children:`au`}),`, plus 66 others`]}),`\n`,_jsx(Accordion,{title:`All 79 accepted container values`,id:`all-79-accepted-container-values`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`3g2`}),`, `,_jsx(_components.code,{children:`3ga`}),`, `,_jsx(_components.code,{children:`3gp`}),`, `,_jsx(_components.code,{children:`3gpp`}),`, `,_jsx(_components.code,{children:`8svx`}),`, `,_jsx(_components.code,{children:`aa3`}),`, `,_jsx(_components.code,{children:`aac`}),`, `,_jsx(_components.code,{children:`ac3`}),`, `,_jsx(_components.code,{children:`act`}),`, `,_jsx(_components.code,{children:`adts`}),`, `,_jsx(_components.code,{children:`aif`}),`, `,_jsx(_components.code,{children:`aifc`}),`, `,_jsx(_components.code,{children:`aiff`}),`,\n`,_jsx(_components.code,{children:`amb`}),`, `,_jsx(_components.code,{children:`amr`}),`, `,_jsx(_components.code,{children:`asf`}),`, `,_jsx(_components.code,{children:`at3`}),`, `,_jsx(_components.code,{children:`au`}),`, `,_jsx(_components.code,{children:`avr`}),`, `,_jsx(_components.code,{children:`awb`}),`, `,_jsx(_components.code,{children:`bwf`}),`, `,_jsx(_components.code,{children:`c2`}),`, `,_jsx(_components.code,{children:`caf`}),`, `,_jsx(_components.code,{children:`dss`}),`, `,_jsx(_components.code,{children:`dts`}),`, `,_jsx(_components.code,{children:`dtshd`}),`,\n`,_jsx(_components.code,{children:`eac3`}),`, `,_jsx(_components.code,{children:`ec3`}),`, `,_jsx(_components.code,{children:`f4a`}),`, `,_jsx(_components.code,{children:`f4b`}),`, `,_jsx(_components.code,{children:`flac`}),`, `,_jsx(_components.code,{children:`gsm`}),`, `,_jsx(_components.code,{children:`iff`}),`, `,_jsx(_components.code,{children:`m2a`}),`, `,_jsx(_components.code,{children:`m2ts`}),`, `,_jsx(_components.code,{children:`m4a`}),`, `,_jsx(_components.code,{children:`m4b`}),`, `,_jsx(_components.code,{children:`m4r`}),`, `,_jsx(_components.code,{children:`m4v`}),`,\n`,_jsx(_components.code,{children:`mka`}),`, `,_jsx(_components.code,{children:`mkv`}),`, `,_jsx(_components.code,{children:`mlp`}),`, `,_jsx(_components.code,{children:`mp+`}),`, `,_jsx(_components.code,{children:`mp1`}),`, `,_jsx(_components.code,{children:`mp2`}),`, `,_jsx(_components.code,{children:`mp3`}),`, `,_jsx(_components.code,{children:`mp4`}),`, `,_jsx(_components.code,{children:`mpa`}),`, `,_jsx(_components.code,{children:`mpc`}),`, `,_jsx(_components.code,{children:`mpga`}),`, `,_jsx(_components.code,{children:`mpp`}),`, `,_jsx(_components.code,{children:`mts`}),`,\n`,_jsx(_components.code,{children:`oga`}),`, `,_jsx(_components.code,{children:`ogg`}),`, `,_jsx(_components.code,{children:`ogx`}),`, `,_jsx(_components.code,{children:`oma`}),`, `,_jsx(_components.code,{children:`omg`}),`, `,_jsx(_components.code,{children:`opus`}),`, `,_jsx(_components.code,{children:`paf`}),`, `,_jsx(_components.code,{children:`pvf`}),`, `,_jsx(_components.code,{children:`qcp`}),`, `,_jsx(_components.code,{children:`ra`}),`, `,_jsx(_components.code,{children:`rf64`}),`, `,_jsx(_components.code,{children:`rm`}),`, `,_jsx(_components.code,{children:`rmvb`}),`,\n`,_jsx(_components.code,{children:`snd`}),`, `,_jsx(_components.code,{children:`svx`}),`, `,_jsx(_components.code,{children:`thd`}),`, `,_jsx(_components.code,{children:`ts`}),`, `,_jsx(_components.code,{children:`tta`}),`, `,_jsx(_components.code,{children:`voc`}),`, `,_jsx(_components.code,{children:`vqf`}),`, `,_jsx(_components.code,{children:`w64`}),`, `,_jsx(_components.code,{children:`wav`}),`, `,_jsx(_components.code,{children:`wave`}),`, `,_jsx(_components.code,{children:`weba`}),`, `,_jsx(_components.code,{children:`webm`}),`, `,_jsx(_components.code,{children:`wma`}),`,\n`,_jsx(_components.code,{children:`wmv`})]})}),`\n`,_jsxs(_components.p,{children:[`The MP4-family values (`,_jsx(_components.code,{children:`mp4`}),`, `,_jsx(_components.code,{children:`m4a`}),`, `,_jsx(_components.code,{children:`m4b`}),`, `,_jsx(_components.code,{children:`m4r`}),`, `,_jsx(_components.code,{children:`m4v`}),`, `,_jsx(_components.code,{children:`3gp`}),`, `,_jsx(_components.code,{children:`3gpp`}),`, `,_jsx(_components.code,{children:`3ga`}),`, `,_jsx(_components.code,{children:`3g2`}),`, `,_jsx(_components.code,{children:`f4a`}),`, `,_jsx(_components.code,{children:`f4b`}),`) must be sent in a streamable layout; otherwise the connection ends with an audio-processing error.`]}),`\n`,_jsxs(_components.p,{children:[`Opus audio is accepted either as `,_jsx(_components.code,{children:`opus`}),` or, for Opus-in-Ogg streams, as `,_jsx(_components.code,{children:`ogg`}),`.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Raw PCM formats`}),` — `,_jsx(_components.code,{children:`sample_rate`}),` and `,_jsx(_components.code,{children:`num_channels`}),` are required:`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`s8`}),`, `,_jsx(_components.code,{children:`s16le`}),`, `,_jsx(_components.code,{children:`s16be`}),`, `,_jsx(_components.code,{children:`s24le`}),`, `,_jsx(_components.code,{children:`s24be`}),`, `,_jsx(_components.code,{children:`s32le`}),`, `,_jsx(_components.code,{children:`s32be`}),`, `,_jsx(_components.code,{children:`u8`}),`, `,_jsx(_components.code,{children:`u16le`}),`, `,_jsx(_components.code,{children:`u16be`}),`, `,_jsx(_components.code,{children:`u24le`}),`, `,_jsx(_components.code,{children:`u24be`}),`, `,_jsx(_components.code,{children:`u32le`}),`, `,_jsx(_components.code,{children:`u32be`}),`, `,_jsx(_components.code,{children:`f32le`}),`, `,_jsx(_components.code,{children:`f32be`}),`, `,_jsx(_components.code,{children:`f64le`}),`, `,_jsx(_components.code,{children:`f64be`}),`, `,_jsx(_components.code,{children:`mulaw`}),`, `,_jsx(_components.code,{children:`alaw`}),`, `,_jsx(_components.code,{children:`g722`}),`, `,_jsx(_components.code,{children:`vox`})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`g722`}),` and `,_jsx(_components.code,{children:`vox`}),` are mono-only: `,_jsx(_components.code,{children:`num_channels`}),` must be `,_jsx(_components.code,{children:`1`}),`.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Valid sample rates:`}),` 8000, 11025, 16000, 22050, 32000, 44100, 48000, 96000`]}),`\n`,_jsxs(_components.p,{children:[`For lowest end-to-end latency, send `,_jsx(_components.code,{children:`audio_format=s16le\u0026sample_rate=16000\u0026num_channels=1`}),`. This matches the model’s native input format and bypasses the server’s audio decoder entirely.`]}),`\n`,_jsx(Heading,{level:`2`,id:`query-parameters`,children:`Query parameters`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Parameter`}),_jsx(_components.th,{children:`Required`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`api_key`})}),_jsx(_components.td,{children:`Yes`}),_jsx(_components.td,{children:`Your API key`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`audio_format`})}),_jsx(_components.td,{children:`Yes`}),_jsx(_components.td,{children:`Container or raw PCM format of the audio you will stream. See supported formats above.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`sample_rate`})}),_jsx(_components.td,{children:`Raw PCM only`}),_jsxs(_components.td,{children:[`Source sample rate in Hz. Required when `,_jsx(_components.code,{children:`audio_format`}),` is a raw PCM type; ignored for container formats.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`num_channels`})}),_jsx(_components.td,{children:`Raw PCM only`}),_jsxs(_components.td,{children:[`Number of audio channels (1–8). Required when `,_jsx(_components.code,{children:`audio_format`}),` is a raw PCM type; ignored for container formats. The server downmixes to mono internally.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`endpointing`})}),_jsx(_components.td,{children:`No`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`true`}),` or `,_jsx(_components.code,{children:`false`}),` (default `,_jsx(_components.code,{children:`false`}),`). When `,_jsx(_components.code,{children:`true`}),`, speech is segmented into utterances at pauses — see `,_jsx(_components.a,{href:`#utterance-segmentation-endpointing`,children:`Utterance segmentation`}),`. Any other value is rejected with close code `,_jsx(_components.code,{children:`1003`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`diarize`})}),_jsx(_components.td,{children:`No`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`true`}),` or `,_jsx(_components.code,{children:`false`}),` (default `,_jsx(_components.code,{children:`false`}),`). When `,_jsx(_components.code,{children:`true`}),`, each final `,_jsx(_components.code,{children:`utterance`}),` carries speaker fields — see `,_jsx(_components.a,{href:`#speaker-labels`,children:`Speaker labels`}),`. Any other value is rejected with close code `,_jsx(_components.code,{children:`1003`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`time_stamps`})}),_jsx(_components.td,{children:`No`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`true`}),` or `,_jsx(_components.code,{children:`false`}),` (default `,_jsx(_components.code,{children:`false`}),`). When `,_jsx(_components.code,{children:`true`}),`, each final `,_jsx(_components.code,{children:`utterance`}),` carries `,_jsx(_components.code,{children:`words`}),` — see `,_jsx(_components.a,{href:`#word-timings`,children:`Word timings`}),`.`]})]})]})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`endpointing`}),`, `,_jsx(_components.code,{children:`diarize`}),`, and `,_jsx(_components.code,{children:`time_stamps`}),` are independent; every combination is valid.`]}),`\n`,_jsxs(_components.p,{children:[`This endpoint accepts no other enrichment toggles. Emotion, accent, and PII parameters are not recognized and have no effect. Use `,_jsx(_components.a,{href:`/api-reference/stt/streaming`,children:`STT Streaming`}),` if you need those.`]}),`\n`,_jsx(Heading,{level:`2`,id:`utterance-segmentation-endpointing`,children:`Utterance segmentation (endpointing)`}),`\n`,_jsxs(_components.p,{children:[`By default, the connection produces one final `,_jsx(_components.code,{children:`utterance`}),` at end-of-stream covering everything you sent, and each `,_jsx(_components.code,{children:`partial_utterance`}),` reflects the whole stream so far.`]}),`\n`,_jsxs(_components.p,{children:[`With `,_jsx(_components.code,{children:`endpointing=true`}),`, speech is segmented at pauses:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Each `,_jsx(_components.code,{children:`partial_utterance`}),` contains the complete transcript of the `,_jsx(_components.strong,{children:`current segment`}),` so far (still replace, never append).`]}),`\n`,_jsxs(_components.li,{children:[`Each time a pause ends a segment, you immediately receive a final `,_jsx(_components.code,{children:`utterance`}),` for it — final text arrives shortly after the speaker stops, instead of at end-of-stream. Each final carries `,_jsx(_components.code,{children:`start_ms`}),` and `,_jsx(_components.code,{children:`duration_ms`}),` for its speech.`]}),`\n`,_jsxs(_components.li,{children:[`The full transcript is the concatenation of the final `,_jsx(_components.code,{children:`utterance`}),` texts, in order.`]}),`\n`,_jsxs(_components.li,{children:[`Every connection still ends with at least one final `,_jsx(_components.code,{children:`utterance`}),` (a stream containing no speech yields one with empty `,_jsx(_components.code,{children:`text`}),`), followed by `,_jsx(_components.code,{children:`done`}),`.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`Use endpointing for live conversations — voice agents, assistants, meeting captions — where you want final text per utterance as it happens. Leave it off for whole-recording transcription where one final transcript is simpler to consume.`}),`\n`,_jsx(Heading,{level:`2`,id:`speaker-labels`,children:`Speaker labels`}),`\n`,_jsxs(_components.p,{children:[`Set `,_jsx(_components.code,{children:`diarize=true`}),` to label which speaker produced each utterance. Labels are attached to final `,_jsx(_components.code,{children:`utterance`}),` messages only, never to `,_jsx(_components.code,{children:`partial_utterance`}),`.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`speaker`}),` is a zero-based index, stable for the lifetime of one connection and meaningless outside it. The same person on a new connection may receive a different index, so the value identifies a speaker within a conversation and is not an identity that can be matched across connections or sessions.`]}),`\n`,_jsx(_components.p,{children:`A label is assigned when an utterance is finalized and is never revised. There is no back-patching, so an early utterance keeps whatever label it was given.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`speaker`}),` is `,_jsx(_components.code,{children:`null`}),` when diarization was requested but no speaker could be determined for that utterance, which happens on very short or silent segments and on a brand-new voice that has not yet accumulated enough evidence. That is distinct from the field being absent, which means `,_jsx(_components.code,{children:`diarize=true`}),` was not requested.`]}),`\n`,_jsx(Heading,{level:`3`,id:`speaker-capacity`,children:`Speaker capacity`}),`\n`,_jsxs(_components.p,{children:[`Up to ten distinct speakers are labeled per connection. Past that, further speakers are merged into existing labels rather than reported separately: their speech is still transcribed, but `,_jsx(_components.code,{children:`speaker`}),` is wrong for some utterances.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Worth knowing:`}),` `,_jsx(_components.code,{children:`speakers_capped`}),` is the only signal that this happened. Nothing in the transcript or in `,_jsx(_components.code,{children:`speaker`}),` itself indicates a merged speaker, so a client acting on speaker identity should check `,_jsx(_components.code,{children:`speakers_capped`}),` alongside `,_jsx(_components.code,{children:`n_speakers`}),`.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`utterances-that-span-a-speaker-change`,children:`Utterances that span a speaker change`}),`\n`,_jsxs(_components.p,{children:[`Segments are cut at pauses regardless of `,_jsx(_components.code,{children:`diarize`}),`. An utterance that spans a fast exchange with no pause between turns carries the speaker who produced most of it, and `,_jsx(_components.code,{children:`speaker_purity`}),` reports what proportion that was. `,_jsx(_components.code,{children:`1.0`}),` means the utterance was cleanly single-speaker; a lower value means the single label describes only the majority of it.`]}),`\n`,_jsx(Heading,{level:`3`,id:`with-endpointing-off`,children:`With endpointing off`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`diarize=true\u0026endpointing=false`}),` produces one final `,_jsx(_components.code,{children:`utterance`}),` for the whole stream, so a single `,_jsx(_components.code,{children:`speaker`}),` cannot describe it. Read `,_jsx(_components.code,{children:`n_speakers`}),` in that mode and treat `,_jsx(_components.code,{children:`speaker`}),` as indicative only.`]}),`\n`,_jsx(Heading,{level:`2`,id:`word-timings`,children:`Word timings`}),`\n`,_jsxs(_components.p,{children:[`Set `,_jsx(_components.code,{children:`time_stamps=true`}),` to receive the timing of every word. Each final `,_jsx(_components.code,{children:`utterance`}),` then carries `,_jsx(_components.code,{children:`words`}),`: the words of its `,_jsx(_components.code,{children:`text`}),`, in order, each with `,_jsx(_components.code,{children:`word`}),`, `,_jsx(_components.code,{children:`start_ms`}),`, and `,_jsx(_components.code,{children:`duration_ms`}),`. Partials never carry it.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`start_ms`}),` is milliseconds from the start of the stream, the same clock as the utterance’s `,_jsx(_components.code,{children:`start_ms`}),`. Both values are approximate. Joined with single spaces, the `,_jsx(_components.code,{children:`word`}),` values spell `,_jsx(_components.code,{children:`text`}),` exactly, punctuation included.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Worth knowing:`}),` `,_jsx(_components.code,{children:`words`}),` can be missing from an utterance even with `,_jsx(_components.code,{children:`time_stamps=true`}),`. It is omitted when that utterance’s word timings are unavailable, with no marker in its place, so check for the key rather than assuming it.`]})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Worth knowing:`}),` the word shape differs from Multilingual Fast Transcription (streaming), which reports `,_jsx(_components.code,{children:`end_ms`}),` per word rather than `,_jsx(_components.code,{children:`duration_ms`}),`. A client that handles both endpoints needs to read each one’s shape.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`connection-flow`,children:`Connection flow`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Connect to the WebSocket endpoint with `,_jsx(_components.code,{children:`api_key`}),`, `,_jsx(_components.code,{children:`audio_format`}),`, (for raw PCM) `,_jsx(_components.code,{children:`sample_rate`}),` and `,_jsx(_components.code,{children:`num_channels`}),`, and optionally `,_jsx(_components.code,{children:`endpointing`}),`, `,_jsx(_components.code,{children:`diarize`}),`, and `,_jsx(_components.code,{children:`time_stamps`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Stream audio as `,_jsx(_components.strong,{children:`binary`}),` WebSocket frames. Frames can be any size; 4–64 KB is typical.`]}),`\n`,_jsxs(_components.li,{children:[`Receive `,_jsx(_components.code,{children:`partial_utterance`}),` JSON messages every ~1.5 seconds. Each contains the `,_jsx(_components.strong,{children:`complete transcript of its scope so far`}),` — replace any previously displayed partial, do not append.`]}),`\n`,_jsxs(_components.li,{children:[`With `,_jsx(_components.code,{children:`endpointing=true`}),`, receive a final `,_jsx(_components.code,{children:`utterance`}),` message each time a pause ends a segment.`]}),`\n`,_jsxs(_components.li,{children:[`Send an `,_jsx(_components.strong,{children:`empty text frame`}),` (`,_jsx(_components.code,{children:`\"\"`}),`) to signal end of audio.`]}),`\n`,_jsxs(_components.li,{children:[`Receive the final `,_jsx(_components.code,{children:`utterance`}),` for any content not already finalized at a pause (the whole stream with endpointing off; skipped when the last segment was already finalized mid-stream).`]}),`\n`,_jsxs(_components.li,{children:[`Receive a `,_jsx(_components.code,{children:`done`}),` message with total audio duration.`]}),`\n`,_jsx(_components.li,{children:`The connection closes automatically.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`server-messages`,children:`Server messages`}),`\n`,_jsx(Heading,{level:`3`,id:`partial_utterance`,children:_jsx(_components.code,{children:`partial_utterance`})}),`\n`,_jsxs(_components.p,{children:[`Sent roughly every 1.5 seconds while audio is streaming. Each message contains the `,_jsx(_components.strong,{children:`complete transcript built so far for the current scope`}),` — the whole connection by default, or the current speech segment when `,_jsx(_components.code,{children:`endpointing=true`}),`. It is not a delta from the previous message: replace your displayed partial text with each new value — never append.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"partial_utterance\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"partial_utterance\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"text\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Hello, how are you\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"is_final\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`type`})}),_jsx(_components.td,{children:`string`}),_jsxs(_components.td,{children:[`Always `,_jsx(_components.code,{children:`\"partial_utterance\"`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`partial_utterance.text`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Complete transcript so far. Replace, don’t append.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`partial_utterance.is_final`})}),_jsx(_components.td,{children:`boolean`}),_jsxs(_components.td,{children:[`Always `,_jsx(_components.code,{children:`false`})]})]})]})]}),`\n`,_jsxs(_components.p,{children:[`Partials never carry speaker labels, even with `,_jsx(_components.code,{children:`diarize=true`}),`. Speaker fields appear on final `,_jsx(_components.code,{children:`utterance`}),` messages only.`]}),`\n`,_jsx(Heading,{level:`3`,id:`utterance`,children:_jsx(_components.code,{children:`utterance`})}),`\n`,_jsxs(_components.p,{children:[`The final transcript for one utterance. Will not be revised. With endpointing off, sent exactly once at end-of-stream, covering the entire audio stream. With `,_jsx(_components.code,{children:`endpointing=true`}),`, sent each time a pause ends a segment; the full transcript is the concatenation of every `,_jsx(_components.code,{children:`utterance`}),` text in order.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`9`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"utterance\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"utterance\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"text\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Hello, how are you doing today?\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"is_final\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"start_ms\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"duration_ms\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2360`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`With `,_jsx(_components.code,{children:`diarize=true`}),`, the same message carries four additional fields:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`13`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`13`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"utterance\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"utterance\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"text\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Good morning, thanks for calling.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"is_final\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"start_ms\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8120`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"duration_ms\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`4440`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"speaker\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"n_speakers\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"speakers_capped\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"speaker_purity\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1.0`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`type`})}),_jsx(_components.td,{children:`string`}),_jsxs(_components.td,{children:[`Always `,_jsx(_components.code,{children:`\"utterance\"`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`utterance.text`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Final transcript for this utterance. Will not be revised.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`utterance.is_final`})}),_jsx(_components.td,{children:`boolean`}),_jsxs(_components.td,{children:[`Always `,_jsx(_components.code,{children:`true`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`utterance.start_ms`})}),_jsx(_components.td,{children:`integer`}),_jsxs(_components.td,{children:[`Start of this utterance’s speech, in milliseconds from the beginning of the stream. Approximate. `,_jsx(_components.code,{children:`0`}),` with endpointing off.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`utterance.duration_ms`})}),_jsx(_components.td,{children:`integer`}),_jsx(_components.td,{children:`Duration of this utterance’s speech in milliseconds, excluding the pause that ended it. Approximate. With endpointing off, covers the whole stream including any leading and trailing silence.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`utterance.speaker`})}),_jsx(_components.td,{children:`integer | null`}),_jsxs(_components.td,{children:[`Present only with `,_jsx(_components.code,{children:`diarize=true`}),`. Zero-based index of the speaker who produced this utterance. `,_jsx(_components.code,{children:`null`}),` when no speaker could be determined.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`utterance.n_speakers`})}),_jsx(_components.td,{children:`integer`}),_jsxs(_components.td,{children:[`Present only with `,_jsx(_components.code,{children:`diarize=true`}),`. Distinct speakers detected on the connection so far.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`utterance.speakers_capped`})}),_jsx(_components.td,{children:`boolean`}),_jsxs(_components.td,{children:[`Present only with `,_jsx(_components.code,{children:`diarize=true`}),`. `,_jsx(_components.code,{children:`true`}),` once every speaker slot is in use.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`utterance.speaker_purity`})}),_jsx(_components.td,{children:`number`}),_jsxs(_components.td,{children:[`Present only with `,_jsx(_components.code,{children:`diarize=true`}),`. Proportion of this utterance’s speech attributed to `,_jsx(_components.code,{children:`speaker`}),`, from 0 to 1.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`utterance.words`})}),_jsx(_components.td,{children:`array`}),_jsxs(_components.td,{children:[`Present only with `,_jsx(_components.code,{children:`time_stamps=true`}),`, and omitted when the utterance’s word timings are unavailable. One `,_jsx(_components.code,{children:`{ word, start_ms, duration_ms }`}),` entry per word of `,_jsx(_components.code,{children:`text`}),`.`]})]})]})]}),`\n`,_jsxs(_components.p,{children:[`With `,_jsx(_components.code,{children:`diarize=false`}),` no speaker field appears in any message, and the payloads are byte-identical to a non-diarized connection. With `,_jsx(_components.code,{children:`time_stamps=false`}),`, no `,_jsx(_components.code,{children:`words`}),` field appears.`]}),`\n`,_jsxs(_components.p,{children:[`With `,_jsx(_components.code,{children:`time_stamps=true`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`13`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`13`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"utterance\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"utterance\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"text\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Hello, Greg.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"is_final\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"start_ms\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"duration_ms\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1380`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"words\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"word\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Hello,\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"start_ms\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"duration_ms\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`420`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"word\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Greg.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"start_ms\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1480`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"duration_ms\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`900`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`done`,children:_jsx(_components.code,{children:`done`})}),`\n`,_jsxs(_components.p,{children:[`Sent immediately after the final `,_jsx(_components.code,{children:`utterance`}),`. Signals stream completion. The connection closes shortly after.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"done\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"duration_ms\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`14253`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`type`})}),_jsx(_components.td,{children:`string`}),_jsxs(_components.td,{children:[`Always `,_jsx(_components.code,{children:`\"done\"`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`duration_ms`})}),_jsx(_components.td,{children:`integer`}),_jsx(_components.td,{children:`Total audio duration in milliseconds`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`error`,children:_jsx(_components.code,{children:`error`})}),`\n`,_jsxs(_components.p,{children:[`Sent if something goes wrong. The connection closes after this message. No further messages follow an `,_jsx(_components.code,{children:`error`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Invalid audio_format='xyz'.\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`type`})}),_jsx(_components.td,{children:`string`}),_jsxs(_components.td,{children:[`Always `,_jsx(_components.code,{children:`\"error\"`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`error`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Human-readable description of the error`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`Diarization adds two error texts, both closing with `,_jsx(_components.code,{children:`1003`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{ `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Invalid diarize='yes'. Expected 'true' or 'false'.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{ `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"diarize=true is not available on this endpoint.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The second means speaker labelling is not enabled on the serving instance. Retrying does not clear it; reconnect without `,_jsx(_components.code,{children:`diarize`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`websocket-close-codes`,children:`WebSocket close codes`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Code`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`1000`})}),_jsxs(_components.td,{children:[`Normal closure after the `,_jsx(_components.code,{children:`done`}),` message`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`1003`})}),_jsxs(_components.td,{children:[`Invalid query parameters — missing `,_jsx(_components.code,{children:`audio_format`}),`, invalid `,_jsx(_components.code,{children:`sample_rate`}),`, invalid `,_jsx(_components.code,{children:`endpointing`}),`, invalid `,_jsx(_components.code,{children:`diarize`}),`, unsupported value, etc. Also returned when `,_jsx(_components.code,{children:`diarize=true`}),` is requested but speaker labelling is not enabled on the serving instance.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`1011`})}),_jsxs(_components.td,{children:[`Internal server error. An `,_jsx(_components.code,{children:`error`}),` message is sent before the close.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`1013`})}),_jsxs(_components.td,{children:[`The service is temporarily at capacity. Not an account or billing condition — retry the connection. Connections requesting `,_jsx(_components.code,{children:`diarize=true`}),` have a lower concurrency ceiling than plain transcription, so a diarized connection can be refused while a plain one succeeds.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`4001`})}),_jsxs(_components.td,{children:[`The `,_jsx(_components.code,{children:`api_key`}),` query parameter is missing or invalid`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`4002`})}),_jsx(_components.td,{children:`Audio bytes did not match the declared raw PCM format, or the audio could not be decoded mid-stream`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`4003`})}),_jsx(_components.td,{children:`The request is not permitted`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`4004`})}),_jsx(_components.td,{children:`The API key does not have access to this model`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`4029`})}),_jsx(_components.td,{children:`Insufficient credits`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`4030`})}),_jsx(_components.td,{children:`Concurrent request limit reached`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`4031`})}),_jsx(_components.td,{children:`Monthly usage limit reached`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`rate-limits`,children:`Rate limits`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Concurrent connection limits apply per model; exceeding them rejects the handshake with close code `,_jsx(_components.code,{children:`4030`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/guides/authentication`,children:`Authentication and rate limits`}),` for retry guidance.`]}),`\n`,_jsx(Heading,{level:`2`,id:`examples`,children:`Examples`}),`\n`,_jsxs(Tabs,{children:[_jsx(Tab,{title:`Python (websockets)`,id:`python-websockets`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`46`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`46`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` asyncio`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` json`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` os`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` websockets`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`API_KEY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"MODULATE_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`AUDIO_FILE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"recording.ogg\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`CHUNK_SIZE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 8192`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` transcribe`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`():`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` url `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"wss://platform.modulate.ai/api/velma-2-stt-streaming-english-v2\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"?api_key=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`API_KEY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\u0026audio_format=ogg\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` async`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` with`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` websockets.connect(url, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`max_size`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`None`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ws:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` async`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` send_audio`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`():`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` with`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` open`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`AUDIO_FILE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"rb\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` f:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` while`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` chunk `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` f.read(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`CHUNK_SIZE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`):`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ws.send(chunk)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ws.send(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# signal end-of-stream`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` send_task `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` asyncio.create_task(send_audio())`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` try`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` async`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` for`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` msg `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ws:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` data `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` json.loads(msg)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` data[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"partial_utterance\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Replace any previously displayed partial — not a delta`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\r`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`[partial] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`data[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'partial_utterance'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`][`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'text'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`end`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`flush`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` elif`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` data[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"utterance\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` u `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` data[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"utterance\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # \"speaker\" is present only with diarize=true; None means undetermined`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` who `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\" speaker `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`u[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'speaker'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` u.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"speaker\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`is`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` not`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` None`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` else`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`[final`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`who`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`u[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'text'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` elif`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` data[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"done\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Done. Duration: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`data[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'duration_ms'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`ms\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` break`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` elif`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` data[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Error: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`data[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'error'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` break`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` finally`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` not`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` send_task.done():`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` send_task.cancel()`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`asyncio.run(transcribe())`})}),`\n`]})})})}),_jsx(Tab,{title:`JavaScript (Node.js)`,id:`javascript-node-js`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`39`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`39`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` WebSocket`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` require`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ws\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` fs`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` require`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"fs\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` API_KEY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`MODULATE_API_KEY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` AUDIO_FILE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"recording.ogg\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` CHUNK_SIZE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 8192`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` URL`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"wss://platform.modulate.ai/api/velma-2-stt-streaming-english-v2\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`url`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`searchParams`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`set`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"api_key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`API_KEY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`url`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`searchParams`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`set`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"audio_format\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ogg\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` ws`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` WebSocket`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`url`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`toString`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`());`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ws`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`on`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"open\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, () `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` stream`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` fs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`createReadStream`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`AUDIO_FILE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`highWaterMark:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` CHUNK_SIZE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` stream`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`on`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`chunk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` ws`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`send`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`chunk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`));`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` stream`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`on`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"end\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, () `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` ws`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`send`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// signal end-of-stream`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ws`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`on`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` msg`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` JSON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`parse`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`toString`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`());`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`msg`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`type`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ===`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"partial_utterance\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Each partial is the full transcript so far — replace, don't append`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`stdout`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`write`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\r`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`[partial] `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`msg`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`partial_utterance`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`text`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`else`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`msg`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`type`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ===`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"utterance\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // \"speaker\" is present only with diarize=true; null means undetermined`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` who`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` msg`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`utterance`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`speaker`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` null`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ?`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" ` speaker \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`msg`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`utterance`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`speaker`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` :`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`[final`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`who`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`] `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`msg`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`utterance`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`text`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`else`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`msg`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`type`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ===`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"done\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Done. Duration: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`msg`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`duration_ms`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"ms`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` ws`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`close`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`else`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`msg`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`type`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ===`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Error:\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`msg`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` ws`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`close`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ws`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`on`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"WebSocket error:\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`message`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`));`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ws`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`on`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"close\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`code`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`Connection closed: \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`code`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`));`})]}),`\n`]})})})})]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`The examples above work unchanged with endpointing and diarization: append `,_jsx(_components.code,{children:`\u0026endpointing=true`}),` to the URL and the same message loop prints one `,_jsx(_components.code,{children:`[final]`}),` line per pause instead of a single one at the end; add `,_jsx(_components.code,{children:`\u0026diarize=true`}),` as well and each of those lines is prefixed with its speaker label.`]})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`WebSocket APIs cannot be tested with cURL. For command-line testing, use `,_jsx(_components.a,{href:`https://github.com/vi/websocat`,children:_jsx(_components.code,{children:`websocat`})}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`related`,children:`Related`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/guides/which-api`,children:`Which API should I use?`}),` — when Streaming v2 is the right choice vs STT Streaming or batch`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/api-reference/stt/streaming`,children:`STT Streaming`}),` — multilingual streaming with speaker diarization and enrichments`]}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/guides/authentication`,children:`Authentication and rate limits`})}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Speech-to-Text Streaming English","sidebarTitle":"Streaming English","asyncapi":"api/velma_2_stt_streaming_english_v2.yaml velma2SttStreamingEnglishV2","description":"Low-latency English speech-to-text over WebSocket. Emits rolling partial transcripts during streaming, with optional utterance segmentation at pauses (endpointing), optional speaker labels (diarize), and optional word timings (time_stamps). No other enrichments.","href":"/api-reference/stt/streaming-vfast"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Endpoint","slug":"endpoint","depth":2,"children":[]},{"title":"Authentication","slug":"authentication","depth":2,"children":[]},{"title":"Supported audio formats","slug":"supported-audio-formats","depth":2,"children":[]},{"title":"Query parameters","slug":"query-parameters","depth":2,"children":[]},{"title":"Utterance segmentation (endpointing)","slug":"utterance-segmentation-endpointing","depth":2,"children":[]},{"title":"Speaker labels","slug":"speaker-labels","depth":2,"children":[{"title":"Speaker capacity","slug":"speaker-capacity","depth":3,"children":[]},{"title":"Utterances that span a speaker change","slug":"utterances-that-span-a-speaker-change","depth":3,"children":[]},{"title":"With endpointing off","slug":"with-endpointing-off","depth":3,"children":[]}]},{"title":"Word timings","slug":"word-timings","depth":2,"children":[]},{"title":"Connection flow","slug":"connection-flow","depth":2,"children":[]},{"title":"Server messages","slug":"server-messages","depth":2,"children":[{"title":"partial_utterance","slug":"partial_utterance","depth":3,"children":[]},{"title":"utterance","slug":"utterance","depth":3,"children":[]},{"title":"done","slug":"done","depth":3,"children":[]},{"title":"error","slug":"error","depth":3,"children":[]}]},{"title":"WebSocket close codes","slug":"websocket-close-codes","depth":2,"children":[]},{"title":"Rate limits","slug":"rate-limits","depth":2,"children":[]},{"title":"Examples","slug":"examples","depth":2,"children":[]},{"title":"Related","slug":"related","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/modulateai/6f43a4827c59f292/hubspot.js","/_mintlify/custom/modulateai/0bb96afd82713278/swan.js","/_mintlify/custom/modulateai/476f212ab71e7bd6/hubspot-forms.js","/_mintlify/custom/modulateai/06d8e9ccae2eea7a/detection-package-download.js"],"apiReferenceData":{"channel":{"id":"velma2SttStreamingEnglishV2","title":"Velma2 stt streaming english v2","description":"Establish a WebSocket connection for low-latency English transcription.\nThe server emits partial transcripts as audio streams in, and a final\n`utterance` at end-of-stream. With `endpointing=true`, speech is\nadditionally segmented at pauses into one final `utterance` per segment.\nWith `diarize=true`, each final `utterance` also carries a numerical\nspeaker ID for its dominant speaker.\n\n## Connection Flow\n1. Connect with `api_key`, `audio_format`, (for raw formats) `sample_rate` +\n `num_channels`, and optionally `endpointing`, `diarize`, `time_stamps`,\n `stable_partials` and `agent_events`\n2. Connection accepted if authentication succeeds and limits are not\n exceeded\n3. Stream audio data as binary WebSocket frames\n4. Receive `partial_utterance` results every ~1.5 seconds while transcription\n is in progress (each is the complete transcript of the current segment\n so far - REPLACE, don't append)\n5. With `endpointing=true`, receive a final `utterance` message each time a\n segment of speech ends (at a pause), carrying that segment's text, start\n time, and duration\n6. Send empty text frame (`\"\"`) when the audio stream ends\n7. Receive the final `utterance` for any content not already finalized\n at a pause (the whole stream with endpointing off; with\n `endpointing=true`, this step is skipped when the last segment was\n already finalized mid-stream)\n8. Receive `done` message with total audio duration\n9. Connection closes automatically\n\n## Partial and Segment Semantics\nBy default the connection produces a single final `utterance` at\nend-of-stream, covering the whole stream (`start_ms=0`), and each\n`partial_utterance` reflects the whole stream so far. With\n`endpointing=true`, speech is segmented into utterances at pauses: each\n`partial_utterance` reflects the CURRENT segment, and a final `utterance`\nis emitted each time a segment ends, after which the following\n`partial_utterance` messages belong to the next segment; the full\ntranscript is the concatenation of the final `utterance` texts. In both\nmodes a `partial_utterance` is the complete transcript of its scope so far\n(not a delta), and the last few words may be revised in subsequent partials\nas the model sees more audio context, so clients should replace the\ndisplayed partial text rather than append.\n\n## Speaker Labels\nWith `diarize=true`, each final `utterance` carries `speaker` - a\nzero-based index that is stable for the lifetime of the connection.\nIt identifies speakers only WITHIN one connection: the same person on\na new connection may get a different index, and indices are not\nidentities that can be matched across connections or sessions.\n\nUp to ten distinct speakers are labeled per connection. Past that,\nfurther speakers are merged into existing labels rather than reported\nseparately - their speech is still transcribed, but its `speaker` will\nbe wrong. `speakers_capped` is `true` once all slots are in use, which\nis the only signal that labels may be unreliable; clients doing\nanything consequential with speaker identity should check it, alongside\n`n_speakers` for how many distinct speakers the connection has\ndetected so far.\n\nSegments are cut at pauses regardless of `diarize`: a segment that\nspans a fast speaker exchange with no pause carries the speaker who\nspoke most of it, and `speaker_purity` below `1.0` is the signal that\nthe single label describes only the majority of the segment.\n\nSpeaker labels are attached to final `utterance` messages only, never\nto `partial_utterance`. Diarization has no back-patching: a label is\nassigned when the utterance is finalized and is not revised\nafterwards. Very early utterances in a conversation may report\n`speaker: null` while a new voice has not yet accumulated enough\nevidence to be assigned a label.\n\nWith `diarize=true` and `endpointing=false` there is only one final\n`utterance` for the whole stream, so a single `speaker` cannot\ndescribe it. In that mode read `n_speakers` - how many distinct\nspeakers were detected on the connection - and treat `speaker` as\nindicative only.\n\n## Ending a Segment Early (finalize)\nWhile the stream is open, a client may send the text frame\n`{\"type\": \"finalize\"}` to receive the final `utterance` for everything\nspoken so far right away, instead of waiting for a pause, and keep\nstreaming on the same connection. With `agent_events=true`, the text\nalready recognized is sent first as a `partial_utterance`, at once, and\nthe final follows when the last words are decoded; without it, the\nfirst message after `finalize` carries the finished text. With\n`endpointing=false` the final covers the\naudio since the previous `finalize` (or the start of the stream). Any\nother text frame is ignored. The empty frame (`\"\"`) still ends the\nstream.\n\n## Stable Partials and Agent Events\n- `stable_partials=true`: each `partial_utterance` also carries\n `stable_text`, the words that will not change before the final, and\n `unstable_text`, the newest words, which may still be revised. Joined\n with one space they spell `text`.\n- `agent_events=true` (requires `endpointing=true`): three extra\n messages describe the speaker's turn: `speech_started` when a segment\n of speech begins, `eager_end_of_turn` (with a `confidence` from 0 to\n 1) when the speaker has probably finished, sent before the final, and\n `turn_resumed` when the speaker carries on after an\n `eager_end_of_turn`. They carry no transcript.\n\n## Text Formatting\nBoth `partial_utterance` and `utterance` payloads contain text that\nhas already been auto-capitalized and auto-punctuated by the model.\nClients can render the `text` field directly without additional\ncasing or punctuation normalization. Note that in `partial_utterance`\nmessages, both capitalization and punctuation in the final words may\nbe revised in subsequent partials as the model sees more audio\ncontext.\n\n## Error Handling\nIf an error occurs during transcription, the server sends an error\nmessage and closes the connection. Connection rejections during\nhandshake use WebSocket close codes (see below).\n\n## WebSocket Close Codes\n- `1000`: Normal closure after the `done` message, or after the\n connection completes.\n- `1003`: Invalid query parameters (missing `audio_format`, invalid\n `sample_rate`, invalid `endpointing`, invalid `diarize`, invalid\n `stable_partials` or `agent_events`, unsupported value, etc.). Also\n returned when `diarize=true` is requested but speaker labelling is not\n enabled on the serving instance, and when `agent_events=true` is\n requested without `endpointing=true`.\n- `1011`: Internal server error. An `error` message is sent before the\n close.\n- `1013`: The service is temporarily at capacity and could not accept\n the connection. An `error` message is sent before the close with the\n text \"The service is temporarily unavailable. Please try again later.\"\n This is not an account or billing condition - retry the connection.\n Note that connections requesting `diarize=true` have a lower\n concurrency ceiling than plain transcription, so a `diarize=true`\n connection may be refused while a plain one succeeds.\n- `4001`: The `api_key` query parameter is missing or invalid.\n- `4002`: Audio data didn't match the declared raw format (sent\n container bytes but declared a raw type), or the audio could not\n be decoded mid-stream. The `error` message is\n \"Audio data does not match the declared audio_format.\" for a declared\n raw format mismatch, or\n \"The audio could not be processed. It may be corrupted or in an unsupported format.\"\n for a mid-stream decode failure.\n- `4003`: The request is not permitted.\n- `4004`: The API key does not have access to this model.\n- `4029`: The request could not be completed due to insufficient\n credits.\n- `4030`: Concurrent request limit reached.\n- `4031`: Monthly usage limit reached.\n","servers":[{"id":"production","protocol":"wss","host":"platform.modulate.ai","bindings":[],"variables":[]}],"address":"/api/velma-2-stt-streaming-english-v2","parameters":[],"bindings":[{"protocol":"ws","version":"latest","value":{"query":{"type":"object","required":["api_key","audio_format"],"properties":{"api_key":{"type":"string","description":"Your API key for authentication. Must be provided as a query\nparameter when establishing the WebSocket connection.\n"},"audio_format":{"type":"string","description":"Container or raw format of the audio data the client will send.\nRequired.\n\nFor container formats, the audio header determines the sample rate\nand channel count, and `sample_rate` / `num_channels` query\nparameters are ignored. The MP4-family values (`mp4`, `m4a`,\n`m4b`, `m4r`, `m4v`, `3gp`, `3gpp`, `3ga`, `3g2`, `f4a`,\n`f4b`) must be sent in a streamable layout;\notherwise the connection ends with an audio-processing error.\n\nFor raw formats, `sample_rate` and `num_channels` are required.\nThe raw `g722` and `vox` formats are additionally mono-only\n(`num_channels` must be `1`).\n\nFor lowest end-to-end latency, send\n`audio_format=s16le\u0026sample_rate=16000\u0026num_channels=1`.\n","enum":["s8","s16le","s16be","s24le","s24be","s32le","s32be","u8","u16le","u16be","u24le","u24be","u32le","u32be","f32le","f32be","f64le","f64be","mulaw","alaw","g722","vox","3g2","3ga","3gp","3gpp","8svx","aa3","aac","ac3","act","adts","aif","aifc","aiff","amb","amr","asf","at3","au","avr","awb","bwf","c2","caf","dss","dts","dtshd","eac3","ec3","f4a","f4b","flac","gsm","iff","m2a","m2ts","m4a","m4b","m4r","m4v","mka","mkv","mlp","mp+","mp1","mp2","mp3","mp4","mpa","mpc","mpga","mpp","mts","oga","ogg","ogx","oma","omg","opus","paf","pvf","qcp","ra","rf64","rm","rmvb","snd","svx","thd","ts","tta","voc","vqf","w64","wav","wave","weba","webm","wma","wmv"]},"sample_rate":{"type":"integer","description":"Source sample rate of the audio data in Hz. Required when\n`audio_format` is a raw type; ignored for container formats.\n","enum":[8000,11025,16000,22050,32000,44100,48000,96000]},"num_channels":{"type":"integer","description":"Number of audio channels in the source data (1-8). Required when\n`audio_format` is a raw type; ignored for container formats.\n","minimum":1,"maximum":8},"endpointing":{"type":"boolean","default":false,"description":"Whether to segment speech into utterances at pauses. Optional;\ndefaults to `false`.\n\nWhen `false` (the default), the connection produces a single\nfinal `utterance` at end-of-stream covering the whole stream\n(`start_ms=0`), and each `partial_utterance` reflects the whole\nstream so far.\n\nWhen `true`, trailing silence after speech closes the current\nutterance and starts a new one: the server emits one final\n`utterance` per speech segment (each with its own `start_ms` /\n`duration_ms`), and each `partial_utterance` reflects the current\nsegment. The full transcript is the concatenation of the final\n`utterance` texts.\n\nIn both modes every connection ends with at least one final\n`utterance`; a stream containing no speech yields a single\nfinal with empty `text`.\n\nIndependent of `diarize`; all combinations are valid.\n\nExample:\n`audio_format=s16le\u0026sample_rate=16000\u0026num_channels=1\u0026endpointing=true`.\n"},"diarize":{"type":"boolean","default":false,"description":"Whether to label which speaker produced each utterance.\nOptional; defaults to `false`.\n\nWhen `false` (the default), no speaker fields appear in any\nmessage and the payloads are byte-identical to a\nnon-diarized connection.\n\nWhen `true`, each final `utterance` additionally carries\n`speaker`, `n_speakers`, `speakers_capped`, and\n`speaker_purity`; see \"Speaker Labels\" above for the speaker\ncapacity and the limits of the `speaker` index, and the\nclose-code list for the handshake rejections and capacity\nbehavior specific to diarized connections.\n\nIndependent of `endpointing`; all combinations are valid.\nSpeaker labels are only meaningful per utterance, however,\nso `diarize=true\u0026endpointing=false` yields one whole-stream\nutterance where `n_speakers` is the useful field rather\nthan `speaker`.\n\nExample:\n`audio_format=s16le\u0026sample_rate=16000\u0026num_channels=1\u0026endpointing=true\u0026diarize=true`.\n"},"time_stamps":{"type":"boolean","default":false,"description":"Whether each final `utterance` carries word-level timings.\nOptional; defaults to `false`.\n\nWhen `false` (the default), no `words` field appears and the\npayloads are unchanged.\n\nWhen `true`, each final `utterance` additionally carries\n`words`: the words of its `text`, in order, each with a start\ntime and duration in milliseconds from the beginning of the\naudio stream. Independent of `endpointing` and `diarize`.\n"},"stable_partials":{"type":"boolean","default":false,"description":"Whether each `partial_utterance` also carries `stable_text`\n(words that will not change before the final) and\n`unstable_text` (the newest words, which may still be\nrevised). Joined with one space they spell `text`. Optional;\ndefaults to `false`, which leaves partials unchanged.\n"},"agent_events":{"type":"boolean","default":false,"description":"Whether to send the turn events `speech_started`,\n`eager_end_of_turn` and `turn_resumed` (see \"Stable Partials\nand Agent Events\") and, on `finalize`, the text recognized so\nfar as a `partial_utterance` at once, before the final.\nRequires `endpointing=true`. Optional; defaults to `false`,\nwhich sends no events.\n"}}}},"schemaProperties":[{"name":"query","type":"object","required":false,"properties":[{"name":"api_key","type":"string","description":"Your API key for authentication. Must be provided as a query\nparameter when establishing the WebSocket connection.\n","required":true},{"name":"audio_format","type":"string","description":"Container or raw format of the audio data the client will send.\nRequired.\n\nFor container formats, the audio header determines the sample rate\nand channel count, and `sample_rate` / `num_channels` query\nparameters are ignored. The MP4-family values (`mp4`, `m4a`,\n`m4b`, `m4r`, `m4v`, `3gp`, `3gpp`, `3ga`, `3g2`, `f4a`,\n`f4b`) must be sent in a streamable layout;\notherwise the connection ends with an audio-processing error.\n\nFor raw formats, `sample_rate` and `num_channels` are required.\nThe raw `g722` and `vox` formats are additionally mono-only\n(`num_channels` must be `1`).\n\nFor lowest end-to-end latency, send\n`audio_format=s16le\u0026sample_rate=16000\u0026num_channels=1`.\n","enumValues":["s8","s16le","s16be","s24le","s24be","s32le","s32be","u8","u16le","u16be","u24le","u24be","u32le","u32be","f32le","f32be","f64le","f64be","mulaw","alaw","g722","vox","3g2","3ga","3gp","3gpp","8svx","aa3","aac","ac3","act","adts","aif","aifc","aiff","amb","amr","asf","at3","au","avr","awb","bwf","c2","caf","dss","dts","dtshd","eac3","ec3","f4a","f4b","flac","gsm","iff","m2a","m2ts","m4a","m4b","m4r","m4v","mka","mkv","mlp","mp+","mp1","mp2","mp3","mp4","mpa","mpc","mpga","mpp","mts","oga","ogg","ogx","oma","omg","opus","paf","pvf","qcp","ra","rf64","rm","rmvb","snd","svx","thd","ts","tta","voc","vqf","w64","wav","wave","weba","webm","wma","wmv"],"required":true},{"name":"sample_rate","type":"integer","description":"Source sample rate of the audio data in Hz. Required when\n`audio_format` is a raw type; ignored for container formats.\n","enumValues":[8000,11025,16000,22050,32000,44100,48000,96000],"required":false},{"name":"num_channels","type":"integer","description":"Number of audio channels in the source data (1-8). Required when\n`audio_format` is a raw type; ignored for container formats.\n","required":false},{"name":"endpointing","type":"boolean","description":"Whether to segment speech into utterances at pauses. Optional;\ndefaults to `false`.\n\nWhen `false` (the default), the connection produces a single\nfinal `utterance` at end-of-stream covering the whole stream\n(`start_ms=0`), and each `partial_utterance` reflects the whole\nstream so far.\n\nWhen `true`, trailing silence after speech closes the current\nutterance and starts a new one: the server emits one final\n`utterance` per speech segment (each with its own `start_ms` /\n`duration_ms`), and each `partial_utterance` reflects the current\nsegment. The full transcript is the concatenation of the final\n`utterance` texts.\n\nIn both modes every connection ends with at least one final\n`utterance`; a stream containing no speech yields a single\nfinal with empty `text`.\n\nIndependent of `diarize`; all combinations are valid.\n\nExample:\n`audio_format=s16le\u0026sample_rate=16000\u0026num_channels=1\u0026endpointing=true`.\n","required":false},{"name":"diarize","type":"boolean","description":"Whether to label which speaker produced each utterance.\nOptional; defaults to `false`.\n\nWhen `false` (the default), no speaker fields appear in any\nmessage and the payloads are byte-identical to a\nnon-diarized connection.\n\nWhen `true`, each final `utterance` additionally carries\n`speaker`, `n_speakers`, `speakers_capped`, and\n`speaker_purity`; see \"Speaker Labels\" above for the speaker\ncapacity and the limits of the `speaker` index, and the\nclose-code list for the handshake rejections and capacity\nbehavior specific to diarized connections.\n\nIndependent of `endpointing`; all combinations are valid.\nSpeaker labels are only meaningful per utterance, however,\nso `diarize=true\u0026endpointing=false` yields one whole-stream\nutterance where `n_speakers` is the useful field rather\nthan `speaker`.\n\nExample:\n`audio_format=s16le\u0026sample_rate=16000\u0026num_channels=1\u0026endpointing=true\u0026diarize=true`.\n","required":false},{"name":"time_stamps","type":"boolean","description":"Whether each final `utterance` carries word-level timings.\nOptional; defaults to `false`.\n\nWhen `false` (the default), no `words` field appears and the\npayloads are unchanged.\n\nWhen `true`, each final `utterance` additionally carries\n`words`: the words of its `text`, in order, each with a start\ntime and duration in milliseconds from the beginning of the\naudio stream. Independent of `endpointing` and `diarize`.\n","required":false},{"name":"stable_partials","type":"boolean","description":"Whether each `partial_utterance` also carries `stable_text`\n(words that will not change before the final) and\n`unstable_text` (the newest words, which may still be\nrevised). Joined with one space they spell `text`. Optional;\ndefaults to `false`, which leaves partials unchanged.\n","required":false},{"name":"agent_events","type":"boolean","description":"Whether to send the turn events `speech_started`,\n`eager_end_of_turn` and `turn_resumed` (see \"Stable Partials\nand Agent Events\") and, on `finalize`, the text recognized so\nfar as a `partial_utterance` at once, before the final.\nRequires `endpointing=true`. Optional; defaults to `false`,\nwhich sends no events.\n","required":false}]}]}],"operations":[{"id":"streamAudio","title":"Stream audio","description":"Stream audio for low-latency English transcription","type":"send","messages":[{"id":"audioChunk","contentType":"application/octet-stream","payload":[{"type":"string","format":"binary","x-parser-schema-id":"\u003canonymous-schema-1>","name":"Audio Data Chunk","description":"Raw audio data chunk for transcription. Sent zero or more times\nby the client during the stream lifetime. Each chunk's bytes are\ndecoded by the server according to the connection's\n`audio_format` query parameter.\n"}],"headers":[],"jsonPayloadSchema":{"type":"string","format":"binary","x-parser-schema-id":"\u003canonymous-schema-1>"},"title":"Audio Data Chunk","description":"Raw audio data chunk for transcription. Sent zero or more times\nby the client during the stream lifetime. Each chunk's bytes are\ndecoded by the server according to the connection's\n`audio_format` query parameter.\n","example":"{}","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"audioChunk"}]},{"id":"finalizeControl","contentType":"application/json","payload":[{"name":"Finalize Now","description":"Text frame asking for the final `utterance` of everything spoken so\nfar, now, without ending the stream. With `agent_events=true`, the\ntext already recognized is sent first as a `partial_utterance`. With\n16 kHz mono s16le, which is passed through undecoded, the final covers\nall audio sent before this message. With any other format (another raw\nencoding, sample rate or channel count, or a container such as ogg,\nwebm or mp3), audio the decoder still holds when the message arrives -\nan incomplete sample frame, codec or resampler output, or container\ndata not yet decoded - begins the next utterance instead; no audio is\nlost.\n","type":"object","properties":[{"name":"type","type":"string","description":"finalize","required":true}]}],"headers":[],"jsonPayloadSchema":{"type":"object","required":["type"],"properties":{"type":{"type":"string","const":"finalize","x-parser-schema-id":"\u003canonymous-schema-3>"}},"x-parser-schema-id":"\u003canonymous-schema-2>"},"title":"Finalize Now","description":"Text frame asking for the final `utterance` of everything spoken so\nfar, now, without ending the stream. With `agent_events=true`, the\ntext already recognized is sent first as a `partial_utterance`. With\n16 kHz mono s16le, which is passed through undecoded, the final covers\nall audio sent before this message. With any other format (another raw\nencoding, sample rate or channel count, or a container such as ogg,\nwebm or mp3), audio the decoder still holds when the message arrives -\nan incomplete sample frame, codec or resampler output, or container\ndata not yet decoded - begins the next utterance instead; no audio is\nlost.\n","example":"{\n \"type\": \"finalize\"\n}","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"finalizeControl"}]},{"id":"endOfStream","contentType":"text/plain","payload":[{"type":"string","const":"","x-parser-schema-id":"\u003canonymous-schema-4>","name":"End of Audio Stream","description":"Empty text frame signaling end of audio. Sent exactly once by the\nclient after the last audio chunk. The server responds with a\nfinal `utterance` message followed by a `done` message, then\ncloses the connection.\n"}],"headers":[],"jsonPayloadSchema":{"type":"string","const":"","x-parser-schema-id":"\u003canonymous-schema-4>"},"title":"End of Audio Stream","description":"Empty text frame signaling end of audio. Sent exactly once by the\nclient after the last audio chunk. The server responds with a\nfinal `utterance` message followed by a `done` message, then\ncloses the connection.\n","example":"\"\"","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"endOfStream"}]}],"bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"velma2SttStreamingEnglishV2"}]},{"id":"receiveTranscription","title":"Receive transcription","description":"Receive partial and final transcription results from the server","type":"receive","messages":[{"id":"partialUtteranceResult","contentType":"application/json","payload":[{"name":"Partial Utterance Result","description":"In-progress transcript snapshot for the CURRENT speech segment. Sent\nzero or more times per segment, roughly every 1.5 seconds. The `text`\nfield contains the current segment's transcript so far - not a delta,\nand not the whole stream - with auto-capitalization and\nauto-punctuation already applied. Clients should REPLACE the current\nsegment's previously displayed partial text, not append. Partials\nnever carry speaker labels, even with `diarize=true`.\n","type":"object","properties":[{"name":"type","type":"string","description":"partial_utterance","required":true},{"name":"partial_utterance","type":"object","required":true,"properties":[{"name":"text","type":"string","description":"The complete transcript built so far for the current scope -\nthe whole connection by default, or the current speech segment\nwhen `endpointing=true` - with auto-capitalization (sentence\ncase, proper nouns, \"I\", etc.) and auto-punctuation (commas,\nperiods, question marks, etc.) already applied by the model.\nThis is NOT a delta from the previous partial - clients should\ndisplay this as a replacement for any previously displayed\npartial text. The last few words, including their\ncapitalization and punctuation, may be revised in subsequent\npartials as the model sees more audio context.\n","required":true},{"name":"is_final","type":"boolean","description":"Always `false` for `partial_utterance` messages. Use the\nmessage `type` field to distinguish partial from final.\n","required":true},{"name":"stable_text","type":"string","description":"Present only with `stable_partials=true`. The words of `text`\nthat will not change before the final.\n","required":false},{"name":"unstable_text","type":"string","description":"Present only with `stable_partials=true`. The newest words of\n`text`, which may still be revised. Joined with `stable_text`\nby one space, they spell `text`.\n","required":false}]}]}],"headers":[],"jsonPayloadSchema":{"type":"object","required":["type","partial_utterance"],"properties":{"type":{"type":"string","const":"partial_utterance","x-parser-schema-id":"\u003canonymous-schema-6>"},"partial_utterance":{"type":"object","required":["text","is_final"],"properties":{"text":{"type":"string","description":"The complete transcript built so far for the current scope -\nthe whole connection by default, or the current speech segment\nwhen `endpointing=true` - with auto-capitalization (sentence\ncase, proper nouns, \"I\", etc.) and auto-punctuation (commas,\nperiods, question marks, etc.) already applied by the model.\nThis is NOT a delta from the previous partial - clients should\ndisplay this as a replacement for any previously displayed\npartial text. The last few words, including their\ncapitalization and punctuation, may be revised in subsequent\npartials as the model sees more audio context.\n","example":"Hello, how are you","x-parser-schema-id":"\u003canonymous-schema-7>"},"is_final":{"type":"boolean","const":false,"description":"Always `false` for `partial_utterance` messages. Use the\nmessage `type` field to distinguish partial from final.\n","x-parser-schema-id":"\u003canonymous-schema-8>"},"stable_text":{"type":"string","description":"Present only with `stable_partials=true`. The words of `text`\nthat will not change before the final.\n","x-parser-schema-id":"\u003canonymous-schema-9>"},"unstable_text":{"type":"string","description":"Present only with `stable_partials=true`. The newest words of\n`text`, which may still be revised. Joined with `stable_text`\nby one space, they spell `text`.\n","x-parser-schema-id":"\u003canonymous-schema-10>"}},"x-parser-schema-id":"StreamingPartialUtterance"}},"x-parser-schema-id":"\u003canonymous-schema-5>"},"title":"Partial Utterance Result","description":"In-progress transcript snapshot for the CURRENT speech segment. Sent\nzero or more times per segment, roughly every 1.5 seconds. The `text`\nfield contains the current segment's transcript so far - not a delta,\nand not the whole stream - with auto-capitalization and\nauto-punctuation already applied. Clients should REPLACE the current\nsegment's previously displayed partial text, not append. Partials\nnever carry speaker labels, even with `diarize=true`.\n","example":"{\n \"type\": \"partial_utterance\",\n \"partial_utterance\": {\n \"text\": \"Hello, how are you\",\n \"is_final\": false\n }\n}","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"partialUtteranceResult"}]},{"id":"utteranceResult","contentType":"application/json","payload":[{"name":"Final Utterance Result","description":"The final transcript for one segment of speech, with\nauto-capitalization and auto-punctuation applied, plus the segment's\nstart time and duration. With `diarize=true` it also carries the\nspeaker who produced it. Sent once per segment (when the segment ends\nat a pause, and once more for the last segment after end-of-stream),\nand supersedes the `partial_utterance` messages for that segment. The\nfull transcript is the concatenation of these texts in order.\n","type":"object","properties":[{"name":"type","type":"string","description":"utterance","required":true},{"name":"utterance","type":"object","required":true,"properties":[{"name":"text","type":"string","description":"The final transcribed text for one segment of speech, with\nauto-capitalization (sentence case, proper nouns, \"I\", etc.) and\nauto-punctuation (commas, periods, question marks, etc.) already\napplied by the model. This is the authoritative transcript for the\nsegment and will not be revised. The full transcript is the\nconcatenation of the `text` of every `utterance` in order.\n","required":true},{"name":"is_final","type":"boolean","description":"Always `true` for `utterance` messages. Use the message `type`\nfield to distinguish partial from final.\n","required":true},{"name":"start_ms","type":"integer","description":"Start time of this segment, in milliseconds from the beginning of\nthe audio stream. Approximate: speech onset is detected at the\nserver's internal processing granularity, so the start may differ\nfrom the first spoken word by a fraction of a second.\n","required":true},{"name":"duration_ms","type":"integer","description":"Duration of this segment's speech, in milliseconds, excluding the\ntrailing pause that ended the segment. Approximate, with the same\nboundary granularity as `start_ms`. With endpointing off, the\nsingle final utterance instead covers the whole stream, including\nany leading and trailing silence.\n","required":true},{"name":"speaker","type":"integer","description":"Present only when `diarize=true`. Zero-based index of the\nspeaker who produced this utterance, stable for the lifetime of\nthe connection but meaningless outside it - the same person on a\nnew connection may receive a different index.\n\n`null` means diarization was requested but no speaker could be\ndetermined for this utterance, which happens for very short or\nsilent segments and for a brand-new voice that has not yet\naccumulated enough evidence to be assigned a label. That is\ndistinct from the field being absent, which means diarization\nwas not requested at all.\n\nWith `endpointing=false` there is a single whole-stream\nutterance that may contain several speakers, so this field is\nindicative only in that mode - read `n_speakers` instead.\n","required":false},{"name":"n_speakers","type":"integer","description":"Present only when `diarize=true`. Count of distinct speakers\ndetected on the connection so far. This is the meaningful\nspeaker signal when `endpointing=false`, where one `speaker`\nindex cannot describe a whole multi-speaker stream.\n","required":false},{"name":"speakers_capped","type":"boolean","description":"Present only when `diarize=true`. `true` once every speaker slot\nis in use, meaning the connection may contain more speakers than\ncan be labeled. Beyond the cap, additional speakers are merged\ninto existing labels rather than reported separately - their\nspeech is still transcribed, but `speaker` will be wrong for\nsome utterances and there is no other signal that this happened.\nClients that act on speaker identity should check this field.\n","required":false},{"name":"speaker_purity","type":"number","description":"Present only when `diarize=true`. The proportion of this\nutterance's speech attributed to the speaker named in\n`speaker`. `1.0` means the utterance was cleanly single-speaker.\nA lower value means the utterance spans a speaker change that\nthe pause-based segmentation did not split, so its single\n`speaker` label describes only the majority of it.\n","required":false},{"name":"words","type":"array","description":"Present only when `time_stamps=true`. The words of `text`, in\norder; joined with single spaces they spell `text` exactly.\nOmitted from an utterance whose word timings are unavailable.\n","required":false,"properties":[{"name":"word","type":"string","description":"The word as it appears in `text`, punctuation included.","required":true},{"name":"start_ms","type":"integer","description":"Start of the word, in milliseconds from the beginning of the\naudio stream. Approximate.\n","required":true},{"name":"duration_ms","type":"integer","description":"Duration of the word, in milliseconds. Approximate.","required":true}]}]}]}],"headers":[],"jsonPayloadSchema":{"type":"object","required":["type","utterance"],"properties":{"type":{"type":"string","const":"utterance","x-parser-schema-id":"\u003canonymous-schema-12>"},"utterance":{"type":"object","required":["text","is_final","start_ms","duration_ms"],"properties":{"text":{"type":"string","description":"The final transcribed text for one segment of speech, with\nauto-capitalization (sentence case, proper nouns, \"I\", etc.) and\nauto-punctuation (commas, periods, question marks, etc.) already\napplied by the model. This is the authoritative transcript for the\nsegment and will not be revised. The full transcript is the\nconcatenation of the `text` of every `utterance` in order.\n","example":"Hello, how are you doing today?","x-parser-schema-id":"\u003canonymous-schema-13>"},"is_final":{"type":"boolean","const":true,"description":"Always `true` for `utterance` messages. Use the message `type`\nfield to distinguish partial from final.\n","x-parser-schema-id":"\u003canonymous-schema-14>"},"start_ms":{"type":"integer","minimum":0,"description":"Start time of this segment, in milliseconds from the beginning of\nthe audio stream. Approximate: speech onset is detected at the\nserver's internal processing granularity, so the start may differ\nfrom the first spoken word by a fraction of a second.\n","example":0,"x-parser-schema-id":"\u003canonymous-schema-15>"},"duration_ms":{"type":"integer","minimum":0,"description":"Duration of this segment's speech, in milliseconds, excluding the\ntrailing pause that ended the segment. Approximate, with the same\nboundary granularity as `start_ms`. With endpointing off, the\nsingle final utterance instead covers the whole stream, including\nany leading and trailing silence.\n","example":2360,"x-parser-schema-id":"\u003canonymous-schema-16>"},"speaker":{"type":"integer","nullable":true,"minimum":0,"description":"Present only when `diarize=true`. Zero-based index of the\nspeaker who produced this utterance, stable for the lifetime of\nthe connection but meaningless outside it - the same person on a\nnew connection may receive a different index.\n\n`null` means diarization was requested but no speaker could be\ndetermined for this utterance, which happens for very short or\nsilent segments and for a brand-new voice that has not yet\naccumulated enough evidence to be assigned a label. That is\ndistinct from the field being absent, which means diarization\nwas not requested at all.\n\nWith `endpointing=false` there is a single whole-stream\nutterance that may contain several speakers, so this field is\nindicative only in that mode - read `n_speakers` instead.\n","example":0,"x-parser-schema-id":"\u003canonymous-schema-17>"},"n_speakers":{"type":"integer","minimum":0,"description":"Present only when `diarize=true`. Count of distinct speakers\ndetected on the connection so far. This is the meaningful\nspeaker signal when `endpointing=false`, where one `speaker`\nindex cannot describe a whole multi-speaker stream.\n","example":2,"x-parser-schema-id":"\u003canonymous-schema-18>"},"speakers_capped":{"type":"boolean","description":"Present only when `diarize=true`. `true` once every speaker slot\nis in use, meaning the connection may contain more speakers than\ncan be labeled. Beyond the cap, additional speakers are merged\ninto existing labels rather than reported separately - their\nspeech is still transcribed, but `speaker` will be wrong for\nsome utterances and there is no other signal that this happened.\nClients that act on speaker identity should check this field.\n","example":false,"x-parser-schema-id":"\u003canonymous-schema-19>"},"speaker_purity":{"type":"number","minimum":0,"maximum":1,"description":"Present only when `diarize=true`. The proportion of this\nutterance's speech attributed to the speaker named in\n`speaker`. `1.0` means the utterance was cleanly single-speaker.\nA lower value means the utterance spans a speaker change that\nthe pause-based segmentation did not split, so its single\n`speaker` label describes only the majority of it.\n","example":1,"x-parser-schema-id":"\u003canonymous-schema-20>"},"words":{"type":"array","description":"Present only when `time_stamps=true`. The words of `text`, in\norder; joined with single spaces they spell `text` exactly.\nOmitted from an utterance whose word timings are unavailable.\n","items":{"type":"object","required":["word","start_ms","duration_ms"],"properties":{"word":{"type":"string","description":"The word as it appears in `text`, punctuation included.","example":"Hello,","x-parser-schema-id":"\u003canonymous-schema-22>"},"start_ms":{"type":"integer","minimum":0,"description":"Start of the word, in milliseconds from the beginning of the\naudio stream. Approximate.\n","example":1000,"x-parser-schema-id":"\u003canonymous-schema-23>"},"duration_ms":{"type":"integer","minimum":0,"description":"Duration of the word, in milliseconds. Approximate.","example":320,"x-parser-schema-id":"\u003canonymous-schema-24>"}},"x-parser-schema-id":"WordTiming"},"x-parser-schema-id":"\u003canonymous-schema-21>"}},"x-parser-schema-id":"StreamingUtterance"}},"x-parser-schema-id":"\u003canonymous-schema-11>"},"title":"Final Utterance Result","description":"The final transcript for one segment of speech, with\nauto-capitalization and auto-punctuation applied, plus the segment's\nstart time and duration. With `diarize=true` it also carries the\nspeaker who produced it. Sent once per segment (when the segment ends\nat a pause, and once more for the last segment after end-of-stream),\nand supersedes the `partial_utterance` messages for that segment. The\nfull transcript is the concatenation of these texts in order.\n","example":"{\n \"type\": \"utterance\",\n \"utterance\": {\n \"text\": \"Hello, how are you doing today?\",\n \"is_final\": true,\n \"start_ms\": 0,\n \"duration_ms\": 2360\n }\n}","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"utteranceResult"}]},{"id":"speechStarted","contentType":"application/json","payload":[{"name":"Speech Started","description":"A segment of speech began. Sent only with `agent_events=true`.\nCarries no transcript.\n","type":"object","properties":[{"name":"type","type":"string","description":"speech_started","required":true},{"name":"speech_started","type":"object","required":true,"properties":[{"name":"start_ms","type":"integer","description":"Where speech began, in milliseconds from the start of the stream.","required":true}]}]}],"headers":[],"jsonPayloadSchema":{"type":"object","required":["type","speech_started"],"properties":{"type":{"type":"string","const":"speech_started","x-parser-schema-id":"\u003canonymous-schema-26>"},"speech_started":{"type":"object","required":["start_ms"],"properties":{"start_ms":{"type":"integer","minimum":0,"description":"Where speech began, in milliseconds from the start of the stream.","x-parser-schema-id":"\u003canonymous-schema-28>"}},"x-parser-schema-id":"\u003canonymous-schema-27>"}},"x-parser-schema-id":"\u003canonymous-schema-25>"},"title":"Speech Started","description":"A segment of speech began. Sent only with `agent_events=true`.\nCarries no transcript.\n","example":"{\n \"type\": \"speech_started\",\n \"speech_started\": {\n \"start_ms\": 12480\n }\n}","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"speechStarted"}]},{"id":"eagerEndOfTurn","contentType":"application/json","payload":[{"name":"Eager End of Turn","description":"The speaker has probably finished their turn, sent before the final\n`utterance` so an agent can start preparing its reply. A\n`turn_resumed` follows if the speaker carries on instead. Sent only\nwith `agent_events=true`.\n","type":"object","properties":[{"name":"type","type":"string","description":"eager_end_of_turn","required":true},{"name":"eager_end_of_turn","type":"object","required":true,"properties":[{"name":"confidence","type":"number","description":"How likely it is that the turn is complete.","required":true},{"name":"end_ms","type":"integer","description":"Where speech stopped, in milliseconds from the start of the stream.","required":true}]}]}],"headers":[],"jsonPayloadSchema":{"type":"object","required":["type","eager_end_of_turn"],"properties":{"type":{"type":"string","const":"eager_end_of_turn","x-parser-schema-id":"\u003canonymous-schema-30>"},"eager_end_of_turn":{"type":"object","required":["confidence","end_ms"],"properties":{"confidence":{"type":"number","minimum":0,"maximum":1,"description":"How likely it is that the turn is complete.","x-parser-schema-id":"\u003canonymous-schema-32>"},"end_ms":{"type":"integer","minimum":0,"description":"Where speech stopped, in milliseconds from the start of the stream.","x-parser-schema-id":"\u003canonymous-schema-33>"}},"x-parser-schema-id":"\u003canonymous-schema-31>"}},"x-parser-schema-id":"\u003canonymous-schema-29>"},"title":"Eager End of Turn","description":"The speaker has probably finished their turn, sent before the final\n`utterance` so an agent can start preparing its reply. A\n`turn_resumed` follows if the speaker carries on instead. Sent only\nwith `agent_events=true`.\n","example":"{\n \"type\": \"eager_end_of_turn\",\n \"eager_end_of_turn\": {\n \"confidence\": 0.87,\n \"end_ms\": 15320\n }\n}","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"eagerEndOfTurn"}]},{"id":"turnResumed","contentType":"application/json","payload":[{"name":"Turn Resumed","description":"The speaker carried on after an `eager_end_of_turn`: the turn is not\nover. Sent only with `agent_events=true`.\n","type":"object","properties":[{"name":"type","type":"string","description":"turn_resumed","required":true},{"name":"turn_resumed","type":"object","required":true,"properties":[{"name":"start_ms","type":"integer","description":"Where speech resumed, in milliseconds from the start of the stream.","required":true}]}]}],"headers":[],"jsonPayloadSchema":{"type":"object","required":["type","turn_resumed"],"properties":{"type":{"type":"string","const":"turn_resumed","x-parser-schema-id":"\u003canonymous-schema-35>"},"turn_resumed":{"type":"object","required":["start_ms"],"properties":{"start_ms":{"type":"integer","minimum":0,"description":"Where speech resumed, in milliseconds from the start of the stream.","x-parser-schema-id":"\u003canonymous-schema-37>"}},"x-parser-schema-id":"\u003canonymous-schema-36>"}},"x-parser-schema-id":"\u003canonymous-schema-34>"},"title":"Turn Resumed","description":"The speaker carried on after an `eager_end_of_turn`: the turn is not\nover. Sent only with `agent_events=true`.\n","example":"{\n \"type\": \"turn_resumed\",\n \"turn_resumed\": {\n \"start_ms\": 15780\n }\n}","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"turnResumed"}]},{"id":"errorResult","contentType":"application/json","payload":[{"name":"Error","description":"An error occurred during transcription. Sent at most once per\nconnection; the WebSocket closes shortly after. No further\nmessages follow an `error`.\n","type":"object","properties":[{"name":"type","type":"string","description":"error","required":true},{"name":"error","type":"string","description":"Human-readable error message","required":true}]}],"headers":[],"jsonPayloadSchema":{"type":"object","required":["type","error"],"properties":{"type":{"type":"string","const":"error","x-parser-schema-id":"\u003canonymous-schema-39>"},"error":{"type":"string","description":"Human-readable error message","x-parser-schema-id":"\u003canonymous-schema-40>"}},"x-parser-schema-id":"\u003canonymous-schema-38>"},"title":"Error","description":"An error occurred during transcription. Sent at most once per\nconnection; the WebSocket closes shortly after. No further\nmessages follow an `error`.\n","example":"{\n \"type\": \"error\",\n \"error\": \"Internal server error\"\n}","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"errorResult"}]},{"id":"doneResult","contentType":"application/json","payload":[{"name":"Transcription Complete","description":"Transcription completed successfully. Sent exactly once, immediately\nafter the final `utterance` message. After this message the server\ncloses the WebSocket.\n","type":"object","properties":[{"name":"type","type":"string","description":"done","required":true},{"name":"duration_ms","type":"integer","description":"Total duration of audio processed in milliseconds","required":true}]}],"headers":[],"jsonPayloadSchema":{"type":"object","required":["type","duration_ms"],"properties":{"type":{"type":"string","const":"done","x-parser-schema-id":"\u003canonymous-schema-42>"},"duration_ms":{"type":"integer","minimum":0,"description":"Total duration of audio processed in milliseconds","x-parser-schema-id":"\u003canonymous-schema-43>"}},"x-parser-schema-id":"\u003canonymous-schema-41>"},"title":"Transcription Complete","description":"Transcription completed successfully. Sent exactly once, immediately\nafter the final `utterance` message. After this message the server\ncloses the WebSocket.\n","example":"{\n \"type\": \"done\",\n \"duration_ms\": 14253\n}","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"doneResult"}]}],"bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"velma2SttStreamingEnglishV2"}]}],"sendOperations":[{"id":"receiveTranscription","title":"Receive transcription","description":"Receive partial and final transcription results from the server","type":"receive","messages":[{"id":"partialUtteranceResult","contentType":"application/json","payload":[{"name":"Partial Utterance Result","description":"In-progress transcript snapshot for the CURRENT speech segment. Sent\nzero or more times per segment, roughly every 1.5 seconds. The `text`\nfield contains the current segment's transcript so far - not a delta,\nand not the whole stream - with auto-capitalization and\nauto-punctuation already applied. Clients should REPLACE the current\nsegment's previously displayed partial text, not append. Partials\nnever carry speaker labels, even with `diarize=true`.\n","type":"object","properties":[{"name":"type","type":"string","description":"partial_utterance","required":true},{"name":"partial_utterance","type":"object","required":true,"properties":[{"name":"text","type":"string","description":"The complete transcript built so far for the current scope -\nthe whole connection by default, or the current speech segment\nwhen `endpointing=true` - with auto-capitalization (sentence\ncase, proper nouns, \"I\", etc.) and auto-punctuation (commas,\nperiods, question marks, etc.) already applied by the model.\nThis is NOT a delta from the previous partial - clients should\ndisplay this as a replacement for any previously displayed\npartial text. The last few words, including their\ncapitalization and punctuation, may be revised in subsequent\npartials as the model sees more audio context.\n","required":true},{"name":"is_final","type":"boolean","description":"Always `false` for `partial_utterance` messages. Use the\nmessage `type` field to distinguish partial from final.\n","required":true},{"name":"stable_text","type":"string","description":"Present only with `stable_partials=true`. The words of `text`\nthat will not change before the final.\n","required":false},{"name":"unstable_text","type":"string","description":"Present only with `stable_partials=true`. The newest words of\n`text`, which may still be revised. Joined with `stable_text`\nby one space, they spell `text`.\n","required":false}]}]}],"headers":[],"jsonPayloadSchema":{"type":"object","required":["type","partial_utterance"],"properties":{"type":{"type":"string","const":"partial_utterance","x-parser-schema-id":"\u003canonymous-schema-6>"},"partial_utterance":{"type":"object","required":["text","is_final"],"properties":{"text":{"type":"string","description":"The complete transcript built so far for the current scope -\nthe whole connection by default, or the current speech segment\nwhen `endpointing=true` - with auto-capitalization (sentence\ncase, proper nouns, \"I\", etc.) and auto-punctuation (commas,\nperiods, question marks, etc.) already applied by the model.\nThis is NOT a delta from the previous partial - clients should\ndisplay this as a replacement for any previously displayed\npartial text. The last few words, including their\ncapitalization and punctuation, may be revised in subsequent\npartials as the model sees more audio context.\n","example":"Hello, how are you","x-parser-schema-id":"\u003canonymous-schema-7>"},"is_final":{"type":"boolean","const":false,"description":"Always `false` for `partial_utterance` messages. Use the\nmessage `type` field to distinguish partial from final.\n","x-parser-schema-id":"\u003canonymous-schema-8>"},"stable_text":{"type":"string","description":"Present only with `stable_partials=true`. The words of `text`\nthat will not change before the final.\n","x-parser-schema-id":"\u003canonymous-schema-9>"},"unstable_text":{"type":"string","description":"Present only with `stable_partials=true`. The newest words of\n`text`, which may still be revised. Joined with `stable_text`\nby one space, they spell `text`.\n","x-parser-schema-id":"\u003canonymous-schema-10>"}},"x-parser-schema-id":"StreamingPartialUtterance"}},"x-parser-schema-id":"\u003canonymous-schema-5>"},"title":"Partial Utterance Result","description":"In-progress transcript snapshot for the CURRENT speech segment. Sent\nzero or more times per segment, roughly every 1.5 seconds. The `text`\nfield contains the current segment's transcript so far - not a delta,\nand not the whole stream - with auto-capitalization and\nauto-punctuation already applied. Clients should REPLACE the current\nsegment's previously displayed partial text, not append. Partials\nnever carry speaker labels, even with `diarize=true`.\n","example":"{\n \"type\": \"partial_utterance\",\n \"partial_utterance\": {\n \"text\": \"Hello, how are you\",\n \"is_final\": false\n }\n}","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"partialUtteranceResult"}]},{"id":"utteranceResult","contentType":"application/json","payload":[{"name":"Final Utterance Result","description":"The final transcript for one segment of speech, with\nauto-capitalization and auto-punctuation applied, plus the segment's\nstart time and duration. With `diarize=true` it also carries the\nspeaker who produced it. Sent once per segment (when the segment ends\nat a pause, and once more for the last segment after end-of-stream),\nand supersedes the `partial_utterance` messages for that segment. The\nfull transcript is the concatenation of these texts in order.\n","type":"object","properties":[{"name":"type","type":"string","description":"utterance","required":true},{"name":"utterance","type":"object","required":true,"properties":[{"name":"text","type":"string","description":"The final transcribed text for one segment of speech, with\nauto-capitalization (sentence case, proper nouns, \"I\", etc.) and\nauto-punctuation (commas, periods, question marks, etc.) already\napplied by the model. This is the authoritative transcript for the\nsegment and will not be revised. The full transcript is the\nconcatenation of the `text` of every `utterance` in order.\n","required":true},{"name":"is_final","type":"boolean","description":"Always `true` for `utterance` messages. Use the message `type`\nfield to distinguish partial from final.\n","required":true},{"name":"start_ms","type":"integer","description":"Start time of this segment, in milliseconds from the beginning of\nthe audio stream. Approximate: speech onset is detected at the\nserver's internal processing granularity, so the start may differ\nfrom the first spoken word by a fraction of a second.\n","required":true},{"name":"duration_ms","type":"integer","description":"Duration of this segment's speech, in milliseconds, excluding the\ntrailing pause that ended the segment. Approximate, with the same\nboundary granularity as `start_ms`. With endpointing off, the\nsingle final utterance instead covers the whole stream, including\nany leading and trailing silence.\n","required":true},{"name":"speaker","type":"integer","description":"Present only when `diarize=true`. Zero-based index of the\nspeaker who produced this utterance, stable for the lifetime of\nthe connection but meaningless outside it - the same person on a\nnew connection may receive a different index.\n\n`null` means diarization was requested but no speaker could be\ndetermined for this utterance, which happens for very short or\nsilent segments and for a brand-new voice that has not yet\naccumulated enough evidence to be assigned a label. That is\ndistinct from the field being absent, which means diarization\nwas not requested at all.\n\nWith `endpointing=false` there is a single whole-stream\nutterance that may contain several speakers, so this field is\nindicative only in that mode - read `n_speakers` instead.\n","required":false},{"name":"n_speakers","type":"integer","description":"Present only when `diarize=true`. Count of distinct speakers\ndetected on the connection so far. This is the meaningful\nspeaker signal when `endpointing=false`, where one `speaker`\nindex cannot describe a whole multi-speaker stream.\n","required":false},{"name":"speakers_capped","type":"boolean","description":"Present only when `diarize=true`. `true` once every speaker slot\nis in use, meaning the connection may contain more speakers than\ncan be labeled. Beyond the cap, additional speakers are merged\ninto existing labels rather than reported separately - their\nspeech is still transcribed, but `speaker` will be wrong for\nsome utterances and there is no other signal that this happened.\nClients that act on speaker identity should check this field.\n","required":false},{"name":"speaker_purity","type":"number","description":"Present only when `diarize=true`. The proportion of this\nutterance's speech attributed to the speaker named in\n`speaker`. `1.0` means the utterance was cleanly single-speaker.\nA lower value means the utterance spans a speaker change that\nthe pause-based segmentation did not split, so its single\n`speaker` label describes only the majority of it.\n","required":false},{"name":"words","type":"array","description":"Present only when `time_stamps=true`. The words of `text`, in\norder; joined with single spaces they spell `text` exactly.\nOmitted from an utterance whose word timings are unavailable.\n","required":false,"properties":[{"name":"word","type":"string","description":"The word as it appears in `text`, punctuation included.","required":true},{"name":"start_ms","type":"integer","description":"Start of the word, in milliseconds from the beginning of the\naudio stream. Approximate.\n","required":true},{"name":"duration_ms","type":"integer","description":"Duration of the word, in milliseconds. Approximate.","required":true}]}]}]}],"headers":[],"jsonPayloadSchema":{"type":"object","required":["type","utterance"],"properties":{"type":{"type":"string","const":"utterance","x-parser-schema-id":"\u003canonymous-schema-12>"},"utterance":{"type":"object","required":["text","is_final","start_ms","duration_ms"],"properties":{"text":{"type":"string","description":"The final transcribed text for one segment of speech, with\nauto-capitalization (sentence case, proper nouns, \"I\", etc.) and\nauto-punctuation (commas, periods, question marks, etc.) already\napplied by the model. This is the authoritative transcript for the\nsegment and will not be revised. The full transcript is the\nconcatenation of the `text` of every `utterance` in order.\n","example":"Hello, how are you doing today?","x-parser-schema-id":"\u003canonymous-schema-13>"},"is_final":{"type":"boolean","const":true,"description":"Always `true` for `utterance` messages. Use the message `type`\nfield to distinguish partial from final.\n","x-parser-schema-id":"\u003canonymous-schema-14>"},"start_ms":{"type":"integer","minimum":0,"description":"Start time of this segment, in milliseconds from the beginning of\nthe audio stream. Approximate: speech onset is detected at the\nserver's internal processing granularity, so the start may differ\nfrom the first spoken word by a fraction of a second.\n","example":0,"x-parser-schema-id":"\u003canonymous-schema-15>"},"duration_ms":{"type":"integer","minimum":0,"description":"Duration of this segment's speech, in milliseconds, excluding the\ntrailing pause that ended the segment. Approximate, with the same\nboundary granularity as `start_ms`. With endpointing off, the\nsingle final utterance instead covers the whole stream, including\nany leading and trailing silence.\n","example":2360,"x-parser-schema-id":"\u003canonymous-schema-16>"},"speaker":{"type":"integer","nullable":true,"minimum":0,"description":"Present only when `diarize=true`. Zero-based index of the\nspeaker who produced this utterance, stable for the lifetime of\nthe connection but meaningless outside it - the same person on a\nnew connection may receive a different index.\n\n`null` means diarization was requested but no speaker could be\ndetermined for this utterance, which happens for very short or\nsilent segments and for a brand-new voice that has not yet\naccumulated enough evidence to be assigned a label. That is\ndistinct from the field being absent, which means diarization\nwas not requested at all.\n\nWith `endpointing=false` there is a single whole-stream\nutterance that may contain several speakers, so this field is\nindicative only in that mode - read `n_speakers` instead.\n","example":0,"x-parser-schema-id":"\u003canonymous-schema-17>"},"n_speakers":{"type":"integer","minimum":0,"description":"Present only when `diarize=true`. Count of distinct speakers\ndetected on the connection so far. This is the meaningful\nspeaker signal when `endpointing=false`, where one `speaker`\nindex cannot describe a whole multi-speaker stream.\n","example":2,"x-parser-schema-id":"\u003canonymous-schema-18>"},"speakers_capped":{"type":"boolean","description":"Present only when `diarize=true`. `true` once every speaker slot\nis in use, meaning the connection may contain more speakers than\ncan be labeled. Beyond the cap, additional speakers are merged\ninto existing labels rather than reported separately - their\nspeech is still transcribed, but `speaker` will be wrong for\nsome utterances and there is no other signal that this happened.\nClients that act on speaker identity should check this field.\n","example":false,"x-parser-schema-id":"\u003canonymous-schema-19>"},"speaker_purity":{"type":"number","minimum":0,"maximum":1,"description":"Present only when `diarize=true`. The proportion of this\nutterance's speech attributed to the speaker named in\n`speaker`. `1.0` means the utterance was cleanly single-speaker.\nA lower value means the utterance spans a speaker change that\nthe pause-based segmentation did not split, so its single\n`speaker` label describes only the majority of it.\n","example":1,"x-parser-schema-id":"\u003canonymous-schema-20>"},"words":{"type":"array","description":"Present only when `time_stamps=true`. The words of `text`, in\norder; joined with single spaces they spell `text` exactly.\nOmitted from an utterance whose word timings are unavailable.\n","items":{"type":"object","required":["word","start_ms","duration_ms"],"properties":{"word":{"type":"string","description":"The word as it appears in `text`, punctuation included.","example":"Hello,","x-parser-schema-id":"\u003canonymous-schema-22>"},"start_ms":{"type":"integer","minimum":0,"description":"Start of the word, in milliseconds from the beginning of the\naudio stream. Approximate.\n","example":1000,"x-parser-schema-id":"\u003canonymous-schema-23>"},"duration_ms":{"type":"integer","minimum":0,"description":"Duration of the word, in milliseconds. Approximate.","example":320,"x-parser-schema-id":"\u003canonymous-schema-24>"}},"x-parser-schema-id":"WordTiming"},"x-parser-schema-id":"\u003canonymous-schema-21>"}},"x-parser-schema-id":"StreamingUtterance"}},"x-parser-schema-id":"\u003canonymous-schema-11>"},"title":"Final Utterance Result","description":"The final transcript for one segment of speech, with\nauto-capitalization and auto-punctuation applied, plus the segment's\nstart time and duration. With `diarize=true` it also carries the\nspeaker who produced it. Sent once per segment (when the segment ends\nat a pause, and once more for the last segment after end-of-stream),\nand supersedes the `partial_utterance` messages for that segment. The\nfull transcript is the concatenation of these texts in order.\n","example":"{\n \"type\": \"utterance\",\n \"utterance\": {\n \"text\": \"Hello, how are you doing today?\",\n \"is_final\": true,\n \"start_ms\": 0,\n \"duration_ms\": 2360\n }\n}","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"utteranceResult"}]},{"id":"speechStarted","contentType":"application/json","payload":[{"name":"Speech Started","description":"A segment of speech began. Sent only with `agent_events=true`.\nCarries no transcript.\n","type":"object","properties":[{"name":"type","type":"string","description":"speech_started","required":true},{"name":"speech_started","type":"object","required":true,"properties":[{"name":"start_ms","type":"integer","description":"Where speech began, in milliseconds from the start of the stream.","required":true}]}]}],"headers":[],"jsonPayloadSchema":{"type":"object","required":["type","speech_started"],"properties":{"type":{"type":"string","const":"speech_started","x-parser-schema-id":"\u003canonymous-schema-26>"},"speech_started":{"type":"object","required":["start_ms"],"properties":{"start_ms":{"type":"integer","minimum":0,"description":"Where speech began, in milliseconds from the start of the stream.","x-parser-schema-id":"\u003canonymous-schema-28>"}},"x-parser-schema-id":"\u003canonymous-schema-27>"}},"x-parser-schema-id":"\u003canonymous-schema-25>"},"title":"Speech Started","description":"A segment of speech began. Sent only with `agent_events=true`.\nCarries no transcript.\n","example":"{\n \"type\": \"speech_started\",\n \"speech_started\": {\n \"start_ms\": 12480\n }\n}","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"speechStarted"}]},{"id":"eagerEndOfTurn","contentType":"application/json","payload":[{"name":"Eager End of Turn","description":"The speaker has probably finished their turn, sent before the final\n`utterance` so an agent can start preparing its reply. A\n`turn_resumed` follows if the speaker carries on instead. Sent only\nwith `agent_events=true`.\n","type":"object","properties":[{"name":"type","type":"string","description":"eager_end_of_turn","required":true},{"name":"eager_end_of_turn","type":"object","required":true,"properties":[{"name":"confidence","type":"number","description":"How likely it is that the turn is complete.","required":true},{"name":"end_ms","type":"integer","description":"Where speech stopped, in milliseconds from the start of the stream.","required":true}]}]}],"headers":[],"jsonPayloadSchema":{"type":"object","required":["type","eager_end_of_turn"],"properties":{"type":{"type":"string","const":"eager_end_of_turn","x-parser-schema-id":"\u003canonymous-schema-30>"},"eager_end_of_turn":{"type":"object","required":["confidence","end_ms"],"properties":{"confidence":{"type":"number","minimum":0,"maximum":1,"description":"How likely it is that the turn is complete.","x-parser-schema-id":"\u003canonymous-schema-32>"},"end_ms":{"type":"integer","minimum":0,"description":"Where speech stopped, in milliseconds from the start of the stream.","x-parser-schema-id":"\u003canonymous-schema-33>"}},"x-parser-schema-id":"\u003canonymous-schema-31>"}},"x-parser-schema-id":"\u003canonymous-schema-29>"},"title":"Eager End of Turn","description":"The speaker has probably finished their turn, sent before the final\n`utterance` so an agent can start preparing its reply. A\n`turn_resumed` follows if the speaker carries on instead. Sent only\nwith `agent_events=true`.\n","example":"{\n \"type\": \"eager_end_of_turn\",\n \"eager_end_of_turn\": {\n \"confidence\": 0.87,\n \"end_ms\": 15320\n }\n}","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"eagerEndOfTurn"}]},{"id":"turnResumed","contentType":"application/json","payload":[{"name":"Turn Resumed","description":"The speaker carried on after an `eager_end_of_turn`: the turn is not\nover. Sent only with `agent_events=true`.\n","type":"object","properties":[{"name":"type","type":"string","description":"turn_resumed","required":true},{"name":"turn_resumed","type":"object","required":true,"properties":[{"name":"start_ms","type":"integer","description":"Where speech resumed, in milliseconds from the start of the stream.","required":true}]}]}],"headers":[],"jsonPayloadSchema":{"type":"object","required":["type","turn_resumed"],"properties":{"type":{"type":"string","const":"turn_resumed","x-parser-schema-id":"\u003canonymous-schema-35>"},"turn_resumed":{"type":"object","required":["start_ms"],"properties":{"start_ms":{"type":"integer","minimum":0,"description":"Where speech resumed, in milliseconds from the start of the stream.","x-parser-schema-id":"\u003canonymous-schema-37>"}},"x-parser-schema-id":"\u003canonymous-schema-36>"}},"x-parser-schema-id":"\u003canonymous-schema-34>"},"title":"Turn Resumed","description":"The speaker carried on after an `eager_end_of_turn`: the turn is not\nover. Sent only with `agent_events=true`.\n","example":"{\n \"type\": \"turn_resumed\",\n \"turn_resumed\": {\n \"start_ms\": 15780\n }\n}","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"turnResumed"}]},{"id":"errorResult","contentType":"application/json","payload":[{"name":"Error","description":"An error occurred during transcription. Sent at most once per\nconnection; the WebSocket closes shortly after. No further\nmessages follow an `error`.\n","type":"object","properties":[{"name":"type","type":"string","description":"error","required":true},{"name":"error","type":"string","description":"Human-readable error message","required":true}]}],"headers":[],"jsonPayloadSchema":{"type":"object","required":["type","error"],"properties":{"type":{"type":"string","const":"error","x-parser-schema-id":"\u003canonymous-schema-39>"},"error":{"type":"string","description":"Human-readable error message","x-parser-schema-id":"\u003canonymous-schema-40>"}},"x-parser-schema-id":"\u003canonymous-schema-38>"},"title":"Error","description":"An error occurred during transcription. Sent at most once per\nconnection; the WebSocket closes shortly after. No further\nmessages follow an `error`.\n","example":"{\n \"type\": \"error\",\n \"error\": \"Internal server error\"\n}","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"errorResult"}]},{"id":"doneResult","contentType":"application/json","payload":[{"name":"Transcription Complete","description":"Transcription completed successfully. Sent exactly once, immediately\nafter the final `utterance` message. After this message the server\ncloses the WebSocket.\n","type":"object","properties":[{"name":"type","type":"string","description":"done","required":true},{"name":"duration_ms","type":"integer","description":"Total duration of audio processed in milliseconds","required":true}]}],"headers":[],"jsonPayloadSchema":{"type":"object","required":["type","duration_ms"],"properties":{"type":{"type":"string","const":"done","x-parser-schema-id":"\u003canonymous-schema-42>"},"duration_ms":{"type":"integer","minimum":0,"description":"Total duration of audio processed in milliseconds","x-parser-schema-id":"\u003canonymous-schema-43>"}},"x-parser-schema-id":"\u003canonymous-schema-41>"},"title":"Transcription Complete","description":"Transcription completed successfully. Sent exactly once, immediately\nafter the final `utterance` message. After this message the server\ncloses the WebSocket.\n","example":"{\n \"type\": \"done\",\n \"duration_ms\": 14253\n}","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"doneResult"}]}],"bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"velma2SttStreamingEnglishV2"}]}],"receiveOperations":[{"id":"streamAudio","title":"Stream audio","description":"Stream audio for low-latency English transcription","type":"send","messages":[{"id":"audioChunk","contentType":"application/octet-stream","payload":[{"type":"string","format":"binary","x-parser-schema-id":"\u003canonymous-schema-1>","name":"Audio Data Chunk","description":"Raw audio data chunk for transcription. Sent zero or more times\nby the client during the stream lifetime. Each chunk's bytes are\ndecoded by the server according to the connection's\n`audio_format` query parameter.\n"}],"headers":[],"jsonPayloadSchema":{"type":"string","format":"binary","x-parser-schema-id":"\u003canonymous-schema-1>"},"title":"Audio Data Chunk","description":"Raw audio data chunk for transcription. Sent zero or more times\nby the client during the stream lifetime. Each chunk's bytes are\ndecoded by the server according to the connection's\n`audio_format` query parameter.\n","example":"{}","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"audioChunk"}]},{"id":"finalizeControl","contentType":"application/json","payload":[{"name":"Finalize Now","description":"Text frame asking for the final `utterance` of everything spoken so\nfar, now, without ending the stream. With `agent_events=true`, the\ntext already recognized is sent first as a `partial_utterance`. With\n16 kHz mono s16le, which is passed through undecoded, the final covers\nall audio sent before this message. With any other format (another raw\nencoding, sample rate or channel count, or a container such as ogg,\nwebm or mp3), audio the decoder still holds when the message arrives -\nan incomplete sample frame, codec or resampler output, or container\ndata not yet decoded - begins the next utterance instead; no audio is\nlost.\n","type":"object","properties":[{"name":"type","type":"string","description":"finalize","required":true}]}],"headers":[],"jsonPayloadSchema":{"type":"object","required":["type"],"properties":{"type":{"type":"string","const":"finalize","x-parser-schema-id":"\u003canonymous-schema-3>"}},"x-parser-schema-id":"\u003canonymous-schema-2>"},"title":"Finalize Now","description":"Text frame asking for the final `utterance` of everything spoken so\nfar, now, without ending the stream. With `agent_events=true`, the\ntext already recognized is sent first as a `partial_utterance`. With\n16 kHz mono s16le, which is passed through undecoded, the final covers\nall audio sent before this message. With any other format (another raw\nencoding, sample rate or channel count, or a container such as ogg,\nwebm or mp3), audio the decoder still holds when the message arrives -\nan incomplete sample frame, codec or resampler output, or container\ndata not yet decoded - begins the next utterance instead; no audio is\nlost.\n","example":"{\n \"type\": \"finalize\"\n}","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"finalizeControl"}]},{"id":"endOfStream","contentType":"text/plain","payload":[{"type":"string","const":"","x-parser-schema-id":"\u003canonymous-schema-4>","name":"End of Audio Stream","description":"Empty text frame signaling end of audio. Sent exactly once by the\nclient after the last audio chunk. The server responds with a\nfinal `utterance` message followed by a `done` message, then\ncloses the connection.\n"}],"headers":[],"jsonPayloadSchema":{"type":"string","const":"","x-parser-schema-id":"\u003canonymous-schema-4>"},"title":"End of Audio Stream","description":"Empty text frame signaling end of audio. Sent exactly once by the\nclient after the last audio chunk. The server responds with a\nfinal `utterance` message followed by a `done` message, then\ncloses the connection.\n","example":"\"\"","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"endOfStream"}]}],"bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"velma2SttStreamingEnglishV2"}]}],"sendMessages":[{"id":"partialUtteranceResult","contentType":"application/json","payload":[{"name":"Partial Utterance Result","description":"In-progress transcript snapshot for the CURRENT speech segment. Sent\nzero or more times per segment, roughly every 1.5 seconds. The `text`\nfield contains the current segment's transcript so far - not a delta,\nand not the whole stream - with auto-capitalization and\nauto-punctuation already applied. Clients should REPLACE the current\nsegment's previously displayed partial text, not append. Partials\nnever carry speaker labels, even with `diarize=true`.\n","type":"object","properties":[{"name":"type","type":"string","description":"partial_utterance","required":true},{"name":"partial_utterance","type":"object","required":true,"properties":[{"name":"text","type":"string","description":"The complete transcript built so far for the current scope -\nthe whole connection by default, or the current speech segment\nwhen `endpointing=true` - with auto-capitalization (sentence\ncase, proper nouns, \"I\", etc.) and auto-punctuation (commas,\nperiods, question marks, etc.) already applied by the model.\nThis is NOT a delta from the previous partial - clients should\ndisplay this as a replacement for any previously displayed\npartial text. The last few words, including their\ncapitalization and punctuation, may be revised in subsequent\npartials as the model sees more audio context.\n","required":true},{"name":"is_final","type":"boolean","description":"Always `false` for `partial_utterance` messages. Use the\nmessage `type` field to distinguish partial from final.\n","required":true},{"name":"stable_text","type":"string","description":"Present only with `stable_partials=true`. The words of `text`\nthat will not change before the final.\n","required":false},{"name":"unstable_text","type":"string","description":"Present only with `stable_partials=true`. The newest words of\n`text`, which may still be revised. Joined with `stable_text`\nby one space, they spell `text`.\n","required":false}]}]}],"headers":[],"jsonPayloadSchema":{"type":"object","required":["type","partial_utterance"],"properties":{"type":{"type":"string","const":"partial_utterance","x-parser-schema-id":"\u003canonymous-schema-6>"},"partial_utterance":{"type":"object","required":["text","is_final"],"properties":{"text":{"type":"string","description":"The complete transcript built so far for the current scope -\nthe whole connection by default, or the current speech segment\nwhen `endpointing=true` - with auto-capitalization (sentence\ncase, proper nouns, \"I\", etc.) and auto-punctuation (commas,\nperiods, question marks, etc.) already applied by the model.\nThis is NOT a delta from the previous partial - clients should\ndisplay this as a replacement for any previously displayed\npartial text. The last few words, including their\ncapitalization and punctuation, may be revised in subsequent\npartials as the model sees more audio context.\n","example":"Hello, how are you","x-parser-schema-id":"\u003canonymous-schema-7>"},"is_final":{"type":"boolean","const":false,"description":"Always `false` for `partial_utterance` messages. Use the\nmessage `type` field to distinguish partial from final.\n","x-parser-schema-id":"\u003canonymous-schema-8>"},"stable_text":{"type":"string","description":"Present only with `stable_partials=true`. The words of `text`\nthat will not change before the final.\n","x-parser-schema-id":"\u003canonymous-schema-9>"},"unstable_text":{"type":"string","description":"Present only with `stable_partials=true`. The newest words of\n`text`, which may still be revised. Joined with `stable_text`\nby one space, they spell `text`.\n","x-parser-schema-id":"\u003canonymous-schema-10>"}},"x-parser-schema-id":"StreamingPartialUtterance"}},"x-parser-schema-id":"\u003canonymous-schema-5>"},"title":"Partial Utterance Result","description":"In-progress transcript snapshot for the CURRENT speech segment. Sent\nzero or more times per segment, roughly every 1.5 seconds. The `text`\nfield contains the current segment's transcript so far - not a delta,\nand not the whole stream - with auto-capitalization and\nauto-punctuation already applied. Clients should REPLACE the current\nsegment's previously displayed partial text, not append. Partials\nnever carry speaker labels, even with `diarize=true`.\n","example":"{\n \"type\": \"partial_utterance\",\n \"partial_utterance\": {\n \"text\": \"Hello, how are you\",\n \"is_final\": false\n }\n}","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"partialUtteranceResult"}]},{"id":"utteranceResult","contentType":"application/json","payload":[{"name":"Final Utterance Result","description":"The final transcript for one segment of speech, with\nauto-capitalization and auto-punctuation applied, plus the segment's\nstart time and duration. With `diarize=true` it also carries the\nspeaker who produced it. Sent once per segment (when the segment ends\nat a pause, and once more for the last segment after end-of-stream),\nand supersedes the `partial_utterance` messages for that segment. The\nfull transcript is the concatenation of these texts in order.\n","type":"object","properties":[{"name":"type","type":"string","description":"utterance","required":true},{"name":"utterance","type":"object","required":true,"properties":[{"name":"text","type":"string","description":"The final transcribed text for one segment of speech, with\nauto-capitalization (sentence case, proper nouns, \"I\", etc.) and\nauto-punctuation (commas, periods, question marks, etc.) already\napplied by the model. This is the authoritative transcript for the\nsegment and will not be revised. The full transcript is the\nconcatenation of the `text` of every `utterance` in order.\n","required":true},{"name":"is_final","type":"boolean","description":"Always `true` for `utterance` messages. Use the message `type`\nfield to distinguish partial from final.\n","required":true},{"name":"start_ms","type":"integer","description":"Start time of this segment, in milliseconds from the beginning of\nthe audio stream. Approximate: speech onset is detected at the\nserver's internal processing granularity, so the start may differ\nfrom the first spoken word by a fraction of a second.\n","required":true},{"name":"duration_ms","type":"integer","description":"Duration of this segment's speech, in milliseconds, excluding the\ntrailing pause that ended the segment. Approximate, with the same\nboundary granularity as `start_ms`. With endpointing off, the\nsingle final utterance instead covers the whole stream, including\nany leading and trailing silence.\n","required":true},{"name":"speaker","type":"integer","description":"Present only when `diarize=true`. Zero-based index of the\nspeaker who produced this utterance, stable for the lifetime of\nthe connection but meaningless outside it - the same person on a\nnew connection may receive a different index.\n\n`null` means diarization was requested but no speaker could be\ndetermined for this utterance, which happens for very short or\nsilent segments and for a brand-new voice that has not yet\naccumulated enough evidence to be assigned a label. That is\ndistinct from the field being absent, which means diarization\nwas not requested at all.\n\nWith `endpointing=false` there is a single whole-stream\nutterance that may contain several speakers, so this field is\nindicative only in that mode - read `n_speakers` instead.\n","required":false},{"name":"n_speakers","type":"integer","description":"Present only when `diarize=true`. Count of distinct speakers\ndetected on the connection so far. This is the meaningful\nspeaker signal when `endpointing=false`, where one `speaker`\nindex cannot describe a whole multi-speaker stream.\n","required":false},{"name":"speakers_capped","type":"boolean","description":"Present only when `diarize=true`. `true` once every speaker slot\nis in use, meaning the connection may contain more speakers than\ncan be labeled. Beyond the cap, additional speakers are merged\ninto existing labels rather than reported separately - their\nspeech is still transcribed, but `speaker` will be wrong for\nsome utterances and there is no other signal that this happened.\nClients that act on speaker identity should check this field.\n","required":false},{"name":"speaker_purity","type":"number","description":"Present only when `diarize=true`. The proportion of this\nutterance's speech attributed to the speaker named in\n`speaker`. `1.0` means the utterance was cleanly single-speaker.\nA lower value means the utterance spans a speaker change that\nthe pause-based segmentation did not split, so its single\n`speaker` label describes only the majority of it.\n","required":false},{"name":"words","type":"array","description":"Present only when `time_stamps=true`. The words of `text`, in\norder; joined with single spaces they spell `text` exactly.\nOmitted from an utterance whose word timings are unavailable.\n","required":false,"properties":[{"name":"word","type":"string","description":"The word as it appears in `text`, punctuation included.","required":true},{"name":"start_ms","type":"integer","description":"Start of the word, in milliseconds from the beginning of the\naudio stream. Approximate.\n","required":true},{"name":"duration_ms","type":"integer","description":"Duration of the word, in milliseconds. Approximate.","required":true}]}]}]}],"headers":[],"jsonPayloadSchema":{"type":"object","required":["type","utterance"],"properties":{"type":{"type":"string","const":"utterance","x-parser-schema-id":"\u003canonymous-schema-12>"},"utterance":{"type":"object","required":["text","is_final","start_ms","duration_ms"],"properties":{"text":{"type":"string","description":"The final transcribed text for one segment of speech, with\nauto-capitalization (sentence case, proper nouns, \"I\", etc.) and\nauto-punctuation (commas, periods, question marks, etc.) already\napplied by the model. This is the authoritative transcript for the\nsegment and will not be revised. The full transcript is the\nconcatenation of the `text` of every `utterance` in order.\n","example":"Hello, how are you doing today?","x-parser-schema-id":"\u003canonymous-schema-13>"},"is_final":{"type":"boolean","const":true,"description":"Always `true` for `utterance` messages. Use the message `type`\nfield to distinguish partial from final.\n","x-parser-schema-id":"\u003canonymous-schema-14>"},"start_ms":{"type":"integer","minimum":0,"description":"Start time of this segment, in milliseconds from the beginning of\nthe audio stream. Approximate: speech onset is detected at the\nserver's internal processing granularity, so the start may differ\nfrom the first spoken word by a fraction of a second.\n","example":0,"x-parser-schema-id":"\u003canonymous-schema-15>"},"duration_ms":{"type":"integer","minimum":0,"description":"Duration of this segment's speech, in milliseconds, excluding the\ntrailing pause that ended the segment. Approximate, with the same\nboundary granularity as `start_ms`. With endpointing off, the\nsingle final utterance instead covers the whole stream, including\nany leading and trailing silence.\n","example":2360,"x-parser-schema-id":"\u003canonymous-schema-16>"},"speaker":{"type":"integer","nullable":true,"minimum":0,"description":"Present only when `diarize=true`. Zero-based index of the\nspeaker who produced this utterance, stable for the lifetime of\nthe connection but meaningless outside it - the same person on a\nnew connection may receive a different index.\n\n`null` means diarization was requested but no speaker could be\ndetermined for this utterance, which happens for very short or\nsilent segments and for a brand-new voice that has not yet\naccumulated enough evidence to be assigned a label. That is\ndistinct from the field being absent, which means diarization\nwas not requested at all.\n\nWith `endpointing=false` there is a single whole-stream\nutterance that may contain several speakers, so this field is\nindicative only in that mode - read `n_speakers` instead.\n","example":0,"x-parser-schema-id":"\u003canonymous-schema-17>"},"n_speakers":{"type":"integer","minimum":0,"description":"Present only when `diarize=true`. Count of distinct speakers\ndetected on the connection so far. This is the meaningful\nspeaker signal when `endpointing=false`, where one `speaker`\nindex cannot describe a whole multi-speaker stream.\n","example":2,"x-parser-schema-id":"\u003canonymous-schema-18>"},"speakers_capped":{"type":"boolean","description":"Present only when `diarize=true`. `true` once every speaker slot\nis in use, meaning the connection may contain more speakers than\ncan be labeled. Beyond the cap, additional speakers are merged\ninto existing labels rather than reported separately - their\nspeech is still transcribed, but `speaker` will be wrong for\nsome utterances and there is no other signal that this happened.\nClients that act on speaker identity should check this field.\n","example":false,"x-parser-schema-id":"\u003canonymous-schema-19>"},"speaker_purity":{"type":"number","minimum":0,"maximum":1,"description":"Present only when `diarize=true`. The proportion of this\nutterance's speech attributed to the speaker named in\n`speaker`. `1.0` means the utterance was cleanly single-speaker.\nA lower value means the utterance spans a speaker change that\nthe pause-based segmentation did not split, so its single\n`speaker` label describes only the majority of it.\n","example":1,"x-parser-schema-id":"\u003canonymous-schema-20>"},"words":{"type":"array","description":"Present only when `time_stamps=true`. The words of `text`, in\norder; joined with single spaces they spell `text` exactly.\nOmitted from an utterance whose word timings are unavailable.\n","items":{"type":"object","required":["word","start_ms","duration_ms"],"properties":{"word":{"type":"string","description":"The word as it appears in `text`, punctuation included.","example":"Hello,","x-parser-schema-id":"\u003canonymous-schema-22>"},"start_ms":{"type":"integer","minimum":0,"description":"Start of the word, in milliseconds from the beginning of the\naudio stream. Approximate.\n","example":1000,"x-parser-schema-id":"\u003canonymous-schema-23>"},"duration_ms":{"type":"integer","minimum":0,"description":"Duration of the word, in milliseconds. Approximate.","example":320,"x-parser-schema-id":"\u003canonymous-schema-24>"}},"x-parser-schema-id":"WordTiming"},"x-parser-schema-id":"\u003canonymous-schema-21>"}},"x-parser-schema-id":"StreamingUtterance"}},"x-parser-schema-id":"\u003canonymous-schema-11>"},"title":"Final Utterance Result","description":"The final transcript for one segment of speech, with\nauto-capitalization and auto-punctuation applied, plus the segment's\nstart time and duration. With `diarize=true` it also carries the\nspeaker who produced it. Sent once per segment (when the segment ends\nat a pause, and once more for the last segment after end-of-stream),\nand supersedes the `partial_utterance` messages for that segment. The\nfull transcript is the concatenation of these texts in order.\n","example":"{\n \"type\": \"utterance\",\n \"utterance\": {\n \"text\": \"Hello, how are you doing today?\",\n \"is_final\": true,\n \"start_ms\": 0,\n \"duration_ms\": 2360\n }\n}","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"utteranceResult"}]},{"id":"speechStarted","contentType":"application/json","payload":[{"name":"Speech Started","description":"A segment of speech began. Sent only with `agent_events=true`.\nCarries no transcript.\n","type":"object","properties":[{"name":"type","type":"string","description":"speech_started","required":true},{"name":"speech_started","type":"object","required":true,"properties":[{"name":"start_ms","type":"integer","description":"Where speech began, in milliseconds from the start of the stream.","required":true}]}]}],"headers":[],"jsonPayloadSchema":{"type":"object","required":["type","speech_started"],"properties":{"type":{"type":"string","const":"speech_started","x-parser-schema-id":"\u003canonymous-schema-26>"},"speech_started":{"type":"object","required":["start_ms"],"properties":{"start_ms":{"type":"integer","minimum":0,"description":"Where speech began, in milliseconds from the start of the stream.","x-parser-schema-id":"\u003canonymous-schema-28>"}},"x-parser-schema-id":"\u003canonymous-schema-27>"}},"x-parser-schema-id":"\u003canonymous-schema-25>"},"title":"Speech Started","description":"A segment of speech began. Sent only with `agent_events=true`.\nCarries no transcript.\n","example":"{\n \"type\": \"speech_started\",\n \"speech_started\": {\n \"start_ms\": 12480\n }\n}","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"speechStarted"}]},{"id":"eagerEndOfTurn","contentType":"application/json","payload":[{"name":"Eager End of Turn","description":"The speaker has probably finished their turn, sent before the final\n`utterance` so an agent can start preparing its reply. A\n`turn_resumed` follows if the speaker carries on instead. Sent only\nwith `agent_events=true`.\n","type":"object","properties":[{"name":"type","type":"string","description":"eager_end_of_turn","required":true},{"name":"eager_end_of_turn","type":"object","required":true,"properties":[{"name":"confidence","type":"number","description":"How likely it is that the turn is complete.","required":true},{"name":"end_ms","type":"integer","description":"Where speech stopped, in milliseconds from the start of the stream.","required":true}]}]}],"headers":[],"jsonPayloadSchema":{"type":"object","required":["type","eager_end_of_turn"],"properties":{"type":{"type":"string","const":"eager_end_of_turn","x-parser-schema-id":"\u003canonymous-schema-30>"},"eager_end_of_turn":{"type":"object","required":["confidence","end_ms"],"properties":{"confidence":{"type":"number","minimum":0,"maximum":1,"description":"How likely it is that the turn is complete.","x-parser-schema-id":"\u003canonymous-schema-32>"},"end_ms":{"type":"integer","minimum":0,"description":"Where speech stopped, in milliseconds from the start of the stream.","x-parser-schema-id":"\u003canonymous-schema-33>"}},"x-parser-schema-id":"\u003canonymous-schema-31>"}},"x-parser-schema-id":"\u003canonymous-schema-29>"},"title":"Eager End of Turn","description":"The speaker has probably finished their turn, sent before the final\n`utterance` so an agent can start preparing its reply. A\n`turn_resumed` follows if the speaker carries on instead. Sent only\nwith `agent_events=true`.\n","example":"{\n \"type\": \"eager_end_of_turn\",\n \"eager_end_of_turn\": {\n \"confidence\": 0.87,\n \"end_ms\": 15320\n }\n}","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"eagerEndOfTurn"}]},{"id":"turnResumed","contentType":"application/json","payload":[{"name":"Turn Resumed","description":"The speaker carried on after an `eager_end_of_turn`: the turn is not\nover. Sent only with `agent_events=true`.\n","type":"object","properties":[{"name":"type","type":"string","description":"turn_resumed","required":true},{"name":"turn_resumed","type":"object","required":true,"properties":[{"name":"start_ms","type":"integer","description":"Where speech resumed, in milliseconds from the start of the stream.","required":true}]}]}],"headers":[],"jsonPayloadSchema":{"type":"object","required":["type","turn_resumed"],"properties":{"type":{"type":"string","const":"turn_resumed","x-parser-schema-id":"\u003canonymous-schema-35>"},"turn_resumed":{"type":"object","required":["start_ms"],"properties":{"start_ms":{"type":"integer","minimum":0,"description":"Where speech resumed, in milliseconds from the start of the stream.","x-parser-schema-id":"\u003canonymous-schema-37>"}},"x-parser-schema-id":"\u003canonymous-schema-36>"}},"x-parser-schema-id":"\u003canonymous-schema-34>"},"title":"Turn Resumed","description":"The speaker carried on after an `eager_end_of_turn`: the turn is not\nover. Sent only with `agent_events=true`.\n","example":"{\n \"type\": \"turn_resumed\",\n \"turn_resumed\": {\n \"start_ms\": 15780\n }\n}","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"turnResumed"}]},{"id":"errorResult","contentType":"application/json","payload":[{"name":"Error","description":"An error occurred during transcription. Sent at most once per\nconnection; the WebSocket closes shortly after. No further\nmessages follow an `error`.\n","type":"object","properties":[{"name":"type","type":"string","description":"error","required":true},{"name":"error","type":"string","description":"Human-readable error message","required":true}]}],"headers":[],"jsonPayloadSchema":{"type":"object","required":["type","error"],"properties":{"type":{"type":"string","const":"error","x-parser-schema-id":"\u003canonymous-schema-39>"},"error":{"type":"string","description":"Human-readable error message","x-parser-schema-id":"\u003canonymous-schema-40>"}},"x-parser-schema-id":"\u003canonymous-schema-38>"},"title":"Error","description":"An error occurred during transcription. Sent at most once per\nconnection; the WebSocket closes shortly after. No further\nmessages follow an `error`.\n","example":"{\n \"type\": \"error\",\n \"error\": \"Internal server error\"\n}","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"errorResult"}]},{"id":"doneResult","contentType":"application/json","payload":[{"name":"Transcription Complete","description":"Transcription completed successfully. Sent exactly once, immediately\nafter the final `utterance` message. After this message the server\ncloses the WebSocket.\n","type":"object","properties":[{"name":"type","type":"string","description":"done","required":true},{"name":"duration_ms","type":"integer","description":"Total duration of audio processed in milliseconds","required":true}]}],"headers":[],"jsonPayloadSchema":{"type":"object","required":["type","duration_ms"],"properties":{"type":{"type":"string","const":"done","x-parser-schema-id":"\u003canonymous-schema-42>"},"duration_ms":{"type":"integer","minimum":0,"description":"Total duration of audio processed in milliseconds","x-parser-schema-id":"\u003canonymous-schema-43>"}},"x-parser-schema-id":"\u003canonymous-schema-41>"},"title":"Transcription Complete","description":"Transcription completed successfully. Sent exactly once, immediately\nafter the final `utterance` message. After this message the server\ncloses the WebSocket.\n","example":"{\n \"type\": \"done\",\n \"duration_ms\": 14253\n}","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"doneResult"}]}],"receiveMessages":[{"id":"audioChunk","contentType":"application/octet-stream","payload":[{"type":"string","format":"binary","x-parser-schema-id":"\u003canonymous-schema-1>","name":"Audio Data Chunk","description":"Raw audio data chunk for transcription. Sent zero or more times\nby the client during the stream lifetime. Each chunk's bytes are\ndecoded by the server according to the connection's\n`audio_format` query parameter.\n"}],"headers":[],"jsonPayloadSchema":{"type":"string","format":"binary","x-parser-schema-id":"\u003canonymous-schema-1>"},"title":"Audio Data Chunk","description":"Raw audio data chunk for transcription. Sent zero or more times\nby the client during the stream lifetime. Each chunk's bytes are\ndecoded by the server according to the connection's\n`audio_format` query parameter.\n","example":"{}","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"audioChunk"}]},{"id":"finalizeControl","contentType":"application/json","payload":[{"name":"Finalize Now","description":"Text frame asking for the final `utterance` of everything spoken so\nfar, now, without ending the stream. With `agent_events=true`, the\ntext already recognized is sent first as a `partial_utterance`. With\n16 kHz mono s16le, which is passed through undecoded, the final covers\nall audio sent before this message. With any other format (another raw\nencoding, sample rate or channel count, or a container such as ogg,\nwebm or mp3), audio the decoder still holds when the message arrives -\nan incomplete sample frame, codec or resampler output, or container\ndata not yet decoded - begins the next utterance instead; no audio is\nlost.\n","type":"object","properties":[{"name":"type","type":"string","description":"finalize","required":true}]}],"headers":[],"jsonPayloadSchema":{"type":"object","required":["type"],"properties":{"type":{"type":"string","const":"finalize","x-parser-schema-id":"\u003canonymous-schema-3>"}},"x-parser-schema-id":"\u003canonymous-schema-2>"},"title":"Finalize Now","description":"Text frame asking for the final `utterance` of everything spoken so\nfar, now, without ending the stream. With `agent_events=true`, the\ntext already recognized is sent first as a `partial_utterance`. With\n16 kHz mono s16le, which is passed through undecoded, the final covers\nall audio sent before this message. With any other format (another raw\nencoding, sample rate or channel count, or a container such as ogg,\nwebm or mp3), audio the decoder still holds when the message arrives -\nan incomplete sample frame, codec or resampler output, or container\ndata not yet decoded - begins the next utterance instead; no audio is\nlost.\n","example":"{\n \"type\": \"finalize\"\n}","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"finalizeControl"}]},{"id":"endOfStream","contentType":"text/plain","payload":[{"type":"string","const":"","x-parser-schema-id":"\u003canonymous-schema-4>","name":"End of Audio Stream","description":"Empty text frame signaling end of audio. Sent exactly once by the\nclient after the last audio chunk. The server responds with a\nfinal `utterance` message followed by a `done` message, then\ncloses the connection.\n"}],"headers":[],"jsonPayloadSchema":{"type":"string","const":"","x-parser-schema-id":"\u003canonymous-schema-4>"},"title":"End of Audio Stream","description":"Empty text frame signaling end of audio. Sent exactly once by the\nclient after the last audio chunk. The server responds with a\nfinal `utterance` message followed by a `done` message, then\ncloses the connection.\n","example":"\"\"","bindings":[],"extensions":[{"id":"x-parser-unique-object-id","value":"endOfStream"}]}],"extensions":[{"id":"x-parser-unique-object-id","value":"velma2SttStreamingEnglishV2"}],"securitySchemes":[]},"channelId":"velma2SttStreamingEnglishV2","metadata":{"id":8236,"subdomain":"modulateai","eTag":"\"a4989ed965dc034db727360e5f71aeda\"","originalFileLocation":"api/velma_2_stt_streaming_english_v2.yaml","uuid":"4ee5e0a2-2098-4529-88c3-dd38b2253008","source":"LOCAL_FILE","createdAt":"2026-06-03T00:05:20.881Z","updatedAt":"2026-11-24T14:58:54.042Z","deletedAt":null,"retiredAt":null,"retiredByDeploymentHistoryId":null}},"subdomain":"modulateai","siteName":"Modulate","title":"Speech-to-Text Streaming English - Modulate","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-24T14:58:58.195Z","originalFileLocation":"api-reference/stt/streaming-vfast.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Low-latency English speech-to-text over WebSocket. Emits rolling partial transcripts during streaming, with optional utterance segmentation at pauses (endpointing), optional speaker labels (diarize), and optional word timings (time_stamps). No other enrichments.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Modulate\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/modulateai/DjDAyeOufX95soiv/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/modulateai/DjDAyeOufX95soiv/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/modulateai/DjDAyeOufX95soiv/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/modulateai/DjDAyeOufX95soiv/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/modulateai/DjDAyeOufX95soiv/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/modulateai/DjDAyeOufX95soiv/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/modulateai/DjDAyeOufX95soiv/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/modulateai/DjDAyeOufX95soiv/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/modulateai/DjDAyeOufX95soiv/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Speech-to-Text Streaming English - Modulate\">\u003cmeta data-mint-head property=\"og:description\" content=\"Low-latency English speech-to-text over WebSocket. Emits rolling partial transcripts during streaming, with optional utterance segmentation at pauses (endpointing), optional speaker labels (diarize), and optional word timings (time_stamps). No other enrichments.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Modulate\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.modulate.ai/api-reference/stt/streaming-vfast\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://modulateai.mintlify.site/_mintlify/api/og/v2?division=Speech-to-text+Transcription\u0026amp;title=Speech-to-Text+Streaming+English\u0026amp;description=Low-latency+English+speech-to-text+over+WebSocket.+Emits+rolling+partial+transcripts+during+streaming%2C+with+optional+utterance+segmentation+at+pauses+%28endpointi\u0026amp;theme=8304a2db5d5da7fc8a03825e\u0026amp;signature=ca6a786301b6b421d5999a8fdd4d51c4fd1138799ce2ea2a7b852047328991eb\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Speech-to-Text Streaming English - Modulate\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Low-latency English speech-to-text over WebSocket. Emits rolling partial transcripts during streaming, with optional utterance segmentation at pauses (endpointing), optional speaker labels (diarize), and optional word timings (time_stamps). No other enrichments.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://modulateai.mintlify.site/_mintlify/api/og/v2?division=Speech-to-text+Transcription\u0026amp;title=Speech-to-Text+Streaming+English\u0026amp;description=Low-latency+English+speech-to-text+over+WebSocket.+Emits+rolling+partial+transcripts+during+streaming%2C+with+optional+utterance+segmentation+at+pauses+%28endpointi\u0026amp;theme=8304a2db5d5da7fc8a03825e\u0026amp;signature=ca6a786301b6b421d5999a8fdd4d51c4fd1138799ce2ea2a7b852047328991eb\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/modulateai/DjDAyeOufX95soiv/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Modulate\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#285FEB\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.modulate.ai/api-reference/stt/streaming-vfast\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/stt/streaming-vfast.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.modulate.ai/#organization\",\"name\":\"Modulate\",\"url\":\"https://docs.modulate.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/modulateai/0NHKM9zXEnghoEfZ/images/wordmark-navy.svg?fit=max\u0026auto=format\u0026n=0NHKM9zXEnghoEfZ\u0026q=85\u0026s=7ee7a19111bb0154aa2e6934ebd29607\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.modulate.ai#website\",\"name\":\"Modulate\",\"url\":\"https://docs.modulate.ai\",\"publisher\":{\"@id\":\"https://docs.modulate.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.modulate.ai/api-reference/stt/streaming-vfast#webpage\",\"url\":\"https://docs.modulate.ai/api-reference/stt/streaming-vfast\",\"name\":\"Speech-to-Text Streaming English\",\"description\":\"Low-latency English speech-to-text over WebSocket. Emits rolling partial transcripts during streaming, with optional utterance segmentation at pauses (endpointing), optional speaker labels (diarize), and optional word timings (time_stamps). No other enrichments.\",\"dateModified\":\"2026-11-24T14:58:58.195Z\",\"isPartOf\":{\"@id\":\"https://docs.modulate.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.modulate.ai/api-reference/stt/streaming-vfast#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.modulate.ai/api-reference/stt/streaming-vfast#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Speech-to-text Transcription\",\"item\":\"https://docs.modulate.ai/api-reference/stt/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Speech-to-Text Streaming English\",\"item\":\"https://docs.modulate.ai/api-reference/stt/streaming-vfast\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.modulate.ai/api-reference/stt/streaming-vfast#apireference\",\"headline\":\"Speech-to-Text Streaming English\",\"name\":\"Speech-to-Text Streaming English\",\"description\":\"Low-latency English speech-to-text over WebSocket. Emits rolling partial transcripts during streaming, with optional utterance segmentation at pauses (endpointing), optional speaker labels (diarize), and optional word timings (time_stamps). No other enrichments.\",\"url\":\"https://docs.modulate.ai/api-reference/stt/streaming-vfast\",\"mainEntityOfPage\":{\"@id\":\"https://docs.modulate.ai/api-reference/stt/streaming-vfast#webpage\"},\"dateModified\":\"2026-11-24T14:58:58.195Z\",\"publisher\":{\"@id\":\"https://docs.modulate.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.modulate.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Modulate\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Modulate\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/stt/streaming-vfast.md","siteName":"Modulate","nav":{"global":null,"tabs":[{"tab":"Get Started","pages":[{"title":"Get Started","href":""}]},{"tab":"Velma","pages":[{"title":"Velma","href":"/velma/overview"}]},{"tab":"API Reference","groups":[{"group":"Velma","icon":"comments","pages":[{"title":"Velma","sidebarTitle":"Overview","href":"/api-reference/velma/overview"},{"title":"Velma Batch","sidebarTitle":"Batch","openapi":"api/velma_2_batch.yaml POST /api/velma-2-batch","href":"/api-reference/velma/batch"},{"title":"List behavior presets","sidebarTitle":"Behavior presets","openapi":"api/velma_2_batch.yaml GET /api/velma-2-batch/list-presets","href":"/api-reference/velma/presets"},{"title":"Velma Streaming","sidebarTitle":"Streaming","asyncapi":"api/velma_2_streaming.yaml velma2Streaming","href":"/api-reference/velma/streaming"}]},{"group":"Speech-to-text Transcription","icon":"microphone","pages":[{"title":"Speech-to-text Transcription","sidebarTitle":"Overview","href":"/api-reference/stt/overview"},{"title":"Speech-to-Text Transcription Batch Multilingual","sidebarTitle":"Batch Multilingual","openapi":"api/velma_2_stt_batch.yaml POST /api/velma-2-stt-batch","href":"/api-reference/stt/batch"},{"title":"Speech-to-Text Transcription Streaming Multilingual","sidebarTitle":"Streaming Multilingual","asyncapi":"api/velma_2_stt_streaming.yaml velma2SttStreaming","href":"/api-reference/stt/streaming"},{"title":"Speech-to-Text Transcription Batch English VFast","sidebarTitle":"Batch English VFast","description":"Fast English-only batch transcription with optional word-level timings and speaker diarization. Trades enrichment features for the lowest possible turnaround.","openapi":"api/velma_2_stt_batch_english_vfast.yaml POST /api/velma-2-stt-batch-english-vfast","href":"/api-reference/stt/batch-english-vfast"},{"title":"Speech-to-Text Streaming English","sidebarTitle":"Streaming English","asyncapi":"api/velma_2_stt_streaming_english_v2.yaml velma2SttStreamingEnglishV2","href":"/api-reference/stt/streaming-vfast"},{"title":"Multilingual Fast Transcription Batch","sidebarTitle":"Batch Multilingual VFast","description":"Fast multilingual batch transcription. Optionally declare the spoken language for the fastest path; otherwise the language is detected automatically.","openapi":"api/velma_2_stt_batch_multilingual_vfast.yaml POST /api/velma-2-stt-batch-multilingual-vfast","href":"/api-reference/stt/batch-multilingual-vfast"},{"title":"Multilingual Fast Transcription Streaming","sidebarTitle":"Streaming (Multilingual Fast)","asyncapi":"api/stt_streaming_multilingual_vfast.yaml velma2SttStreamingMultilingualVfast","href":"/api-reference/stt/streaming-multilingual-vfast"}]},{"group":"Deepfake Detection","icon":"shield-halved","pages":[{"title":"Deepfake Detection","sidebarTitle":"Overview","href":"/api-reference/svd/overview"},{"title":"Deepfake Detection Batch","sidebarTitle":"Batch","openapi":"api/velma_2_synthetic_voice_detection_batch.yaml POST /api/velma-2-synthetic-voice-detection-batch","href":"/api-reference/svd/batch"},{"title":"Deepfake Detection Streaming","sidebarTitle":"Streaming","asyncapi":"api/velma_2_synthetic_voice_detection_streaming.yaml streaming-detection","href":"/api-reference/svd/streaming"}]},{"group":"Emotion Detection","icon":"face-smile","pages":[{"title":"Emotion Detection","sidebarTitle":"Overview","href":"/api-reference/emotion/overview"},{"title":"Emotion Detection Batch","sidebarTitle":"Batch","openapi":"api/velma_2_emotion_batch.yaml POST /api/velma-2-emotion-batch","href":"/api-reference/emotion/batch"}]},{"group":"Accent Detection","icon":"globe","pages":[{"title":"Accent Detection","sidebarTitle":"Overview","href":"/api-reference/accent/overview"},{"title":"Accent Detection Batch","sidebarTitle":"Batch","openapi":"api/velma_2_accent_batch.yaml POST /api/velma-2-accent-batch","href":"/api-reference/accent/batch"}]},{"group":"PII/PHI Redaction","icon":"eye-slash","pages":[{"title":"PII/PHI Redaction","sidebarTitle":"Overview","href":"/api-reference/redaction/overview"},{"title":"PII/PHI Redaction Batch","sidebarTitle":"Batch","openapi":"api/velma_2_pii_phi_redaction_batch.yaml POST /api/velma-2-pii-phi-redaction-batch","href":"/api-reference/redaction/batch"},{"title":"PII/PHI Redaction Streaming","sidebarTitle":"Streaming","asyncapi":"api/velma_2_pii_phi_redaction_streaming.yaml velma2PiiPhiRedactionStreaming","href":"/api-reference/redaction/streaming"}]},{"group":"Music Detection","icon":"music","pages":[{"title":"Music Detection","sidebarTitle":"Overview","href":"/api-reference/music-detection/overview"},{"title":"Music Detection Batch","sidebarTitle":"Batch","openapi":"api/velma_2_music_detection_batch.yaml POST /api/velma-2-music-detection-batch","href":"/api-reference/music-detection/batch"},{"title":"Music Detection Streaming","sidebarTitle":"Streaming","asyncapi":"api/velma_2_music_detection_streaming.yaml streaming-detection","href":"/api-reference/music-detection/streaming"}]},{"group":"AI Music Detection","icon":"robot","pages":[{"title":"AI Music Detection","sidebarTitle":"Overview","href":"/api-reference/ai-music-detection/overview"},{"title":"AI Music Detection Batch","sidebarTitle":"Batch","openapi":"api/velma_2_ai_music_detection_batch.yaml POST /api/velma-2-ai-music-detection-batch","href":"/api-reference/ai-music-detection/batch"},{"title":"AI Music Detection Streaming","sidebarTitle":"Streaming","asyncapi":"api/velma_2_ai_music_detection_streaming.yaml streaming-detection","href":"/api-reference/ai-music-detection/streaming"}]},{"group":"Language Detection","icon":"language","pages":[{"title":"Language Detection","sidebarTitle":"Overview","href":"/api-reference/language-detection/overview"},{"title":"Language Detection Batch","sidebarTitle":"Batch","openapi":"api/velma_2_language_detection_batch.yaml POST /api/velma-2-language-detection-batch","href":"/api-reference/language-detection/batch"}]},{"group":"Audio Event Detection","icon":"waveform-lines","pages":[{"title":"Audio Event Detection","sidebarTitle":"Overview","href":"/api-reference/audio-event-detection/overview"},{"title":"Audio Event Detection Batch","sidebarTitle":"Batch","openapi":"api/velma_2_audio_event_classifier.yaml POST /api/velma-2-audio-event-classifier","href":"/api-reference/audio-event-detection/batch"}]}]},{"tab":"Benchmarks","pages":[{"title":"Benchmarks","href":"/benchmarks/overview"}]},{"tab":"Support","pages":[{"title":"Support","href":"/support"}]}]},"basePath":"","title":"Speech-to-Text Streaming English - Modulate","deploymentId":"dpl_AYyV3CY85Zsy44WzfDVuMiAS7PWU","buildId":"dpl_AYyV3CY85Zsy44WzfDVuMiAS7PWU","dynamics":["a4b48b4bee","a9bb46feb3","3b021dca80"],"chunks":["Page-VxJOEwr0.js","use-playground-group-access-B6tdpwEQ.js","utils-BhOu8MoY.js","getPastedJson-MUjpQ42l.js","api-description-markdown-Bnx5o_aC.js","DynamicMarkdown-DGZbG3dj.js","MethodPill-BEHdnIWE.js","Check2Icon-HQrwfTCD.js","MessageExamples-B2v7psrG.js","CodeSnippet-DNSgsmyp.js","cloneDeep-DIo_VyID.js","_Uint8Array-BCCZOmlk.js","isObject-FP1Yky1u.js","Markdown-D9ZX5drj.js","AssistantPageLink-BDewKJsB.js","dist-1NU8F86Q.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}