Keep filler words in speech-to-text
Keep filler words in speech-to-text
Set filler_words to true so disfluencies like "uh", "um", and "er" stay in the transcript text and the words array. Default is false (they are stripped). Base batch and stream flows: Transcribe audio with the Voice API and Stream speech to text over WebSocket.
Batch REST
POST https://api.x.ai/v1/stt. Put option fields before file in the multipart body.
curl -X POST https://api.x.ai/v1/stt \
-H "Authorization: Bearer $XAI_API_KEY" \
-F filler_words=true \
-F file=@/path/to/interview.wav
When filler_words=true, fillers appear as normal entries in words with text, start, and end.
Streaming WebSocket
Add filler_words=true as a query param on wss://api.x.ai/v1/stt.
wss://api.x.ai/v1/stt?sample_rate=16000&encoding=pcm&interim_results=true&filler_words=true
Proxy the WebSocket through your backend so the API key stays off the client.
When to leave it off
Leave the default (false) for clean captions, meeting notes, and anything that should read like edited prose. Turn it on for coaching, disfluency research, or verbatim legal-style transcripts where the hesitations matter.
Pitfalls
- Default strips fillers from both the merged
textand thewordsarray. - Works with other STT flags (
diarize,multichannel,keyterm,language) on the same request. - 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.