How to Build an AI Voice Agent
The production build guide: choosing between a cascading STT-LLM-TTS pipeline and a speech-to-speech model, budgeting your latency in milliseconds, handling barge-in, wiring up telephony, evaluating voice quality, and what it actually costs per minute.
Key Takeaways
- A production voice agent is four parts in a real-time loop: speech-to-text, an LLM with tool access, text-to-speech, and telephony. Budget $50,000-150,000 and 30-45 days for a focused voice MVP that handles one call type well.
- Target under 800ms from the caller finishing their sentence to your agent starting to speak. Above roughly one second, callers assume the line dropped and start talking over the agent.
- The milliseconds go: 100-300ms to detect end of speech, 100-200ms to finalize the transcript, 200-500ms to first LLM token, 100-300ms to first audio, plus 50-150ms of network. Only two of those five are worth optimizing hard.
- Cascading STT-LLM-TTS gives you text-level guardrails, tool calls, and vendor swappability. Speech-to-speech models are faster and more natural but harder to constrain and audit. Most production deployments in 2026 still ship cascading.
- Barge-in is not optional. If the caller cannot interrupt the agent mid-sentence and be heard immediately, the product feels broken regardless of how good the answers are.
- Runtime cost lands around $0.05-0.20 per minute for a cascading stack. That number decides your unit economics long before your build cost does.
A production AI voice agent is four components running in a real-time loop – speech-to-text, an LLM with tool access, text-to-speech, and a telephony layer – held to a hard budget of under 800 milliseconds from the moment the caller stops speaking to the moment your agent starts. Expect roughly $50,000–150,000 and 30–45 days for a focused voice MVP that handles one call type end to end, and roughly $0.05–0.20 per minute in runtime cost once it is live.
The latency target is not an arbitrary engineering preference. According to Stivers et al., PNAS, 2009, turn transitions in human conversation across ten typologically diverse languages are unimodal, with the highest number of transitions occurring between 0 and 200 milliseconds. Every caller arrives with that expectation wired in. You will not hit 200ms with a language model in the loop, but the further past it you drift, the more the caller stops treating the exchange as a conversation and starts treating it as a broken phone system.
Which stack should you build: cascading or speech-to-speech?
This is the first real decision, and it constrains everything after it. A cascading pipeline transcribes audio to text, runs your LLM on the text, and synthesizes the reply back to audio. A speech-to-speech model takes audio in and emits audio out, keeping tone, timing, and prosody inside one model.
| Dimension | Cascading STT → LLM → TTS | Speech-to-speech model |
|---|---|---|
| Typical response latency | 600–1,000ms with tuning | 300–600ms |
| Tool calls and business logic | Mature – standard text tool calling | Improving, but less predictable |
| Guardrails and content control | Strong – inspect and gate every text turn | Weak – harder to intercept before audio |
| Auditability | Text transcript of every turn by default | Requires separate transcription for logs |
| Naturalness, tone, emotion | Flattened – tone is lost at transcription | Noticeably better |
| Vendor swappability | High – three replaceable components | Low – one vendor owns the loop |
| Best fit | Support, scheduling, qualification, intake | Open-ended conversation, coaching, companionship |
Most production business deployments in 2026 still ship cascading, and the reason is not nostalgia. The text layer between transcription and synthesis is where you attach every guardrail, every tool call, every eval, and every compliance log. Giving that up buys you a few hundred milliseconds and a warmer voice, which matters enormously for a companion product and very little for a clinic confirming an appointment. A reasonable default: build cascading, prove the business logic, then pilot speech-to-speech on the specific flows where naturalness is the product.
Where do the milliseconds actually go?
Teams miss latency targets because they optimize the wrong stage. Here is where a typical turn spends its budget, from the caller's last syllable to your agent's first:
- End-of-speech detection: 100–300ms. Voice activity detection waiting to be confident the caller is finished. This is the single largest tunable cost and the most dangerous to cut – shave it too far and the agent interrupts people mid-thought.
- Final transcript: 100–200ms. Streaming transcription should already have partial text; you are only paying for the finalization pass.
- Time to first LLM token: 200–500ms. Driven by model choice, prompt length, and whether the turn triggers a tool call. A tool call that hits your own database adds its own round trip on top.
- Time to first audio: 100–300ms. Streaming TTS should begin synthesizing on the first sentence boundary, not the complete response.
- Network and jitter buffer: 50–150ms. Largely fixed. Co-locate your agent service in the same region as your telephony provider and stop thinking about it.
Only two of those five are worth serious engineering: end-of-speech detection and time to first token. The highest-leverage move is streaming everything – partial transcripts into the LLM, first sentence into TTS, first audio chunk onto the wire – so the stages overlap instead of queueing. The second is a filler strategy: a short, contextual acknowledgment while a slow tool call runs buys you two full seconds of perceived headroom. Measure at p95, not average. The mean looks fine while one call in twenty is unusable.
How do you handle interruptions and barge-in?
Barge-in is the feature that separates a voice agent from a talking IVR, and it is where most demos quietly fail. When a caller starts speaking over the agent, three things must happen within about 100ms: audio playback stops, the in-flight LLM generation is cancelled, and the conversation state is truncated to what the caller actually heard – not what the model generated. Skip that last step and the agent will confidently reference information the caller never received.
The hard part is distinguishing a real interruption from a backchannel. "Mm-hmm," "right," and "okay" are the caller confirming they are listening, and an agent that stops dead every time someone says "uh huh" is worse than one that never stops at all. The practical approach is a two-signal gate: require both sustained speech energy above a threshold and a partial transcript that is not on a backchannel list. Also handle the inverse failure – echo. If your agent hears its own output through a speakerphone and treats it as barge-in, it will interrupt itself in a loop until the caller hangs up.
How do you connect it to the phone network?
Telephony is the part that looks trivial in a diagram and consumes a third of the build. You need a provider that supports real-time media streaming – SIP trunking or a WebSocket audio stream – so raw frames reach your agent service and synthesized audio streams back with no buffering layer in between.
Four constraints reliably surprise teams. First, phone audio is narrowband 8kHz, and transcription accuracy on 8kHz call audio is measurably worse than the wideband audio in every vendor demo – benchmark on real calls or your numbers are fiction. Second, DTMF keypad input still matters, because callers press zero and expect a human. Third, warm transfer needs designing: the agent must summarize the call for the human it hands off to, or you have built an expensive way to make customers repeat themselves. Fourth, call recording and AI-disclosure rules vary by jurisdiction, and the consent prompt has to be part of the flow from day one rather than bolted on before launch.
How do you evaluate a voice agent before it takes real calls?
Text-agent evals do not transfer, because the failure modes live in the audio layer. Build a regression suite of recorded audio and score four dimensions:
- Transcription accuracy on your vocabulary. Vendor word error rates are measured on clean general speech. Yours needs measuring on your product names, drug names, street names, and account formats, over a phone line.
- Task success on complete calls. Not per-turn quality – did the appointment actually get booked, with the right details, in the real system?
- Latency at p50 and p95 over the telephony path, not in a browser tab.
- Interruption behavior. Barge-in success rate and false-positive rate on backchannels, scored separately.
Then run the adversarial set: heavy accents, background noise, hold music, two people talking at once, and callers who change their mind mid-sentence. The general methodology carries over from our guide to evaluating and testing AI agents; the audio harness is the voice-specific addition.
What does it cost to build and to run?
Two separate budgets, and teams routinely model only the first. On the build side, adding a single voice capability to an existing product runs roughly $15,000–50,000. A focused voice MVP – one call type, real telephony, evals, and monitoring – runs $50,000–150,000 over 30–45 days. A production system spanning multiple call types, warm transfer, compliance recording, and a full regression suite starts at $150,000. Voice sits at the upper end of comparable text-agent work because real-time infrastructure and the call-audio test harness are genuine engineering, not prompt iteration.
On the run side, budget roughly $0.05–0.20 per minute all-in across transcription, LLM tokens, synthesis, and telephony. Synthesis and telephony are the largest predictable lines; LLM cost varies most, because it scales with context length and tool calls per turn. Model cost per resolved call rather than per minute – a better model that resolves in ninety seconds beats a cheap one that runs four minutes and still transfers to a human.
What should you build first?
One call type, end to end, in production. Pick the highest-volume, lowest-variance call you handle – appointment confirmation, order status, qualification – and ship it with a clean human handoff path and a hard cap on what the agent may do without approval. That scope fits a 30–45 day build, produces real call recordings to evaluate against, and tells you within a month whether your unit economics work. Voice agents that fail almost always failed at scoping, not at modeling: they tried to answer every call on day one and were beaten by the twenty percent of callers who did not follow the script.
If you want the broader agent architecture context first – tools, memory, guardrails, human approval – start with our guide to building an AI agent for your business, then come back for the audio layer. And if you would rather have a team that has already paid the telephony tuition, that is what we do – see our services for how we scope and ship production voice systems in 30 to 45 days.
Frequently Asked Questions
How much does it cost to build an AI voice agent?
As 2026 planning ranges from a competent team: adding a single voice capability to an existing product runs roughly $15,000 to $50,000; a focused voice agent MVP that handles one call type end to end, including telephony, evals, and monitoring, runs roughly $50,000 to $150,000 and ships in 30 to 45 days; and a production system covering multiple call types with transfers, compliance recording, and a full regression suite starts around $150,000. Voice sits at the upper end of comparable text-agent work because the real-time infrastructure, interruption handling, and call-audio test harness are genuine engineering rather than prompt work.
What is a good latency target for an AI voice agent?
Under 800 milliseconds from the moment the caller stops speaking to the moment the agent starts speaking, measured at the 95th percentile rather than the average. Under 500ms feels genuinely conversational; between 800ms and 1.2 seconds callers start to hesitate and repeat themselves; past about 1.5 seconds they assume the call dropped and talk over the agent, which cascades into transcription errors. Measure the full loop on real phone audio, not in a browser demo, because telephony codecs and jitter buffers add latency your local tests will never show.
Should I use a speech-to-speech model or an STT-LLM-TTS pipeline?
Use a cascading STT-LLM-TTS pipeline if you need reliable tool calls, auditable transcripts, content guardrails, or the ability to swap vendors, which covers most business use cases such as support, scheduling, and qualification. Use a speech-to-speech model when naturalness and latency are the product, the conversation is largely unstructured, and you can tolerate less control over exactly what the model says. Many teams ship cascading first because the text layer is where you attach every guardrail and eval, then evaluate speech-to-speech for specific flows once the business logic is proven.
How do I connect an AI voice agent to my phone system?
Through a telephony provider that supports real-time media streaming, typically over SIP trunking or a WebSocket media stream. The provider handles the phone number, call routing, and the PSTN connection; your service receives raw audio frames, runs the agent loop, and streams audio back. Plan for narrowband 8kHz call audio, which degrades transcription accuracy compared with the wideband audio in vendor demos, plus DTMF keypad input, warm transfer to a human, voicemail detection, and call-recording consent rules that vary by jurisdiction.
How do you test an AI voice agent before it takes real calls?
Build a regression suite of recorded audio, not text transcripts, because the failure modes live in the audio layer. Score four things: transcription accuracy on your own domain vocabulary, task success rate on complete simulated calls, latency at p50 and p95 measured over the phone path, and interruption handling. Then run adversarial calls with accents, background noise, hold music, cross-talk, and callers who change their mind mid-sentence. A voice agent that scores well on clean studio audio and has never been tested on a bad mobile connection is not ready for production.
How much does an AI voice agent cost per minute to run?
Order-of-magnitude planning figure for a cascading stack at 2026 list prices: roughly $0.05 to $0.20 per minute all-in, split across transcription, LLM tokens, speech synthesis, and telephony. Speech synthesis and telephony are usually the largest and most predictable lines; LLM cost varies most because it scales with how much context and how many tool calls each turn carries. Model your cost per resolved call rather than per minute, since a slightly more expensive model that resolves the call in ninety seconds beats a cheap one that takes four minutes and still transfers to a human.
Free Tools
Tell us what you're building — book a free scoping call.
Pick a time that works and walk us through your project — 30 minutes, straight to the point. You leave with a concrete plan, timeline, and cost. No sales pitch — if we're not the right fit, we'll say so.
Keep Reading
Get new playbooks by email
Occasional, no-fluff field notes on building production AI — new guides and tools, straight to your inbox. Unsubscribe anytime.