Skip to content

Force the final transcript at end of speech (live speech-to-text)

The problem. A voice agent runs its own voice activity detection: it knows the user stopped talking. The server does not know yet: it waits for its endpointing silence before it sends the final transcript. Every turn of the conversation pays that wait twice, once in your VAD and once on the server.

The fix. When your VAD says the user stopped, send one message on the WebSocket:

{ "type": "finalize" }

The open utterance is sent as a final right away, the session stays open for the next turn, and a finalize message answers the request, even when there was nothing to finalize. It is the same as Deepgram’s Finalize and AssemblyAI’s ForceEndpoint.

Live APIfinalize (client message)
Pre-recorded (batch)Live only
Live modelssolaria-3, trantoria-1 (every live model)
LanguagesEvery language of the model (supported languages)

1. Send finalize when your VAD hears the end of speech

Section titled “1. Send finalize when your VAD hears the end of speech”

Send it on the session’s WebSocket, after the audio of the utterance, and keep streaming the microphone as usual: the request goes after the audio sent before it, so the final has every word.

The final arrives first, marked with data.from_finalize:

{
"type": "transcript",
"session_id": "0199d7a2-5c3e-7b41-9f0a-3c2d1e4f5a6b",
"created_at": "2026-10-27T09:00:03.000Z",
"data": {
"id": "00_00000003",
"is_final": true,
"from_finalize": true,
"utterance": { "text": "I'd like to change my delivery address.", "start": 12.4, "end": 14.1, "language": "en", "channel": 0, "confidence": 1, "words": [] }
}
}

Then the answer, one per audio channel. finalized: true names the final it sent by its id:

{
"type": "finalize",
"session_id": "0199d7a2-5c3e-7b41-9f0a-3c2d1e4f5a6b",
"created_at": "2026-10-27T09:00:03.001Z",
"acknowledged": true,
"error": null,
"data": { "channel": 0, "finalized": true, "utterance_id": "00_00000003" }
}

finalized: false means there was nothing to finalize: the server’s endpointing had already sent the final, or nobody spoke since the last one. Your agent can answer at once either way.

Each program below streams a 16-bit WAV file like a microphone, sends finalize once the speech is over (where your VAD would), and prints how long the final took. Put your API key in the GLADIA_API_KEY environment variable, then run python finalize.py question.wav (or node finalize.mjs question.wav).

finalize.py
# pip install requests websockets
import asyncio
import json
import os
import sys
import time
import wave
import requests
import websockets
API_URL = os.environ.get("GLADIA_API_URL", "https://eu1.api.gladia.io")
async def main(path: str) -> None:
with wave.open(path) as wav: # a 16-bit PCM WAV file: one question, then silence
rate, channels = wav.getframerate(), wav.getnchannels()
audio = wav.readframes(wav.getnframes())
created = requests.post(
f"{API_URL}/v2/live",
headers={"x-gladia-key": os.environ["GLADIA_API_KEY"]},
json={
"encoding": "wav/pcm",
"sample_rate": rate,
"bit_depth": 16,
"channels": channels,
"model": "solaria-3",
},
timeout=10,
)
created.raise_for_status()
async with websockets.connect(created.json()["url"]) as ws:
step = rate * channels * 2 // 10 # 100 ms of audio per chunk
for start in range(0, len(audio), step):
await ws.send(audio[start : start + step]) # live audio: send each chunk as it is captured
# your VAD heard the end of speech: ask for the final now
asked = time.monotonic()
await ws.send(json.dumps({"type": "finalize"}))
async for raw in ws:
message = json.loads(raw)
if message["type"] == "transcript" and message["data"]["is_final"]:
print("final:", message["data"]["utterance"]["text"])
if message["type"] == "finalize":
elapsed = (time.monotonic() - asked) * 1000
print(f"finalized: {message['data']['finalized']} in {elapsed:.0f} ms")
break
await ws.send(json.dumps({"type": "stop_recording"})) # or go on with the next turn
async for _raw in ws: # the last messages, until the server closes the connection
pass
asyncio.run(main(sys.argv[1]))
final: I'd like to change my delivery address.
finalized: True in 41 ms
  • Send it at the end of speech, not at every pause. finalize cuts the utterance where it is: a user who pauses mid-sentence and goes on gets two finals. Send it on your VAD’s “user stopped speaking” event, the one that makes your agent answer.
  • Keep the audio flowing. finalize does not stop the recording: keep sending the microphone’s audio. To end the session, send stop_recording.
  • One answer per request and per channel. A stereo session gets two finalize messages, one per channel. Two requests before the final get two answers after it.
  • Always answered. acknowledged: false with an error when the request could not be forwarded: the session is stopping (after stop_recording the last finals come anyway), the session moved to another server before it answered, or the model’s endpoint cannot finalize. The finals then come as usual. A request sent while the session is still connecting is held and sent once it is.
  • One every 200 ms at most. A request sent within 200 ms of the previous one is answered acknowledged: false and not forwarded: send it once per end of speech, not with every audio chunk.
  • Every model, at once on solaria-3 and solaria-1. They send the final as soon as they read the request, on the audio received before it (solaria-1: one-channel sessions; a multichannel session closes with the next audio). The other models close the utterance with the next audio they receive (one chunk of their profile): keep the microphone streaming.
  • Answered within 3 seconds. An utterance that held no words after all sends no final: the request is then answered finalized: false after at most 3 seconds.
  • Not with Gladia’s cloud API. finalize is a Gladia Enterprise message: the cloud API ignores it.
  • The result. GET /v2/live/{id} holds the final in its place, from_finalize included in its message.
symptom cause fix
finalize answered "finalized": false every time the server’s endpointing sent the final before the request nothing to do: lower your VAD’s stop delay, or raise endpointing
a sentence split in two finals finalize sent at a pause in the middle of the sentence send it on your VAD’s end of speech, after its stop delay
"acknowledged": false, “not supported by this session’s inference endpoint” the model’s endpoint runs an older image wait for its update; the server’s endpointing closes the utterances meanwhile
"acknowledged": false, “finalize sent again within 200 ms” finalize sent on every audio chunk or VAD frame send it once, on your VAD’s end of speech
no answer at all the message was sent as a binary frame (read as audio), or with another type send {"type": "finalize"} as a text frame