OpenRouter Teaches Building a Voice AI Agent in Python
OpenRouter published a Python tutorial for a restaurant-booking voice agent that combines speech-to-text, an LLM with tool calling, and streamed text-to-speech through one API key. Its example uses Scribe v2, GPT-6 Luna, and Eleven Flash v2.5, sending completed sentences to speech synthesis before the full response is generated. OpenRouter reported a median server-side time to first audio of 1.9 seconds across 12 turns in three test conversations, while text-to-speech accounted for roughly 90% of measured model cost.
The tutorial provides developers with a concrete architecture and implementation pattern for connecting transcription, tool-using language models, and speech synthesis, along with useful latency and cost measurements.
How to Build a Voice AI Agent
OpenRouter ·11/10/2026


A voice agent needs to do more than generate a good answer. It must understand what someone said, decide what to do, call any needed tools, and start speaking again before the pause gets awkward.
In this tutorial, we’ll build that full loop in Python. Our example is a restaurant booking agent that transcribes a caller, checks table availability with tools, and turns the response back into speech. Speech-to-text, the LLM, and text-to-speech all run through one OpenRouter API key, and we stream each completed sentence to TTS instead of waiting for the entire reply.
#OpenRouter#LiveKit#ElevenLabs Scribe v2#GPT-6 Luna#ElevenLabs Eleven Flash v2.5