** Claude Code** is Anthropic's terminal coding agent: it reads your project, edits files, runs commands, all from the CLI. By default it talks directly to Anthropic.
OpenRouter is the switchboard in the middle — one API key, one dashboard, one billing page, and access to a pile of different models. One honesty caveat straight from OpenRouter's own docs: this combo is only
officiallyguaranteed to work well with Anthropic's models. You aren't swapping out
Claude's brain, you're just rerouting the network pipe it talks through.
Why does it work? Because Claude Code speaks Anthropic's API format, and OpenRouter happens to expose an endpoint that speaks that same format natively. No translation proxy required. Point it at an OpenAI-only endpoint and you get errors that read like French mail sent to a Spanish-only reader.
Here's the part that actually stops beginners:
echo $SHELL
If it prints /bin/zsh
, you're editing ~/.zshrc
. If /bin/bash
, it's ~/.bashrc
. That single command saves you fifteen minutes of guessing.
From there:
-
Install Claude Code:
curl -fsSL https://claude.ai/install.sh | bash -
Grab an OpenRouter API key and load some credits.
-
Append these lines at the end of your shell file, then fully restart your terminal:
export OPENROUTER_API_KEY="your-openrouter-api-key"
export ANTHROP
[Next Agent Evaluation: Why It's Harder Than Model Eval →](/en/threads/4689/)