OpenRouter
One key, hundreds of models
OpenRouter is an aggregator: one account, one API key, and a catalog of hundreds of models from many labs — Anthropic, OpenAI, Google, Mistral, Meta, and more — all behind a single endpoint. For Nexgile Code users it is the fastest way to experiment across vendors without juggling half a dozen provider accounts.
Get an API key
Section titled “Get an API key”- Sign up at
openrouter.ai(Google or GitHub sign-in works). - Create a key on the keys page (
openrouter.ai/keys). - Add credits — OpenRouter is prepaid; model usage draws down your balance at each model’s listed rate.
Configure in Nx IDE
Section titled “Configure in Nx IDE”- Open Settings → Providers and choose OpenRouter.
- Paste the key into OpenRouter API Key. Once a valid key is set, your remaining credit balance is displayed right next to the field — handy for keeping an eye on spend without leaving the editor.
- Pick a model and save.
Optional: Use custom base URL replaces the default https://openrouter.ai/api/v1 if you route through a proxy.
Dynamic model discovery
Section titled “Dynamic model discovery”Unlike fixed-roster providers, the OpenRouter model list is fetched live from the service, so new models appear in the picker as soon as OpenRouter lists them — no product update needed. The model picker is searchable; type a fragment like sonnet, gpt, or gemini to filter. Model ids use the vendor/model convention:
anthropic/claude-sonnet-4.5 (the default)openai/gpt-4ogoogle/gemini-2.5-proBrowse the full catalog with pricing and context sizes at openrouter.ai/models.
Caching and reasoning support
Section titled “Caching and reasoning support”- Prompt caching works through OpenRouter for the model families that support it — notably the Anthropic Claude line (3.x through Opus 4.6 / Sonnet 4.6 / Haiku 4.5) and several Google Gemini Flash/Pro models. Cache reads bill at the reduced rate the underlying lab charges.
- Thinking controls carry through for hybrid reasoning models: Claude 4.x-family and Gemini 2.5-family entries expose the reasoning budget controls, and
:thinkingvariants always reason. See Model Behavior & Costs. - Image input follows the underlying model’s capability, as reported by the catalog.
When to use OpenRouter
Section titled “When to use OpenRouter”- Trying many models. Comparing how three different models handle your codebase is three profile switches, not three vendor signups.
- Access without accounts. Some models are otherwise gated behind separate platforms; OpenRouter puts them behind the key you already have.
- Fallbacks. Keep an OpenRouter profile as a standby: if your primary provider has an outage or you hit a rate limit mid-task, switch the active configuration profile and continue the same conversation.
- Long-tail and open-weight models. The catalog reaches far beyond the majors.
Working setup example
Section titled “Working setup example”Provider: OpenRouterAPI Key: sk-or-v1-… (balance appears next to the field)Model: anthropic/claude-sonnet-4.5Rate limit: 0s (raise per profile if you hit provider quotas)Save variants of this profile per model you use regularly — or-sonnet, or-gemini-pro, or-cheap-flash — and pin them to modes as needed; switching profiles mid-task keeps the conversation intact.
Troubleshooting
Section titled “Troubleshooting”- 401 errors: the key is wrong or was revoked — paste a fresh key from the OpenRouter dashboard.
- Requests suddenly failing mid-task: usually an exhausted prepaid balance; the balance readout next to the API key field confirms it. Top up and tell the agent to continue.
- A model is missing from the picker: the catalog is live — refresh the settings view; if it’s still absent, OpenRouter no longer lists it (or your account can’t access it).
- Model behaves differently than via the vendor directly: OpenRouter may route a model id to different backing hosts; check the model’s page on the OpenRouter site for routing details.
Related
Section titled “Related”- Providers Overview
- Model Behavior & Costs
- More Providers — other gateways: Requesty, LiteLLM, Unbound, Vercel AI Gateway, Poe
- Connecting an AI Provider