Run Claude Code routed through OpenRouter instead of a direct Anthropic subscription/API key — handy as a fallback once your Claude subscription runs out of usage for the session.
claude stays completely untouched. claude-or is a separate command that
launches the same CLI, same args, but with OpenRouter's Anthropic-compatible
gateway (https://openrouter.ai/api) as the backend for that one process.
The OpenRouter API key is either resolved fresh from 1Password
via the op CLI on every invocation, or passed directly as a raw key — either way
it's never written to disk or exported outside that single process's environment.
- Claude Code (
claude) installed and onPATH - An OpenRouter API key, either:
- stored as a 1Password item, resolved via the 1Password CLI
(
op) installed and signed in — or - passed raw as
CLAUDE_OR_API_KEY, noopCLI required
- stored as a 1Password item, resolved via the 1Password CLI
(
curl -fsSL https://raw.githubusercontent.com/Traace-co/claude-or/main/install.sh | bashInstalls to ~/.local/bin/claude-or (override with CLAUDE_OR_INSTALL_DIR). Re-run
the same command any time to update to the latest version.
Alternatively, clone the repo and link the script yourself:
ln -s "$(pwd)/claude-or" ~/.local/bin/claude-or # or copy it anywhere on your PATH
chmod +x claude-orCLAUDE_OR_API_KEY accepts either form:
- A 1Password reference (
op://<vault>/<item>/<field>) — resolved viaop readon every run, never written to disk. Pair it withCLAUDE_OR_OP_ACCOUNTif the item isn't in your default 1Password account. - A raw OpenRouter API key — used as-is, no
opCLI required. Useful in environments without access to 1Password's desktop-unlock bridge (e.g. most devcontainers) — inject it there as a plain secret/env var instead.
export CLAUDE_OR_API_KEY="op://<vault>/<item>/<field>" # 1Password
export CLAUDE_OR_OP_ACCOUNT="<your-1password-account>" # optional, only used with op://
# or
export CLAUDE_OR_API_KEY="sk-or-..." # raw keyDefaults to op://Employee/OpenRouter API Key - Claude Code/credential on the
tennaxia.1password.eu account if unset.
claude # normal Anthropic subscription login, unchanged
claude-or # same CLI, routed through OpenRouter for this runInside a claude-or session, run /status to confirm it's routed through
OpenRouter, and /model to see the Claude models available via OpenRouter's
gateway (enabled by CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1).