What OpenRouter is, and why it fits agents
OpenRouter is a single gateway in front of many providers: Claude, GPT, Gemini, DeepSeek, Qwen, Kimi, Grok and more, all reachable with one key and one endpoint, on one bill. For a coding agent that's attractive — you can try or switch models without signing up with each provider separately.
The config
What to set
- ANTHROPIC_BASE_URLPoint Claude Code at OpenRouter's compatible endpoint (via its Anthropic-style support or a small proxy if needed).
- ANTHROPIC_AUTH_TOKENYour OpenRouter API key — all usage is billed through OpenRouter.
- Model idChoose a model by its OpenRouter id (provider/model form). This is how you pick which underlying model runs.
The upside and the catch
OpenRouter through Claude Code
| Upside | Catch |
|---|---|
| One key for many models | Still one global endpoint in Claude Code — no per-task switching |
| Easy to try new models | Model ids and tool-calling vary; some need testing |
| Single bill / usage view | A markup can apply vs going direct to a provider |
The cleaner option: a built-in model list
OpenRouter's real value is "many models, low friction." You can get the same benefit inside an agent that already has a built-in model list — pick any provider/model in the UI and switch in a click. If you like OpenRouter's aggregation, you can still point that agent at OpenRouter; but you can also go direct to a provider when you'd rather skip the markup.
What that looks like with Wuwei
Many models, one UI
Claude, GLM, DeepSeek, Kimi, Qwen, OpenAI-compatible endpoints — and OpenRouter itself — all selectable in a list.
Direct or aggregated
Use OpenRouter for breadth, or go direct to a provider to avoid a markup — your choice per model.
Free, open source, local
MIT-licensed agent on your machine that reads your real files; you only pay the model usage you choose.
FAQ
Can Claude Code use OpenRouter?
Yes. Point ANTHROPIC_BASE_URL at OpenRouter's compatible endpoint, set ANTHROPIC_AUTH_TOKEN to your OpenRouter key, and choose a model by its OpenRouter id. Depending on the build you may need a small translator since OpenRouter is OpenAI-compatible first.
Is OpenRouter worth it for a coding agent?
If you value trying or switching many models behind one key and one bill, yes. The tradeoffs are a possible markup versus going direct, and per-model differences in ids and tool-calling that are worth testing.
Can I get 'many models' without OpenRouter's plumbing?
Yes — use an agent with a built-in model list. Wuwei is free and open source: pick any provider/model in the UI and switch in a click. You can still point it at OpenRouter, or go direct to a provider to skip the markup.