Twilio ConversationRelay
Managed voice layer on Twilio calls: Twilio handles speech recognition (Deepgram or Google), text-to-speech (ElevenLabs, Google, Amazon), interruptions and turn-taking, and sends you text over a WebSocket so you only run the LLM logic.
Overview
Best for: Teams that want to own the LLM/agent logic in plain text while Twilio runs speech and telephony.
At a glance
$0.07/min reportedly includes STT and TTS (not stated explicitly by Twilio); you run the LLM. Voice minutes and numbers billed on top. Free tier is Twilio trial credit only. HIPAA needs a signed BAA.
Phone call; Twilio does STT and sends text to you
You send text tokens; Twilio does TTS
Many via Google/Deepgram STT and ElevenLabs/Google/Amazon voices; 'multi' auto-detect requires Deepgram + ElevenLabs.
No verified number.
Twilio global; not region-pinned in sources reviewed.
HIPAA eligible with a signed BAA (per TwiML docs); Twilio-wide SOC 2/GDPR programs not re-verified here.
Features
- turn detection (Deepgram Flux eotThreshold, speechTimeout)
- interruptions (interruptible, interruptSensitivity)
- telephony
- DTMF
- language switching
- end session with handoffData
- welcome greeting
Pricing
| What | Price | Unit |
|---|---|---|
| ConversationRelay | $0.07 | per minute |
| Inbound local call | $0.0085 | per minute |
| Outbound call (US/Canada) | $0.014 | per minute |
| Recording | $0.0025 | per minute |
| Branded calling | $0.12 | per call |
| Answering machine detection | $0.0075 | per call |
$0.07 ConversationRelay + $0.0085 inbound or $0.014 outbound + your own LLM (roughly $0.002-0.03/min depending on model). Assumes STT/TTS are included in the $0.07 as third parties report.
Free tier: Twilio trial credit only.
Source: twilio.com
Setup
- Complete ConversationRelay onboarding and accept the AI/ML addendum in the Twilio Console.
- Buy a number and point its voice webhook to a TwiML endpoint that returns <Connect><ConversationRelay url="wss://...">.
- Run a WebSocket server: on 'setup' store call info, on 'prompt' send the caller text to your LLM and stream back 'text' tokens with last=true on the final one.
- Handle 'interrupt' by cancelling the in-flight LLM stream.
Endpoint
TwiML <Connect><ConversationRelay> + your wss:// server
Authentication
Twilio Account SID / Auth Token (validate X-Twilio-Signature on webhooks)
Quick start javascript
// Node: TwiML webhook + ConversationRelay WebSocket (message names per Twilio docs; verify schema)
import express from "express";
import { WebSocketServer } from "ws";
const app = express();
app.post("/voice", (req, res) => {
res.type("text/xml").send(
'<Response><Connect><ConversationRelay url="wss://ai.example.com/relay" ' +
'welcomeGreeting="Hi, this is an AI assistant. How can I help?" /></Connect></Response>');
});
const server = app.listen(3000);
const wss = new WebSocketServer({ server, path: "/relay" });
wss.on("connection", (ws) => {
ws.on("message", async (raw) => {
const msg = JSON.parse(raw);
if (msg.type === "setup") console.log("call", msg.callSid);
if (msg.type === "prompt") {
const reply = await askLLM(msg.voicePrompt); // your LLM call
ws.send(JSON.stringify({ type: "text", token: reply, last: true }));
}
if (msg.type === "interrupt") { /* cancel in-flight LLM stream */ }
});
});
Written from the current docs. Check the vendor's SDK version before you ship.
Warnings
Two meters: $0.07/min plus the phone minutes
ConversationRelay is billed on top of inbound/outbound voice minutes and number rental; your LLM is billed by its provider.
Default STT changed in 2025
transcriptionProvider defaults to Deepgram, but accounts that used ConversationRelay before 12 Sep 2025 default to Google. Set it explicitly so behaviour does not differ between accounts.
Bad provider/voice combos hang up the call
An invalid transcriptionProvider/speechModel or ttsProvider/voice pair sends an error and disconnects. Test every voice you configure.
Default for input during agent speech changed
reportInputDuringAgentSpeech default became 'none' in May 2025 (was 'any'); older tutorials assume otherwise.
HIPAA and PCI
HIPAA use needs a signed BAA; keep card data out of welcomeGreeting, hints, parameters and handoffData because some providers are not PCI compliant.
Plus 12 warnings that apply to all platforms and telephony APIs. See category warnings.
Limits
- url must be wss://
- speechTimeout 600-5000 ms
- Invalid provider/voice combos disconnect the call
- Some STT/TTS providers are not PCI compliant; keep PCI data out of prompts and greetings
Models and products
| Name | Status |
|---|---|
| ConversationRelay | GA |
Docs and sources
Docs
Sources used
- twilio.com/en-us/voice/pricing/us
- twilio.com/docs/voice/twiml/connect/conversationrelay
- twilio.com/docs/voice/conversationrelay
- twilio.com/en-us/products/conversational-ai/pricing
Whether STT/TTS (especially ElevenLabs) are fully included in $0.07/min; exact WebSocket message field names (voicePrompt etc.).