Usage guide
Setup, environment variables, and Python/JavaScript/Go usage examples.
DeepgramSTT
Streaming speech-to-text via Deepgram’s Listen WebSocket API. Real-time transcription with interim results, smart formatting, keyterm/keyword boosting, diarization and redaction. Audio format is fixed at 48 kHz mono linear16, sosample_rate/encoding/channels are accepted
for backward compatibility but have no effect.
Constructor
Deepgram API key. Falls back to
DEEPGRAM_API_KEY.Recognition model:
nova-3 family (nova-3, nova-3-general, nova-3-medical), nova-2 family (nova-2, nova-2-phonecall, nova-2-meeting, nova-2-medical, nova-2-finance, nova-2-drivethru, …) or flux-general-en/flux-general-multi. Default "nova-2".BCP-47 language tag (e.g.
"en-US"). Default "en-US".Emit partial hypotheses while the caller speaks. Default True.
Add punctuation to the transcript. Default True.
Apply date/number/currency formatting. Default True.
Input rate in Hz. Fixed at 48000; ignored.
Silence in ms before a finalized transcript is emitted. Default 50.
Keep “uh”/“um” fillers in the transcript. Default True.
Legacy term-boost list (nova-2). Use
keyterm on nova-3.Keyterm-prompting list to boost domain vocabulary (nova-3).
Mask profanity. Default False.
Convert spoken numbers to digits. Default False.
Request tag(s) attached for Deepgram usage reporting.
Label speakers in the transcript. Default False.
Entity type(s) to redact (e.g.
"pci", "numbers").Deepgram Listen WebSocket endpoint.
aclose
emit
The event to emit.
off
The event the handler was registered for.
The handler to remove.
on
callback is omitted.
The event to listen for.
The handler to invoke when the event is emitted. If
None, a decorator is returned that registers the decorated function.The registered callback when
callback is provided, otherwise a decorator that registers and returns the function it wraps.on_stt_transcript
An async callable that receives each
STTResponse.process_audio
Raw audio bytes to transcribe.
Optional language code to guide recognition.
stream_transcribe
An async iterator yielding raw audio byte chunks.
STTResponse: Transcription events produced as audio is consumed.