Skip to main content

Engines

An engine is an end-to-end speech-to-speech runtime. Pass an engine instance to phone.agent({ engine }) and Patter wires the audio stream straight through to the provider — no separate STT or TTS is needed. Patter ships several engine classes: Each class is imported by name from the package barrel: import { OpenAIRealtime, OpenAIRealtime2, ElevenLabsConvAI, XaiRealtime } from "getpatter". 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.
Telephony audio. Over Twilio/Telnyx the OpenAIRealtime engine routes through the same GA-compatible adapter as OpenAIRealtime2: it negotiates PCM-16-LE @ 24 kHz with OpenAI and transcodes to/from the carrier’s mulaw 8 kHz internally. Current OpenAI Realtime models return PCM16 @ 24 kHz regardless of a legacy g711_ulaw request, so Patter standardises on PCM and converts on the carrier leg — you don’t configure any of this.

Supported model identifiers

The model option accepts any OpenAI Realtime model ID. Common values: Pricing is auto-resolved per model — see Metrics. For reasoningEffort, transcription model, and the full configuration surface, see OpenAI Realtime — full reference.

OpenAIRealtime2

OpenAI’s GA Realtime API — separate engine marker because the GA endpoint speaks a different session.update wire shape (output_modalities, nested audio.{input,output} blocks, session.type = "realtime") and rejects the legacy beta header. Targets gpt-realtime-2 by default and routes through OpenAIRealtime2Adapter, which also handles bidirectional mulaw 8 kHz ↔ PCM 24 kHz transcoding (the GA audio engine silently drops mulaw frames).
The GA adapter pins turn_detection.create_response: false and interrupt_response: false in the session.update payload. Patter owns response creation (response.create) and barge-in cancellation explicitly so the hallucination filter and barge-in pipeline can decide per turn rather than letting the server VAD auto-trigger. See OpenAIRealtime2 — full reference.

ElevenLabsConvAI

ElevenLabs Conversational AI — premium voice quality using a managed agent configured in the ElevenLabs dashboard.

XaiRealtime

xAI’s Grok Voice Agent — an OpenAI-Realtime-GA-compatible speech-to-speech engine with on-by-default reasoning and server-side tools (web_search, x_search, mcp, file_search).
For the full session-option surface — VAD tuning, language hint, keyterms, pronunciation replacements, session resumption, and server-side tools — see xAI Realtime — full reference.
Beta — spec-validated, not yet live-call-validated.

What’s Next

LLM

Compare engine mode with pipeline mode.

STT

STT for pipeline mode.

TTS

TTS for pipeline mode.