Skip to main content

DeepgramSTT

Deepgram speech-to-text (STT) provider. Creates a configured Deepgram STT instance for use in a voice agent.

Constructor

apiKey
string | null
Deepgram API key. Falls back to the DEEPGRAM_API_KEY environment variable, then null if neither is set.
model
DeepgramSTTModel | string
default:"nova-2"
Deepgram recognition model (e.g. 'nova-2', 'nova-3', 'enhanced').
language
string
default:"en-US"
BCP-47 language code for transcription (e.g. 'en-US', 'es', 'fr').
interimResults
boolean
default:"true"
Emit partial (interim) transcript results before a segment is finalized.
punctuate
boolean
default:"true"
Add punctuation to transcripts.
smartFormat
boolean
default:"true"
Apply smart formatting (dates, times, currency, etc.) to transcripts.
sampleRate
number
default:"48000"
Audio sample rate in Hz. Note: this is fixed at 48000 and has no effect; non-48000 values are ignored.
endpointing
number
default:"50"
Silence duration in milliseconds used to detect end of speech (endpointing).
fillerWords
boolean
default:"true"
Include filler words (e.g. “uh”, “um”) in transcripts.
keywords
string[] | null
default:"null"
Keywords to boost recognition for, optionally with intensifiers (e.g. 'Deepgram:2'). null to disable.
keyterm
string[] | null
default:"null"
Key terms to boost recognition for (newer keyterm prompting). null to disable.
profanityFilter
boolean
default:"false"
Remove profanity from transcripts.
numerals
boolean
default:"false"
Convert spoken numbers into numeric digits.
tag
string | string[] | null
default:"null"
Free-form tag(s) attached to the request for tracking/usage reporting. null to disable.
enableDiarization
boolean
default:"false"
Enable speaker diarization (label which speaker said what).
redact
string | string[] | null
default:"null"
Redaction categories to remove from transcripts (e.g. 'pci', 'ssn', 'numbers'). null to disable.
baseUrl
string
default:"wss://api.deepgram.com/v1/listen"
Deepgram streaming endpoint URL.

close

Release any resources held by the provider.

closeEmitter

Close the emitter: drop all handlers and stop emitting. Waits up to 2 seconds for in-flight async handlers to settle before returning.

emit

event
string
required

getRuntimeConfig

returns
Record<string, any>

listenerCount

event
string
required
returns
number

off

event
string
required
handler
EventHandler
required

on

event
string
required
handler
EventHandler
required
returns
EventHandler

once

event
string
required
handler
EventHandler
required
returns
EventHandler

onSttTranscript

Register a callback to receive transcripts as they are produced.
callback
SttTranscriptCallback
required

processAudio

Process a buffer of audio frames. Override in a custom provider.

removeAllListeners

event
string

streamTranscribe

Transcribe a streaming audio source, yielding STTResponses. Override in a custom provider.
returns
AsyncIterator<STTResponse>

DeepgramSTTModel

Supported Deepgram speech-to-text model names.