Skip to content

kdsuomi/cc-simplerouter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cc-simplerouter

simplerouter instantly launches Claude Code against any OpenRouter model with a launch ui for selecting your model (and inference provider, if desired).

The only configuration required is pasting your openrouter API key on first launch. Unlike other "claude code routers", simplerouter configures everything automatically on launch, so your normal Claude Code setup is untouched and you can stop messing with environment variables, local webservers, or manually editing your .claude files.

simplerouter                              # first run: pick a key + model
simplerouter --model z-ai/glm-5.2 .       # launch with a specific model in the current dir

Install

Requires an installed claude CLI.

Windows:

irm https://raw.githubusercontent.com/kdsuomi/cc-simplerouter/main/scripts/install.ps1 | iex

macOS/Linux:

curl -fsSL https://raw.githubusercontent.com/kdsuomi/cc-simplerouter/main/scripts/install.sh | sh

The install scripts download the latest GitHub Release binary and install it to ~/.local/bin. macOS release binaries are Apple Silicon only.

Build from source

Requires Go.

powershell -ExecutionPolicy Bypass -File .\scripts\build_install.ps1
sh ./scripts/build_install.sh

These scripts build from the cloned repo and install the result to ~/.local/bin.

The model picker

Run simplerouter to open the interactive model picker.

image
  • ↑ / ↓ — move the highlight (auto-pages at the top/bottom of a page)
  • ← / → — flip pages
  • type — filter live by id or name
  • — launch the highlighted model
  • Tab — open provider selection for the highlighted model (see below)
  • esc — cancel

The list is pre-filtered to models usable by Claude Code and ordered by OpenRouter popularity, with recommended models pinned at the top.

Provider / endpoint selection

simplerouter default's to OpenRouter's choice of provider. If you want to select a specific inference provider, press Tab on a highlighted model:

image

OpenRouter only honors provider routing in the request body, and Claude Code doesn't let you add body fields. So when you pin a provider, simplerouter starts a tiny localhost proxy for the session and pointsANTHROPIC_BASE_URL at it; the proxy injects provider.only into each request before forwarding to OpenRouter. It binds to 127.0.0.1, makes no changes to your OpenRouter account, and shuts down when claude exits.

Note: pinning sets allow_fallbacks: false, so a transient error from the chosen provider isn't absorbed by OpenRouter's fallback and Claude Code will retry. If a provider is flaky, just pick another (or skip provider selection and let OpenRouter route).

Flags

simplerouter [--model MODEL] [--reset-key] [--disable-thinking] [path-or-prompt] [-- CLAUDE_ARGS...]
  • --model MODEL — OpenRouter model id, name, or unique suffix (skips the picker)
  • --reset-key — forget the saved OpenRouter API key, then prompt again
  • --disable-thinking — drop Claude Code's Anthropic-specific thinking/beta request fields (see below)

What it sets in Claude Code's environment

Only for the launched process. Notably:

  • ANTHROPIC_BASE_URL → OpenRouter (or the local provider proxy, when pinned)
  • ANTHROPIC_AUTH_TOKEN → your OpenRouter key; all model tiers (opus/sonnet/ haiku/subagent) point at your chosen model
  • CLAUDE_CODE_AUTO_COMPACT_WINDOW → the model's context length
  • CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION=false → disables the "suggest what to type next" feature, which otherwise re-sends the whole conversation each turn just to predict your next prompt and wastes money.

Model compatibility

simplerouter targets OpenRouter models that work through Claude Code's Anthropic-compatible API path — i.e. text models that support tool calling (which the picker already filters for).

By default it preserves Claude Code's normal thinking behavior. If a provider chokes on Claude Code's thinking/beta request fields, retry with --disable-thinking:

simplerouter --disable-thinking --model XXX.

About

Install and setup in 26 seconds. Simplerouter configures Claude Code to use any compatible OpenRouter model in seconds, WITHOUT manual editing of config files, environment variables, or messing with local webservers/webUIs. It also doesn't overwrite your existing Claude Code subscription sign-in!

Resources

License

Stars

Watchers

Forks

Packages