Welcome to the Vapi Twilio sample project! This guide will walk you through integrating Vapi with your Twilio account.
To set up this project:
-
Create a Python Virtual Environment
python -m venv .venv source .venv/bin/activate -
Set Up Environment Variables
-
Create a
.envfile in your repository:cp .env.example .env
-
Add your
VAPI_PRIVATE_TOKENto the.envfile.
-
-
Install Dependencies
pip install --upgrade pip &&\ pip install -r requirements.txt -
Configure Your Twilio Number
- Go to your Twilio Console and navigate to your active number.
- In the Configuration section, change the "A call comes in" setting to Webhook.
- Set the webhook URL to
your_ngrok_url/twilio/inbound_calland save the configuration.
-
Run the FastAPI Server
fastapi dev ./app/main.py
To make your local server accessible over the internet, you can use ngrok. Follow these steps:
-
Install ngrok
- Download ngrok from the official website.
- Unzip and install ngrok.
-
Expose Localhost
ngrok http 8000
- Assistant ID: After creating an assistant in the VAPI Dashboard, you will receive an assistant ID. Use this ID in your configurations.
- Phone Number ID: Purchase a Twilio phone number. The ID of this phone number can be used for your purposes.