Here is the exact OpenRouter setup I used for Claude Code and Claude Desktop.
Here is the exact OpenRouter setup I used for Claude Code and Claude Desktop. OpenRouter sits between your apps and dozens of models. One key, one bill, and the freedom to swap models without rebuilding your stack. ⚡ The surprise was how different the two setups are. Same gateway, two completely different paths. 🔧 CLAUDE CODE Open ~/.claude/settings.json and point ANTHROPIC_BASE_URL at https://openrouter.ai/api Add your OpenRouter key as ANTHROPIC_AUTH_TOKEN, clear ANTHROPIC_API_KEY, and set the model aliases to openrouter/free Save, then verify with one terminal prompt before changing anything else ✅ CLAUDE DESKTOP There is no JSON file to edit Open Claude Desktop, enable Developer Mode, then choose Developer → Configure Third-Party Inference Paste the gateway URL and key, select Bearer auth and Static API key Restart the app and run a test prompt 🖥️ THE GOTCHA A daily key limit looks exactly like a broken configuration. A 403 usually means budget, not a bad URL. Check spend before you debug settings. ⚠️ Takeaways: • One OpenRouter key can serve both apps • Claude Code lives in settings.json, Claude Desktop lives in the Developer Mode UI • Always verify the CLI first, then wire the desktop app • Treat the key like a password and rotate it if it was ever exposed Which gave you more trouble, the CLI or the desktop client? 👇 ♻️ Repost if someone on your team is still wiring each AI tool separately. ➕ Follow Deven Goratela (https://lnkd.in/dVt7VtDu) for practical AI workflows and automation systems. #OpenRouter #ClaudeCode #AIAutomation #DeveloperTools #LLM