LiveKit

Using OpenRouter with LiveKit Agents

Using 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.

Installation

Install the OpenAI plugin to add OpenRouter support:

Authentication

The OpenRouter plugin requires an OpenRouter API key. Set OPENROUTER_API_KEY in your .env file.

Basic Usage

Create an OpenRouter LLM using the with_openrouter method:

Advanced Features

Fallback Models

Configure multiple fallback models to use if the primary model is unavailable:

Provider Routing

Control which providers are used for model inference:

Web Search Plugin

Enable OpenRouter’s web search capabilities:

Analytics Integration

Include site and app information for OpenRouter analytics:

Resources