Conversational Voice Agent Telephony Stack
Real-time voice AI unit economics: Deepgram Nova-2 (STT $0.0043/min) + Claude 3.5 Haiku + Cartesia / ElevenLabs (TTS $0.05/1k chars) + LiveKit WebRTC ($0.004/min) + Twilio SIP. Calculate exact cost per conversation minute.
Interactive Financial Simulator
Adjust your operational inputs to calculate unit costs and profit margin breakdowns.
Itemized Unit Economics & Pricing Model
Detailed mathematical cost model comparing raw component units, provider markups, and optimization strategies.
| Architecture Component | Unit Pricing (2026) | Throughput / Quota Included | Production Notes & Trade-offs |
|---|---|---|---|
| Speech-to-Text: Deepgram Nova-2 | $0.0043 / minute | State-of-the-art streaming transcription with smart formatting and endpointing. | Industry leader in transcription latency (~180ms) |
| LLM Reasoning: Claude 3.5 Haiku / Groq Llama | $0.0080 / minute | Fast streaming responses (~150 tokens generated per conversational turn). | Groq LPU achieves <200ms TTFT; Claude Haiku delivers superior nuance |
| Text-to-Speech: Cartesia Sonic | $0.0400 / minute (~$0.05/1k chars) | Ultra-low latency streaming voice synthesis (90ms audio first-byte latency). | Nearly 50% cheaper than ElevenLabs for comparable voice quality |
| Text-to-Speech Alternative: ElevenLabs Turbo v2.5 | $0.0850 / minute | Unrivaled human emotion and conversational prosody. | Premium voice option; double the cost of Cartesia |
| WebRTC Transport: LiveKit Cloud | $0.0040 / minute | Global distributed WebRTC audio mesh with built-in voice agent orchestration. | Sub-50ms peer-to-peer audio delivery globally |
| Telephony Inbound/Outbound: Twilio SIP Trunking | $0.0085 / minute | Connects standard PSTN cellular phone calls to LiveKit SIP dispatchers. | Required only for standard telephone number integration |
Production Implementation Snippet
Production Voice Agent Loop with LiveKit Agents, Deepgram & Cartesia. Deploy directly into your production pipelines.
# voice_agent.py - Production LiveKit Python agent pipeline
import asyncio
from livekit.agents import JobContext, WorkerOptions, cli
from livekit.plugins import deepgram, cartesia, openai
async def entrypoint(ctx: JobContext):
await ctx.connect()
# Ultra-low latency voice pipeline components:
stt = deepgram.STT(model="nova-2-conversational")
tts = cartesia.TTS(model="sonic-english", voice="a0e99841-438c-4a64-b679-ae501e7d6091")
llm = openai.LLM(model="gpt-4o-mini", temperature=0.7)
# Configure Voice Activity Detection (VAD) with Barge-In interruption support
from livekit.plugins import silero
vad = silero.VAD.load()
print("✓ Voice agent listening on LiveKit room. Latency budget: ~600ms.")
if __name__ == "__main__":
cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint))
Engineering Gotchas & Pitfalls
Critical architectural edge cases documented from real-world high-traffic deployments.
The Voice Activity Detection (VAD) Barge-In Waste
If background noise (dog barking, keyboard typing) falsely triggers user speech detection, the agent cuts off audio playback and re-queries the LLM and TTS engines, wasting billable generation tokens and audio seconds.
TTS Character Billing on Silent Punctuation
TTS providers bill based on raw character count including markdown and formatting tags. Always strip asterisks, em-dashes, and special characters before sending text to the TTS API.
SIP Trunking Connect Time Minimums
Telecom carriers bill SIP phone calls in 6-second or 60-second minimum increments. A 4-second voicemail hang-up can be billed as a full 60-second call segment.
Frequently Asked Questions
Practical architectural questions answered with precise mathematical modeling.
Running a modern real-time voice agent costs between $4.50 and $8.40 per hour of continuous active conversation ($0.075 to $0.14 per minute), depending on whether you choose Cartesia ($0.04/min) or ElevenLabs ($0.085/min) for voice generation.
WebSockets operate over TCP, where packet loss causes head-of-line blocking and audible audio stutters. WebRTC operates over UDP with adaptive jitter buffers, maintaining crystal-clear real-time voice even on unstable cellular connections.
Combine Deepgram Nova-2 streaming STT (180ms) + Groq Llama 3.3 or Claude 3.5 Haiku streaming first token (150ms) + Cartesia streaming TTS first byte (90ms) + LiveKit WebRTC transport (50ms).
Related Architecture Blueprints & Calculators
Explore related cost models and interactive simulators on CheckAPICost.
End-to-End Voice Telephony Architecture & Latency Waterfall
Building real-time conversational voice agents for inbound/outbound telephone calling requires integrating five independent subsystems: PSTN/SIP Trunking (Twilio or LiveKit SIP), WebRTC Audio Transport, Voice Activity Detection (VAD), Speech-to-Text, LLM Reasoning, and Text-to-Speech. The universal engineering challenge is achieving a round-trip conversational turn-taking latency below 500ms. If turn latency exceeds 800ms, human speakers perceive unnatural awkward pauses and accidentally talk over the bot.
Monthly Operating Cost Matrix: Voice Telephony Stack (10,000 Call Minutes)
| Pipeline Layer | Technology Provider | Latency Contribution | Unit Rate | Monthly Subtotal (10k Mins) |
|---|---|---|---|---|
| SIP Trunk / Telephony | Twilio Inbound Trunking | 25ms (PSTN gateway) | $0.0085 / min | $85.00 |
| WebRTC SFU Media Server | LiveKit Cloud | 15ms | $0.0050 / min | $50.00 |
| Voice Activity Detection (VAD) | Silero VAD v5 (Local CPU) | 8ms | $0.00 (In-process) | $0.00 |
| Speech-to-Text (STT) | Deepgram Nova-2 (WebSocket) | 220ms | $0.0043 / min | $43.00 |
| LLM Generation | Llama 3.3 70B (Groq / Together) | 120ms (TTFT) | ~$0.0012 / min | $12.00 |
| Text-to-Speech (TTS) | Cartesia Sonic (PCM Stream) | 85ms (TTFB) | $0.0220 / min | $220.00 |
| Total Telephony Voice Stack | Sub-480ms Round-Trip | Total: 473ms Turn Time | $0.0410 / call min | $410.00 / mo |
Low-Latency LiveKit Voice Agent Worker (Python)
from livekit.agents import JobContext, WorkerOptions, cli
from livekit.plugins import deepgram, cartesia, silero, openai
async def entrypoint(ctx: JobContext):
await ctx.connect()
agent = VoicePipelineAgent(
vad=silero.VAD.load(),
stt=deepgram.STT(model="nova-2"),
llm=openai.LLM.with_groq(model="llama-3.3-70b-versatile"),
tts=cartesia.TTS(model="sonic-english", sample_rate=16000),
chat_ctx=ChatContext().append(role="system", text="You are a helpful phone assistant. Keep answers under 2 sentences.")
)
agent.start(ctx.room)
if __name__ == "__main__":
cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint))
Voice Agent SRE Guardrails
- Barge-In Interrupt Handling: When the caller speaks while the agent is talking, Silero VAD must fire an immediate `interruption` event that sends an empty buffer to the audio track and cancels the ongoing LLM/TTS generation. Purge local buffers within 80ms to avoid talking over the user.
- Dual-Channel Call Recording: Always record telephony calls on two separate channels (caller on Channel 0, bot on Channel 1). Merging into a mono audio stream makes automated post-call QA and transcription analysis inaccurate.
Engineering Q&A: Voice Agent Architecture
Why is WebRTC preferred over raw SIP for audio processing?
SIP requires complex PBX infrastructure and custom RTP packet handling. LiveKit bridges SIP trunks directly into modern WebRTC rooms, providing encryption, jitter buffering, packet loss concealment, and standardized event hooks across iOS, Android, and web clients.
How much cheaper is modular voice architecture compared to OpenAI Realtime API?
OpenAI Realtime API costs approximately $0.18 to $0.30 per minute of voice conversation. The modular LiveKit + Deepgram + Llama 3.3 + Cartesia stack costs ~$0.041 per minute—yielding an immediate 77% to 85% reduction in monthly telephony operating expenses.