Converse

Developer guide

Twilio

Use the maintained Python reference bridge for PSTN calls. Twilio owns the phone number and call; Converse owns the realtime voice conversation.

โ† Choose another integration

Twilio inbound calls

The Python reference bridge terminates a bidirectional Twilio Media Stream and opens one Converse session per call. Twilio remains responsible for the phone number and call; your service owns deployment and application tools.

  1. Download bridge.py, pyproject.toml and env.example.
  2. Set CONVERSE_API_KEY, TWILIO_AUTH_TOKEN and the exact external PUBLIC_BASE_URL.
  3. Run uv sync, then uv run uvicorn bridge:app --env-file .env --host 0.0.0.0 --port 8000 behind public HTTPS.
  4. Point the Twilio number's incoming Voice webhook at POST https://your-host/voice.

The bridge validates Twilio signatures, converts 8 kHz G.711 mu-law audio, and maps Twilio mark/clear playback state onto Converse interruption events. Add your tool schemas and handlers in tool_manifest() and execute_tool(). See the complete bridge notes.