Skip to main content

Documentation Index

Fetch the complete documentation index at: https://patter-06b046ce-feat-observability-otel-attrs-0-6-1.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

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 with two engine classes today: Both classes are imported by name from the package barrel: import { OpenAIRealtime, ElevenLabsConvAI } 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.
// npx tsx example.ts
import { Patter, Twilio, OpenAIRealtime } from "getpatter";

const phone = new Patter({ carrier: new Twilio(), phoneNumber: "+15550001234" });

const agent = phone.agent({
  engine: new OpenAIRealtime({ voice: "alloy" }),           // OPENAI_API_KEY from env
  systemPrompt: "You are a helpful assistant.",
  firstMessage: "Hello!",
});

await phone.serve({ agent });
ParameterTypeDefaultDescription
apiKeystringOpenAI API key. Reads from OPENAI_API_KEY when omitted.
voicestring"alloy"One of "alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse".
modelstring"gpt-4o-mini-realtime-preview"OpenAI Realtime model ID. See supported models.

Supported model identifiers

The model option accepts any OpenAI Realtime model ID. Common values:
ModelNotes
"gpt-realtime-mini"Default. Lowest latency / lowest cost.
"gpt-realtime"GA realtime model (Aug 2025).
"gpt-realtime-2"Most-capable: stronger instruction following, configurable reasoningEffort, 128K context.
"gpt-4o-realtime-preview"Earlier preview line; ~10x the per-token cost of mini.
"gpt-4o-mini-realtime-preview"Earlier preview line.
Pricing is auto-resolved per model — see Metrics. For reasoningEffort, transcription model, and the full configuration surface, see OpenAI Realtime — full reference.

ElevenLabsConvAI

ElevenLabs Conversational AI — premium voice quality using a managed agent configured in the ElevenLabs dashboard.
// npx tsx example.ts
import { Patter, Twilio, ElevenLabsConvAI } from "getpatter";

const phone = new Patter({ carrier: new Twilio(), phoneNumber: "+15550001234" });

const agent = phone.agent({
  engine: new ElevenLabsConvAI({ agentId: "agent_abc123" }),   // ELEVENLABS_API_KEY from env
  systemPrompt: "You are a warm and friendly concierge.",
});

await phone.serve({ agent });
ParameterTypeDefaultDescription
apiKeystringElevenLabs API key. Reads from ELEVENLABS_API_KEY when omitted.
agentIdstringElevenLabs agent ID (from the ConvAI dashboard). Reads from ELEVENLABS_AGENT_ID when omitted.
voicestringOptional 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.