Voice agent on a phone line: one API or a stack you assemble?

Picture a dental clinic where the phone rings while the front desk is busy with a patient. You put a voice agent on the line. In the demo it works: the caller asks for Thursday and the agent books it. Then a real caller says "Thursday, no, wait, Friday" halfway through the agent's sentence, the line is full of static, and the agent, a large language model (LLM, software that reads text and writes a reply) wired to a phone number, keeps talking over them. Fixing that means choosing what you are willing to own: a stack you assemble from parts, or a single voice API that runs the conversation for you.

This post covers the jobs a phone call has to do, what you take on if you assemble them yourself, and an eight-question checklist you can use with any platform. Rymi sells a managed call API, so weigh that as you read.

The six jobs on a real phone call

A production phone call has several jobs, whether you built them or you are renting them.

1. Telephony and audio transport. The call travels over the public switched telephone network (PSTN, the ordinary phone system) through a carrier before any AI component touches it. Many phone paths encode voice with ITU-T G.711, a standard that samples speech at 8,000 samples per second and uses a mu-law or A-law encoding (https://www.itu.int/rec/T-REC-G.711). That is a narrowband format built for phone lines, not studio microphones. A browser call is a different path. WebRTC, a W3C standard for real-time audio and video in a browser, carries the call between the page and a server (https://www.w3.org/TR/webrtc/). A laptop microphone often sounds clearer than a phone line, but a browser call can also use narrow phone-style audio, so do not assume it is always wider.

2. Streaming speech recognition. Speech-to-text (STT) has to turn that audio into text while the caller is still talking, and keep working when the line is noisy.

3. Reasoning and business logic. The LLM reads the transcript, decides what to say next, and calls tools when the conversation needs a calendar check or a lookup in another system.

4. Speech synthesis. Text-to-speech (TTS) turns the model's text back into audio quickly, in a format the phone path can carry.

5. Interruption handling and turn-taking. Something has to decide when the caller has finished speaking, and notice when they start again while the agent is talking. That second case is called barge-in: the agent should stop playing audio and listen.

6. Call lifecycle and post-call work. Something has to track call state, retry failures, store recordings and transcripts, and deliver the results afterward, often through a webhook (an HTTP callback your server receives when an event like "call ended" happens). Ask when those results actually arrive. "When the call ends" and "after post-call processing finishes" are not always the same moment.

Who does which job depends on what you pick. A managed voice API runs jobs 2 through 5 for you, and the phone number comes from a carrier (the company that connects your call to the phone network) that you rent through the platform or bring yourself. A framework gives you the same jobs as code you host and run, so check what it offers for telephony and post-call work before assuming either is included. A speech-to-speech model (one model that takes in audio and produces audio, instead of three separate steps) covers jobs 2, 3 and 4 in one call. You still need a phone path, turn-taking and tools around it, and how much of that the model provider covers varies.

Six jobs on a phone call, compared for a stack you assemble and a single voice API.

The six jobs on a phone call, compared for a stack you assemble and a single voice API.

Assembling the stack yourself

Open-source agent runtimes give you the parts. LiveKit is open-source WebRTC transport plus an agent framework that runs your code in a connection room. Pipecat is an open-source Python pipeline you assemble from parts. Both leave you to host the servers and write the glue between speech recognition, the model and speech generation, as AssemblyAI's 26 October 2026 comparison of Vapi, LiveKit, Retell and Pipecat describes (https://www.assemblyai.com/blog/vapi-vs-pipecat-vs-livekit). In that mapping, turn detection and barge-in live in the pipeline code in LiveKit and Pipecat, not inside the speech model.

The Launch HN thread for Speko describes a typical production voice agent as an ensemble of three models: STT, an LLM, and TTS (https://news.ycombinator.com/item?id=49332751). One commenter asks for a single API that is the conversation itself, including turn-taking. The founder says hosted sessions can handle voice activity detection (VAD, detecting when someone is speaking) and turn-taking, whereas a routing gateway leaves turn-taking in your framework.

Assembling the stack is the right path when you need to inspect or change individual audio frames, swap models freely, and you have the team to run real-time media infrastructure. The cost is ownership: you keep the glue, the logs, the retries, and the failures at 2 a.m.

A related mistake is to treat a carrier API as the agent. Matt Ewens's 26 August 2026 Dev.to post makes the category point: Twilio Voice is a carrier and call-control API, not an agent (https://dev.to/mattewens/i-priced-every-voice-ai-stack-for-a-10k-minute-month-the-results-surprised-me-2037). Building on the raw carrier still means writing recognition, generation, the model call, glue, logging and retries yourself. The same post notes that a demo which handles five test calls tells you almost nothing about cost at real usage. Use that as a caution about demos, not as a price comparison. Prices change, and this article does not quote them.

Calling one voice API

A managed voice API, sometimes called a call API, is a service that starts a call and runs the STT, model and TTS loop for you. You still have to decide who owns the phone number, how tools reach your systems, and how you test before anyone is dialled.

The 4 August 2026 Dev.to comparison by Agdex groups the field into agent runtimes, managed phone platforms, speech-to-speech APIs, and component vendors (https://dev.to/agdex_ai/best-voice-ai-agent-platforms-and-frameworks-in-2026-livekit-vs-pipecat-vs-vapi-vs-retell-47jk). It also notes that a phone conversation still needs real-time transport, telephony, interruption handling and business logic on top of the model. AssemblyAI describes Retell as a managed, low-code platform built for phone agents, and Vapi as API-first: you call one API and it runs the STT, LLM and TTS loop (https://www.assemblyai.com/blog/vapi-vs-pipecat-vs-livekit).

Those are useful category labels, not a ranking. Read each vendor's own docs for what they actually sell. On telephony, for example, Vapi documents importing or providing numbers and bringing your own SIP trunk, including Twilio Elastic SIP Trunking (https://docs.vapi.ai/advanced/sip/sip-trunk, https://docs.vapi.ai/advanced/sip/twilio). Retell documents custom telephony over SIP, with guides for Twilio, Telnyx and Vonage, and says other SIP providers work too (https://docs.retellai.com/deploy/custom-telephony). Those pages tell you who can own the number. They do not tell you whether barge-in, language coverage, or post-call delivery will fit your call.

Speech-to-speech models, as mapped by the Agdex post, collapse recognition, reasoning and speech into one model call (https://dev.to/agdex_ai/best-voice-ai-agent-platforms-and-frameworks-in-2026-livekit-vs-pipecat-vs-vapi-vs-retell-47jk). That can simplify jobs 2, 3 and 4. The phone path, turn-taking and tools still have to live somewhere.

How to think about the trade-off

If you assemble the stack, you can change any layer, and you are responsible for every layer. If you call one voice API, you move faster on a standard flow, and you give up some control over frames, model wiring and failure modes.

The decision is easier if you keep three questions in view.

What are you actually comparing? A carrier, a framework and a managed call API sit at different layers. Comparing "Twilio versus Vapi" as if they were the same kind of product will produce a confusing bake-off. Start by naming the job: who places the phone call, who runs the conversation, and who stores what happens afterward.

What does "one API" cover on a phone line? If the page does not say how phone audio is encoded, how interruptions are handled, or when post-call data arrives, you are still buying an ensemble, just with a cleaner logo.

How will you test before a real number? A laptop microphone over WebRTC is a fair first hearing, and it does not stand in for a phone-network trial. G.711 phone audio and a browser microphone are different inputs, and an agent that sounds clear in the browser can still stumble on a handset.

A phone call using G.711 at 8 kHz beside a WebRTC browser call from a laptop microphone.

A PSTN call encoded with G.711 at 8 kHz beside a WebRTC browser call from a laptop microphone. Audio formats from ITU-T G.711 and the W3C WebRTC Recommendation, as cited in the post.

Common mistakes

  • Judging a stack from a handful of demo calls. Ewens's caution about five test calls applies here (https://dev.to/mattewens/i-priced-every-voice-ai-stack-for-a-10k-minute-month-the-results-surprised-me-2037).
  • Treating list prices as the whole cost, or quoting a calculator default as a typical rate. Prices move. Read the current page when you are ready to buy, and keep this article on the architecture.
  • Ignoring barge-in and turn-taking because the greeting sounds fluent.
  • Ignoring language coverage until the first real caller mixes languages. If language selection only applies a label, and does not resolve a full STT, reasoning and voice stack, the first mixed call will show it.
  • Attaching a phone number before you have heard the agent in a browser.

A checklist you can use with any stack

Write the answers down for each platform you are considering. The value is in the questions, not in a winner.

  1. Start of call. How do you start a browser call, and how do you start a phone call? Do they use the same API, or two different setups?
  2. Carrier and bills. Who provides the number? If you bring your own carrier, how many bills will you see: platform minutes, carrier minutes, number rental, taxes?
  3. Audio. What encoding does the phone path use? Is G.711 (8 kHz mu-law or A-law) documented? What does the browser path use?
  4. Turn-taking. Where does barge-in live: in the speech model, or in the pipeline around it? How do you test it?
  5. Language. Does choosing a language resolve a complete STT, reasoning and voice stack, or only a prompt label? Can a caller move between Hindi and English in one call, and is that one stack or a mid-call engine swap?
  6. Tools. Can the agent call your own HTTPS endpoint or tool server during the call? What happens if that call is slow, or if the caller speaks before the result is said out loud?
  7. After the call. What comes back: transcript, summary, structured fields? When is it delivered, and what is skipped if there was no caller speech?
  8. Test path. Can you hear the agent from a laptop, with no phone number, before you attach a carrier?

If a vendor page cannot answer one of these, treat that as a gap in the comparison, not as a yes.

A note on Rymi

Rymi is an AI voice agent platform for real phone calls (https://www.rymi.live). It is a managed call API: you start a call, and the speech-to-text, model and text-to-speech loop run as one service. You can hear an agent in a browser test, with no phone number, before you attach a carrier. A Hindi agent runs on one Hindi/English speech stack, so a caller can move between Hindi and English in a call. That is not mid-call language detection, and it is not a mid-call engine swap.