This demo shows how to integrate ElevenLabs Conversational AI with Twilio to create an interactive voice agent that can handle phone calls.
- ElevenLabs API key
- Twilio account & phone number
- Node
- A static ngrok URL for local development
- Install dependencies:
npm install-
Configure environment:
- Copy
.env.exampleto.env - Add your ElevenLabs Agent ID
- Copy
-
Start the server:
node index.js- In a new terminal, use ngrok to create a public URL:
ngrok http --url=<your-static-url> 8000 - Configure your Twilio webhook:
- Go to your Twilio Phone Number settings
- Set the webhook URL for incoming calls to:
{your-ngrok-url}/incoming-call-eleven - Make sure the HTTP method is set to POST
- Call your Twilio phone number
- The agent should answer and begin the conversation
- Monitor the console logs for any potential issues
- Ensure the environment variable is properly set
- Check ngrok connection is active and URL is correct
- Verify Twilio webhook configuration
- Monitor server logs for detailed error messages
For detailed setup instructions and troubleshooting, please refer to the official ElevenLabs Twilio Integration Guide.
This project is licensed under the MIT License - see the LICENSE file for details.