Skip to content

OpenRouter

OpenRouter is an OpenAI-compatible aggregator that fronts hundreds of models behind one key. Routeplane has a built-in openrouter provider, so bringing your key in is a single block in routeplane.yaml — and from there OpenRouter’s catalog joins the rest of your registry, with selection and fallback on top.

**Migrating off OpenRouter entirely?** If you want to *replace* OpenRouter rather than route through it, see [Migrate from OpenRouter](/guides/migrate-from-openrouter) — it's a base-URL-and-key swap.
  • Routeplane installed, with a routeplane.yaml (scaffold one with routeplane init).
  • An OpenRouter API key from openrouter.ai/keys, exported as OPENROUTER_API_KEY.

The openrouter provider ships with the right api_base and Bearer auth built in — you only supply the key and the models you want:

routeplane.yaml
providers:
openrouter:
api_key: ${OPENROUTER_API_KEY} # resolved from the environment at load
models:
- id: openai/gpt-4o
- id: anthropic/claude-sonnet-4-6
- id: google/gemini-2.5-pro

Each models id is an OpenRouter model id. The base URL (https://openrouter.ai/api/v1) and chat_completions protocol are the provider’s defaults, so you don’t need to set them.

**Attribution headers.** OpenRouter's optional `HTTP-Referer` / `X-Title` leaderboard headers are not injected. If you want them, add them as per-provider header overrides in `routeplane.yaml`.
Terminal window
routeplane route openrouter:openai/gpt-4o

Then start Routeplane and send a request. Use the provider-qualified id openrouter:openai/gpt-4o to pin the request to OpenRouter, or the bare model name to let Routeplane cascade across sources.