Webhook-backed function calling -- let your agent look up customers, create tickets, and call any external API during a live phone call.
Part of the Patter Voice AI SDK.
cd python
cp ../.env.example .env # fill in your keys
pip install -r requirements.txt
python main.pycd typescript
cp ../.env.example .env # fill in your keys
npm install
npx tsx main.ts| Variable | Required | Description |
|---|---|---|
OPENAI_API_KEY |
Yes | OpenAI API key with Realtime access |
TWILIO_ACCOUNT_SID |
Yes | Twilio account SID |
TWILIO_AUTH_TOKEN |
Yes | Twilio auth token |
TWILIO_PHONE_NUMBER |
Yes | Your Twilio phone number (E.164) |
WEBHOOK_URL |
No | Public URL for webhooks (auto-tunneled if omitted) |
- Defining tools with
webhookUrlto delegate execution to your backend - Agent using tools during live phone calls
Patter.tool()helper for building tool definitions- CRM lookup + support ticket creation as example tools
- Inbound Agent — answer calls with AI
- Outbound Calls — place calls with AMD
- Custom Voice — pipeline mode with Deepgram + ElevenLabs
- Full documentation
- All templates
MIT