Engines
An engine is an end-to-end speech-to-speech runtime. Pass an engine instance tophone.agent({ engine }) and Patter wires the audio stream straight through to the provider — no separate STT or TTS is needed.
Patter ships with two engine classes today:
OpenAIRealtime— OpenAI’s Realtime APIElevenLabsConvAI— ElevenLabs Conversational AI
import { OpenAIRealtime } from "getpatter") and a namespaced class (import * as openai from "getpatter/engines/openai" → new openai.Realtime()). They are equivalent.
If you need full control over STT, LLM, and TTS independently, use pipeline mode instead and omit engine.
OpenAIRealtime
OpenAI’s Realtime API — the lowest-latency option.| Parameter | Type | Default | Description |
|---|---|---|---|
apiKey | string | — | OpenAI API key. Reads from OPENAI_API_KEY when omitted. |
voice | string | "alloy" | One of "alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse". |
model | string | "gpt-4o-mini-realtime-preview" | OpenAI Realtime model ID. |
ElevenLabsConvAI
ElevenLabs Conversational AI — premium voice quality using a managed agent configured in the ElevenLabs dashboard.| Parameter | Type | Default | Description |
|---|---|---|---|
apiKey | string | — | ElevenLabs API key. Reads from ELEVENLABS_API_KEY when omitted. |
agentId | string | — | ElevenLabs agent ID (from the ConvAI dashboard). Reads from ELEVENLABS_AGENT_ID when omitted. |
voice | string | — | Optional override for the agent’s default voice ID. |
What’s Next
LLM
Compare engine mode with pipeline mode.
STT
STT for pipeline mode.
TTS
TTS for pipeline mode.

