VOICE / set-stt-endpointing

Voice

Set streaming STT endpointing silence

Set streaming STT endpointing silence

On streaming STT, endpointing is the silence duration in milliseconds before the server fires speech_final=true (speaker stopped). Default is 400. Range is 05000. Set 0 to fire on any VAD silence boundary. Base connect loop: Stream speech to text over WebSocket.

Add the query param

wss://api.x.ai/v1/stt?sample_rate=16000&encoding=pcm&interim_results=true&endpointing=800
Value Effect
0 Fire speech_final on any VAD silence boundary (no delay).
400 Default silence wait before utterance-final.
8001500 More tolerant of brief pauses inside a sentence.
up to 5000 Maximum documented silence wait.

endpointing is independent of Smart Turn. For ML end-of-turn scoring on top of VAD silence, see Enable Smart Turn on streaming speech-to-text and Set Smart Turn timeout on streaming STT.

Proxy the WebSocket through your backend so the API key stays off the client.

Pitfalls

  • Batch REST multipart (POST /v1/stt) has no endpointing field. Streaming WebSocket only.
  • vad_threshold filters which chunks count as speech; it does not change speech_final timing. Docs default stream VAD to 0.08.
  • Very low endpointing can split numbers and mid-clause pauses into separate utterances.
  • Console API credits are separate from SuperGrok's weekly pool on grok.com.
  • Never put the API key in client-side WebSocket code; proxy through your backend.