jolly-apartment-95291
10/22/2025, 5:06 PMtall-airline-16756
10/22/2025, 5:06 PMtall-airline-16756
10/22/2025, 5:08 PMwith_openrouter method from the OpenAI plugin. Here’s a little example to guide you:
from livekit.plugins import openai
llm = openai.LLM.with_openrouter(
model="auto", # or specify a specific model
api_key="your_openrouter_api_key", # or set OPENROUTER_API_KEY env var
site_url="https://yoursite.com", # for analytics
app_name="Your App Name" # for analytics
)
Just be sure to provide your OpenRouter API key, either directly as an argument or by setting the OPENROUTER_API_KEY environment variable. If you’d like, I’m here to help with any advanced configurations or if you want to dive into more details—just let me know!
Sources: livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/models.py