Quickstart
This guide walks you through setting up a voice AI agent in local mode using Twilio and OpenAI.Prerequisites
- Node.js 18+
- A Twilio account with a phone number
- An OpenAI API key
- ngrok or another tunnel for local development
Step 1: Install the SDK
Step 2: Set Up Your Tunnel
Open a terminal and start ngrok:abc123.ngrok.io). You will use this as your webhookUrl.
Step 3: Configure Environment Variables
Create a.env file in your project root:
Step 4: Create Your Agent
Createindex.ts:
Step 5: Configure Twilio Webhooks
In your Twilio Console, navigate to your phone number and set the voice webhook to:Step 6: Run Your Agent
Next Steps
Add Tools
Let your agent book appointments, look up data, and more.
Add Guardrails
Filter AI responses before they reach callers.
Handle Events
React to transcripts, call starts, and call ends.
Outbound Calls
Make outbound calls with machine detection.

