Skip to main content

STT (Speech-to-Text)

STT is used in pipeline mode to transcribe caller audio before it reaches your LLM. If you use an engine such as OpenAIRealtime or ElevenLabsConvAI, speech recognition is handled internally by the engine. Every STT class is imported by name from the package barrel: import { DeepgramSTT } from "getpatter".

Quickstart

Supported providers

SpeechmaticsSTT is being ported to TypeScript in the upcoming release — see the ## Unreleased section in CHANGELOG.md. Use Python or wait for the next minor version.
Speechmatics is supported by the Python SDK but not yet by the TypeScript SDK — use the Python SDK if you need Speechmatics.

Model enums

Each provider exports a typed const-object of valid model IDs alongside the provider class. They keep model options tab-completable and reject typos at construction time, while still accepting raw strings for forward compatibility:
The same pattern applies to AssemblyAIModel, CartesiaSTTModel, and SonioxModel.

Deepgram

Streaming STT backed by Deepgram’s nova-3 model.

Whisper (OpenAI)

HTTP-based STT via OpenAI Whisper. Reuses OPENAI_API_KEY.
Whisper on mulaw 8 kHz routinely hallucinates short fillers ("you", ".", "thank you"). For production prefer OpenAITranscribeSTT (gpt-4o-transcribe) — same OPENAI_API_KEY, ~10× faster, no hallucination floor.

OpenAI Transcribe (gpt-4o-transcribe)

First-class STT for OpenAI’s gpt-4o-transcribe and gpt-4o-mini-transcribe models — drop-in replacement for WhisperSTT with stronger multilingual quality and significantly lower latency. Reuses OPENAI_API_KEY.

Cartesia

Streaming STT using Cartesia’s ink-whisper. See Cartesia setup.

AssemblyAI

Universal Streaming STT via the AssemblyAI v3 WebSocket API. See AssemblyAI setup.

Soniox

Real-time STT via Soniox.

xAI

Real-time streaming STT via xAI (Grok), plus a one-shot batch transcription helper. Supports Smart Turn end-of-turn detection, keyterm biasing, and speaker diarization. See xAI STT setup.

Missing credentials

Each class throws at construction time if no API key is resolved:

What’s Next

LLM

Configure the language model.

TTS

Configure speech synthesis.