LiveKit is a real-time media framework that runs your agent in a room. Twilio is a carrier that owns numbers and carries calls, so LiveKit phone agents often use a Twilio SIP trunk. Dograh, the open-source AI voice agent platform we build, runs on Pipecat with Twilio as a carrier. You can self-host it or run it on Dograh Cloud.
Key Takeaways
- LiveKit moves audio in real time. Twilio owns numbers and carries phone calls.
- LiveKit sells numbers in the US only, so other countries need a carrier.
- On either stack, the carrier and the platform send separate bills.
Search for a voice agent stack and LiveKit and Twilio come up as if you had to pick one. They sit at different layers. We explain what each does, why phone agents on LiveKit still use a carrier, price one call on each stack, then show where Dograh sits.
Two layers in one phone call
A phone call to an AI agent passes through two layers before the agent hears a word. The first is the phone network, where someone dials a number and a carrier such as Twilio owns that number and carries the call. The second is the real-time media layer, which brings the call's audio to the agent and sends the agent's voice back fast enough for a conversation.

LiveKit lives in the second layer. It moves live audio between participants over WebRTC and runs your agent as one of those participants. Twilio lives mostly in the first. It rents numbers, connects calls on the phone network and can hand the call's audio to your server.
That is why the two often appear in the same stack. In our experience, SIP trunking is the most reliable way to bring production phone traffic into a voice agent, and WebRTC is the right choice for calls that start in a browser or an app. A LiveKit agent that answers phone calls usually uses both, with WebRTC inside LiveKit and a SIP trunk from a carrier to get the call there.
What LiveKit does for a voice agent
LiveKit is a media server plus an agent framework. A conversation happens in a room, and the caller, the agent and anyone else join it as participants. LiveKit Agents, the framework your developers write the agent in, is open source under Apache-2.0, and its turn detection models come under LiveKit's own model licence.
For phone calls, LiveKit speaks SIP. LiveKit's telephony docs describe inbound calls arriving as SIP participants that dispatch rules route into rooms, and outbound calls placed through an outbound trunk. To use it, you configure your SIP provider's trunking service to work with LiveKit, and LiveKit lists Twilio, Telnyx and Plivo among the providers it has tested.
You can run LiveKit on LiveKit Cloud or on your own servers. Self-hosting means deploying LiveKit's SIP service separately from the media server, so a phone agent on self-hosted LiveKit has one more service to run.
What LiveKit leaves to you is the product around the agent. Your team writes the agent in code and builds whatever it needs for prompts, call lists, testing and review. Our comparison of LiveKit vs Pipecat covers how its framework differs from Pipecat's on transports, transfers and turn detection.
What Twilio does for a voice agent
Twilio is a carrier and a programmable voice API. It rents five types of phone number in more than 100 countries and connects calls between those numbers and the phone network. For an AI agent, it offers two ways to get the call to your software.
The first is Programmable Voice. A call reaches your number, Twilio asks your server what to do, and Media Streams sends the raw audio to your agent over a WebSocket and plays back its replies. That costs $0.0085 a minute to receive a call on a US local number plus $0.0044 a minute for the stream.
The second is Elastic SIP Trunking, which connects your Twilio numbers straight to any system that speaks SIP. The audio travels over SIP, so there is no stream fee, and the minute rates are lower. Twilio also sells a speech layer of its own, ConversationRelay, but a LiveKit or Dograh agent runs its own speech models and does not need it. Our guide to Twilio pricing prices every line of a Twilio call under an AI agent.
Why many phone agents use both
LiveKit sells numbers, but only some. LiveKit Phone Numbers provides local and toll-free numbers in the United States on LiveKit Cloud. A team that needs a UK, Australian or Indian number, or keeps numbers it already owns, brings a SIP trunk from a carrier. Self-hosting LiveKit needs one too.
Twilio is a common choice for that trunk, and LiveKit documents the route. LiveKit's Twilio setup page uses Twilio Elastic SIP Trunking, with the trunk's origination pointing at LiveKit's SIP endpoint and a trunk domain ending in pstn.twilio.com. For inbound calls only, it also allows TwiML on Programmable Voice in place of a trunk. Our walk-through of Twilio Elastic SIP Trunking covers the trunk setup itself.
For a US-only agent on LiveKit Cloud, LiveKit's own numbers can make Twilio unnecessary. Outside the US, or with numbers you already own, the carrier stays in the stack, and so does Twilio's account, porting and compliance setup. So the real choice for most teams is which carrier sits under LiveKit.
Open Source Alternative to Vapi / Retell
Self-hosted voice agent platform — no per-minute fees
dograh-hq/dograh
Star on GitHub
One 5-minute call on each stack
Here is one worked example. It prices a 5-minute inbound call to a US local number on two stacks, with the speech and language models left out as a separate line because they depend on your providers. The LiveKit stack runs on the Ship plan from LiveKit's pricing page with a Twilio trunk, and the call falls past the plan's 5,000 included agent session minutes and 5,000 SIP minutes. The Dograh stack runs on Dograh Cloud with a Twilio number.
| Line | LiveKit Cloud (Ship) + Twilio trunk | Dograh Cloud + Twilio number |
|---|---|---|
| Carrier minutes | Twilio origination 5 x $0.0034 = $0.0170 | Twilio receive 5 x $0.0085 = $0.0425 |
| Audio to the agent | LiveKit SIP minutes 5 x $0.004 = $0.0200 | Twilio Media Streams 5 x $0.0044 = $0.0220 |
| Platform | Agent session minutes 5 x $0.01 = $0.0500 | Platform fee 5 x $0.01 = $0.0500 |
| Call total before models | $0.0870 | $0.1145 |
| Fixed monthly lines | $50 Ship plan, Twilio number $1.15 | Twilio number $1.15 |
The Twilio lines come from Twilio's Elastic SIP Trunking prices and Twilio's US voice prices. Inside the Ship plan's included minutes, the LiveKit SIP and session lines are covered by the $50 plan fee instead.
The point of the example is the shape of the bill. In both stacks the carrier sends one bill and the platform another. On Dograh Cloud, a Twilio trunk can also point at the organisation's Managed SIP domain, which swaps the receive and stream lines for the trunk rate. Self-hosting changes the platform line on both. LiveKit's media server and Dograh are both open source, and your servers replace the per-minute fee. Our breakdown of LiveKit pricing covers its plans and a worked month.
LiveKit vs Twilio side by side
The table sets the two layers side by side, with Dograh as the third option many teams weigh. Read it by row, since each row is a job in the stack and the columns show who does that job.
| LiveKit | Twilio | Dograh | |
|---|---|---|---|
| What it is | Real-time media server and agent framework | Phone carrier and programmable voice API | Open-source AI voice agent platform |
| Layer | Media and agent code | Numbers and the phone network | Agent, workflow, tools, QA |
| Phone numbers | US local and toll-free on LiveKit Cloud | Five types in 100+ countries | Uses your carrier's numbers |
| Phone calls arrive by | SIP trunk or LiveKit numbers | Its own network | Twilio, Telnyx, Plivo and other providers, or your SIP trunk |
| Licence | Apache-2.0 framework | Proprietary service | BSD 2-Clause |
| You build | The agent in code and the product around it | The agent, or use its speech layer | The flow in a visual builder |
| Hosting | LiveKit Cloud or your servers | Twilio's cloud | Your servers or Dograh Cloud |
Where Dograh sits between them
Dograh is a third shape, a ready agent platform that keeps a carrier such as Twilio underneath. It is built on Pipecat, through Dograh's own fork, rather than on LiveKit, and it ships the product around the agent that a framework leaves you to build. That covers the visual workflow builder, campaigns, tools and webhooks, full call traces and built-in QA that scores each step of a call.
Twilio is one of its phone providers. You connect Twilio with your Account SID and Auth Token, and the call's audio reaches the agent through Media Streams. Your numbers stay on your Twilio account and bill, and Telnyx, Plivo and other providers connect the same way if you want a second carrier. Transfer Call works on Twilio, with an optional short spoken introduction both people hear before they connect.
The models are your choice. You bring your own keys for any speech-to-text, language model and voice provider, or run open models on your own servers. Pre-recorded clips can play the lines your agent says most, with a generated voice for the rest.
Self-hosted Dograh has no per-minute platform fee, but servers, model keys and phone minutes still cost money. Dograh Cloud charges a 1¢-a-minute platform fee. If you are weighing LiveKit against other options, our list of LiveKit alternatives sets it beside Pipecat and hosted APIs.
Join the Dograh Community
Dograh is an OSS alternative to Vapi. Join our Slack community for queries, releases, best practices & community interactions.
Glossary
- Media framework
- Software that moves live audio and video between participants with low delay and runs code that joins as a participant. LiveKit is one, and it relies on a carrier or its own US numbers for phone calls.
- SIP participant
- A phone call that has joined a LiveKit room over SIP. Inbound calls become SIP participants routed by dispatch rules, so the agent hears the caller like any other participant.
- Elastic SIP trunk
- Twilio's product for connecting its numbers to any system that speaks SIP, such as LiveKit or a PBX. Audio travels over SIP, so there is no Media Streams fee, and minute rates are lower than Programmable Voice.
- Origination
- Calls coming in from the phone network through a SIP trunk to your system. On Twilio Elastic SIP Trunking, origination to a US local number costs $0.0034 a minute.

