Patter: Outbound Calls

April 14, 2026 · View on GitHub

Patter

Patter: Outbound Calls

Place outbound calls with answering machine detection (AMD) and voicemail drop.

Part of the Patter Voice AI SDK.

Prerequisites

  • Twilio account with a phone number
  • OpenAI API key with Realtime access

Quick Start

Python

cd python
cp ../.env.example .env   # fill in your keys
pip install -r requirements.txt
python main.py

TypeScript

cd typescript
cp ../.env.example .env   # fill in your keys
npm install
npx tsx main.ts

Environment Variables

VariableRequiredDescription
OPENAI_API_KEYYesOpenAI API key with Realtime access
TWILIO_ACCOUNT_SIDYesTwilio account SID
TWILIO_AUTH_TOKENYesTwilio auth token
TWILIO_PHONE_NUMBERYesYour Twilio phone number (E.164)
WEBHOOK_URLNoPublic URL for webhooks (auto-tunneled if omitted)

What This Demonstrates

  • phone.call() for placing outbound calls
  • machineDetection to detect answering machines via AMD
  • voicemailMessage to leave a pre-recorded message on voicemail
  • Lifecycle callbacks for call events

Next Steps

License

MIT