LiveKit
Using OpenRouter with LiveKit Agents
LiveKit Agents is an open-source framework for building voice AI agents. The OpenRouter plugin allows you to access 300+ AI models from multiple providers through a unified API, with automatic fallback support and intelligent routing.
Install the OpenAI plugin to add OpenRouter support:
The OpenRouter plugin requires an OpenRouter API key. Set OPENROUTER_API_KEY in your .env file.
Create an OpenRouter LLM using the with_openrouter method:
Configure multiple fallback models to use if the primary model is unavailable:
Control which providers are used for model inference:
Enable OpenRouter’s web search capabilities:
Include site and app information for OpenRouter analytics: