Twilio voice integration with OpenAI Realtime API
| Event | Description |
|---|---|
start | Stream started |
media | Audio data chunk |
stop | Stream ended |
| Event | Description |
|---|---|
session.created | Session initialized |
session.updated | Session config updated |
input_audio_buffer.speech_started | User started speaking |
input_audio_buffer.speech_stopped | User stopped speaking |
response.audio.delta | AI audio response chunk |
response.done | AI response complete |
| Variable | Required | Default | Description |
|---|---|---|---|
OPENAI_API_KEY | Yes | - | OpenAI API key with Realtime access |
PORT | No | 8090 | Server port |
NGROK_AUTH_TOKEN | No | - | ngrok token for public URL |
PUBLIC | No | false | Enable public URL via ngrok |
tools.py file in the working directory:
https://your-url.ngrok.io/