TypeScript SDK
Give your Node.js AI agent a phone number. Express-based embedded server, full type safety, same API surface as the Python SDK.
npm install getpatter
1import { Patter, Twilio, OpenAIRealtime } from "getpatter";
2
3const phone = new Patter({ carrier: new Twilio(), phoneNumber: "+15550001234" });
4const agent = phone.agent({ engine: new OpenAIRealtime(), systemPrompt: "You are a friendly receptionist." });
5await phone.serve({ agent, tunnel: true });
4 lines to a phone call
- Connect your telephony provider and start handling phone calls
- Full TypeScript types for messages, events, and config
- Express-based embedded server — no Patter backend needed
- Works with any LLM — OpenAI, Anthropic, or your own
- Built-in webhook validation for Twilio and Telnyx (Beta)
Everything you need to connect your agent to phone calls
Type-Safe Config
Every option is typed. LocalConfig, AgentConfig, IncomingMessage — autocomplete everywhere.
Instance-based voice stack
End-to-end with new OpenAIRealtime() / new ElevenLabsConvAI(), or pipeline mode with new DeepgramSTT() + new AnthropicLLM() + new ElevenLabsTTS() — swap any piece.
Webhook Security
Built-in Twilio signature verification and Telnyx (Beta) Ed25519 validation. No Patter backend required.
System Tools
Auto-injected transfer_call and end_call tools. Define custom tools with webhook URLs.
Event Lifecycle
onCallStart, onCallEnd, onTranscript — hook into every stage of the call.
Recording
One flag to enable call recording. Recordings managed by your telephony provider.
Output Guardrails
Block terms, run custom validators, or replace responses before they reach TTS.
DTMF & Variables
Keypad input as transcript events. Dynamic {variable} substitution in system prompts.