Python Quickstart
This guide walks you through building a voice AI agent that answers phone calls using local/self-hosted mode.Prerequisites
- Python 3.11+
- A telephony account (Twilio or Telnyx)
- An AI provider key (OpenAI, ElevenLabs, or Deepgram)
Step 1: Install the SDK
Step 2: Set Up Credentials
Create a.env file in your project root:
Step 3: Expose Your Server
Patter needs a public URL so Twilio/Telnyx can reach your local server. Use ngrok:abc.ngrok.io) and use it as your WEBHOOK_URL.
Step 4: Write Your Agent
Step 5: Make a Call
Call yourPHONE_NUMBER from any phone. The AI agent will answer and start the conversation.
What’s Next
Configuration
Explore all constructor options and modes.
Agents
Customize voice, model, and behavior.
Tools
Add function calling to your agent.
Events
Handle call start, end, and transcript events.

