Creates a new DeepgramBatchSTTProvider.
Provider configuration including API key and optional defaults.
const provider = new DeepgramBatchSTTProvider({
apiKey: 'dg-xxxx',
model: 'nova-2',
language: 'en-US',
});
Transcribes an audio buffer using the Deepgram pre-recorded API.
Sends the raw audio bytes as the request body (not multipart form) with the appropriate Content-Type header. The response is parsed and normalized into a SpeechTranscriptionResult.
Raw audio data and associated metadata (buffer, MIME type,
duration). The data buffer is sent directly as the request body.
Optional transcription settings. Supports model,
language, and enableSpeakerDiarization overrides.
A promise resolving to the normalized transcription result with text, confidence, timing, and optional speaker-attributed segments.
When the Deepgram API returns a non-2xx status code. The error message includes the HTTP status and response body for debugging.
const result = await provider.transcribe(
{ data: wavBuffer, mimeType: 'audio/wav', durationSeconds: 5.2 },
{ language: 'fr-FR', enableSpeakerDiarization: true },
);
Readonly idUnique provider identifier used for registration and resolution.
Readonly displayHuman-readable display name for UI and logging.
Readonly supportsThis provider uses synchronous HTTP requests, not WebSocket streaming.
Speech-to-text provider that uses the Deepgram batch (pre-recorded) REST API.
REST API Contract
POST https://api.deepgram.com/v1/listenAuthorization: Token <apiKey>headeraudio/wav)model,punctuate,diarize,languageresults.channels[].alternatives[]with transcript text, confidence scores, and optional word-level timingWord-Level Diarization Mapping
When
enableSpeakerDiarizationistrue, thediarize=truequery parameter is set. Deepgram then includes aspeakerfield (zero-based integer index) on each word in the response. These speaker indices are preserved through thewordsToSegments()mapping into the normalized result.Error Handling
Non-2xx responses from Deepgram trigger an
Errorwith the HTTP status code and response body text included in the message for debugging. Network-level errors (DNS failures, timeouts) propagate as-is from the fetch implementation.Streaming is NOT supported by this provider — use a Deepgram WebSocket adapter for real-time transcription.
See
DeepgramBatchSTTProviderConfig for configuration options See
wordsToSegments()for the word-to-segment mapping logic.Example