Prerequisites
- Python 3.12+
- Docker (for Postgres + Redis)
- Twilio account with a phone number
- OpenAI API key (or Ollama for local LLM)
- Deepgram API key (free at console.deepgram.com)
- ngrok (for local development)
Setup
1
Clone and install
2
Configure environment
.env with your credentials:.env
PLATFORM_API_KEY ships with a dev default (dev-platform-key) that gates
project and API-key creation — the examples read it automatically. Set a
strong unique value in production.3
Start the stack
http://localhost:8090. To iterate on server
code with hot reload instead, stop the turncall container (both bind
:8090) and use make run.4
Expose via ngrok
5
Run the example
run.sh that reads TURNCALL_NUMBER, TWILIO_PN_SID,
and PUBLIC_BASE_URL from .env — or pass the flags yourself:6
Call your number
The receptionist agent will answer, understand your intent, and route accordingly.
What You Just Built
Twilio opens a media-stream WebSocket to/ws/media-stream; the pipeline runs until you hang up, then the call is marked completed.
Manual Setup via API
If you prefer to set things up step by step:Create a project
Project and first-API-key creation are gated by the platform credential — sendX-Platform-Key matching your PLATFORM_API_KEY:
Create an API key
Create an agent
Publish the agent
Bind a phone number
Configure Twilio webhooks
Set your Twilio number’s webhook URLs:- Voice URL:
https://xxxx.ngrok.io/webhooks/twilio/voice/inbound(POST) - Status URL:
https://xxxx.ngrok.io/webhooks/twilio/status(POST)
Call your number
That’s it — call the number and talk to your agent.Environment Variables
See Providers for provider-specific configuration and Video Avatar for avatars.