How to Build a Voice AI Agent
How to Build a Voice AI Agent
This tutorial builds a Python restaurant-booking voice agent that chains speech-to-text, an LLM with tool calling, and text-to-speech through a single OpenRouter API key, streaming each completed sentence to TTS instead of waiting for the full reply. Across 12 turns in three test conversations, median server-side time to first audio was 1.9 seconds (1.4 seconds without tools, 2.4 seconds with a tool call), and a four-turn conversation cost about $0.013 per minute of processed speech at October 8 promotional prices, with TTS accounting for roughly 90% of model cost. It also compares STT, LLM and TTS models on accuracy, latency and price, and shows how to run the same agent with LiveKit Agents for live audio and interruptions.
Source: OpenRouter Announcements · openrouter.ai