Run Claude Code via OpenRouter instead of the Anthropic API.
OpenRouter gives you access to Claude models through a single API key, with unified billing across providers.
go install github.com/borje/orcc@latestOr build from source:
git clone https://github.com/borje/orcc
cd orcc
go install .- Get an API key at https://openrouter.ai/keys
- Add it to
~/.config/orcc/config.yaml(created automatically on first run):
api_key: "sk-or-..."orcc claude # start Claude Code
orcc claude --print "hello" # pass args to claude
orcc models # list available models (pipes to fzf if installed)All arguments after claude are passed through to the claude CLI unchanged.
~/.config/orcc/config.yaml:
api_key: "sk-or-..."
# Model used when you don't pass --model
default_model: "anthropic/claude-sonnet-4.6"
# Models used internally by Claude Code for different roles
models:
opus: "anthropic/claude-opus-4.7"
sonnet: "anthropic/claude-sonnet-4.6"
haiku: "anthropic/claude-haiku-4.5"
subagent: "anthropic/claude-opus-4.7"You can swap in any model available on OpenRouter — not just Anthropic ones.
orcc claude replaces itself (via exec) with the claude process after setting:
ANTHROPIC_BASE_URL=https://openrouter.ai/apiANTHROPIC_AUTH_TOKEN=<your key>- model env vars for each Claude Code role
Claude Code never knows it's talking to OpenRouter.
- Go 1.21+
- Claude Code installed (
claudein PATH)