OpenRouter
OpenRouter puts one API key and one OpenAI-compatible endpoint in front of models from Anthropic, OpenAI, Google, Meta, DeepSeek, Qwen, Mistral, xAI and others. You switch models by changing the model id, with no new credential, and OpenRouter handles billing in one place.
Many models on OpenRouter are served by several upstream providers (Llama 3.3 70B, for example, by Groq, DeepInfra, Together and others). OpenRouter chooses one per request, and you can steer that choice for latency or data-handling requirements, as described in Provider routing.
Get credentials
- Sign in at https://openrouter.ai.
- Open Settings → API Keys (direct link: https://openrouter.ai/settings/keys).
- Click Create Key, name it, and copy the
sk-or-v1-...string. - Add credits under Settings → Credits. Requests fail with
402when the balance runs out.
Configure in jambonz
In the portal: Account → LLM Services → + Add LLM Service → OpenRouter.
The sk-or-v1-... key from OpenRouter.
Defaults to https://openrouter.ai/api/v1. Override only for proxies.
Click Test to verify. The test checks the key against OpenRouter’s authenticated key endpoint, so a wrong or revoked key fails here, not on the first call.
Use in an agent verb
Model ids are <org>/<model>:
Available models
The portal’s model dropdown lists OpenRouter’s live catalog of text models. Any model id from openrouter.ai/models works. Common picks for voice agents:
Provider routing
By default OpenRouter routes each request mainly by price, skipping providers that have had a recent outage. For voice, latency usually matters more than price.
Quickest option: a model suffix. Append :nitro to any model id to route by throughput, or :floor to route by price:
Full control: llmOptions.vendorParams. Anything in vendorParams is added to the request sent to OpenRouter, so you can use OpenRouter’s provider routing and model fallbacks directly:
Useful provider fields:
Every id in models must exist. Fallbacks cover a model that can’t be served (outage, rate limit, routing filter), not a misspelled id: an unknown model id fails the whole request with a 400.
Fallback models change the model mid-call. When models is set and the primary model fails, that turn is answered by a different model, with different behaviour and a cold prompt cache. Choose fallbacks that handle your prompt and tools well.
Reasoning
Some models think before answering by default, which adds latency to every turn. OpenRouter’s reasoning parameter controls this across vendors:
In our tests google/gemini-3.5-flash spent 381 tokens thinking by default, took ~2.5 s to its first token, and ran out of a 400-token budget before finishing its answer. With effort: "minimal" it used no thinking tokens and reached its first token in ~1.0 s. openai/gpt-5.4-mini with effort: "none" reached its first token in ~0.7 s versus ~2.2 s at "high".
Prompt caching
For anthropic/... models, jambonz turns on OpenRouter’s automatic prompt caching, so long system prompts are cached after the first turn. OpenAI-family and Gemini models cache automatically on the provider side. Cached tokens are reported in the agent’s per-turn LLM usage.
Quirks & errors
OpenRouter adds a network hop. Expect slightly higher time to first token than calling the model’s own vendor directly. For the lowest latency on a single model family, a direct credential (Anthropic, OpenAI, Groq, …) is faster. OpenRouter’s value is choice and routing.
401 User not found: the key is wrong or revoked. Create a new one at openrouter.ai/settings/keys.
402: the account or key is out of credits, or has hit its spending limit.
404 with provider.only: no allowed provider serves that model. Widen the list or drop only.