Blog
Using any LLM with Claude Code
The agent run is half done. Its subagents are searching files, and they do not need the largest model to do it. Claudish lets each one use another.

Why
Why route to another model
Claudish is a proxy for the Claude Code command line. With it, Claude Code can send its requests to OpenRouter, OpenAI, Gemini or another LLM provider. The agent workflow stays as it is.
- CostSend subagents and test runs to a cheaper model.
- ProvidersSwitch between OpenAI, Google, Anthropic or a local model.
- New modelsTry a model when it is released.
- Same sessionThe
claudishcommand starts Claude Code as before.
How it works
One proxy between CLI and provider
Claude Code makes a request. Claudish takes it and forwards it to the provider named in the model ID. Claude Code asks for a tier (opus, sonnet or haiku), and each tier can map to a different model.
- Claude Code command line
- Claudish proxy on your machine
- Model set for the opus tier
- Model set for the sonnet tier
- Model set for the haiku tier
Prerequisites
What you need first
- Claude Code, installed.
- An API key from at least one provider: OpenRouter, Gemini, OpenAI or Ollama Cloud.
- Without a Pro or Max subscription only: set placeholder Anthropic keys. Subscribers skip this step.
export ANTHROPIC_API_KEY="sk-ant-api03-placeholder"
export ANTHROPIC_AUTH_TOKEN="placeholder"Install
Install Claudish
Use one of these, whichever package manager you have.
npm install -g claudish
bun install -g claudish
brew install claudish
curl -fsSL https://raw.githubusercontent.com/MadAppGang/claudish/main/install.sh | shOptional: run claudish --init to add Claudish as a skill to the current project.
Configure
Set models and keys
Claudish reads its models and API keys from environment variables. Set them in two places: your shell and Claude Code's settings file.
| Variable | Purpose |
|---|---|
OPENROUTER_API_KEY | Signs requests to OpenRouter |
CLAUDISH_MODEL | Default model for interactive and single-shot mode |
CLAUDISH_MODEL_OPUS | Model for opus tier subagents |
CLAUDISH_MODEL_SONNET | Model for sonnet tier subagents |
CLAUDISH_MODEL_HAIKU | Model for haiku tier subagents |
ANTHROPIC_API_KEY | Your Anthropic key, or a placeholder |
ANTHROPIC_AUTH_TOKEN | Your Anthropic token, or a placeholder |
Windows
Open sysdm.cpl, then Advanced, then Environment Variables. Add:
ANTHROPIC_API_KEY=your-anthropic-key
ANTHROPIC_AUTH_TOKEN=your-anthropic-token
OPENROUTER_API_KEY=sk-or-v1-xxxxxxxxxxxxxxxx
CLAUDISH_MODEL=openrouter@openai/gpt-4.1
CLAUDISH_MODEL_OPUS=openrouter@openai/gpt-4.1
CLAUDISH_MODEL_SONNET=openrouter@openai/gpt-4.1-mini
CLAUDISH_MODEL_HAIKU=openrouter@openai/gpt-4.1-nanoThen edit Claude Code's settings at C:\Users\[username]\.claude\settings.json:
{
"env": {
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-5",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-5",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4-5",
"OPENROUTER_API_KEY": "sk-or-v1-xxxxxxxxxxxxxxxx",
"CLAUDISH_MODEL": "openrouter@openai/gpt-4.1",
"CLAUDISH_MODEL_OPUS": "openrouter@openai/gpt-4.1",
"CLAUDISH_MODEL_SONNET": "openrouter@openai/gpt-4.1-mini",
"CLAUDISH_MODEL_HAIKU": "openrouter@openai/gpt-4.1-nano"
}
}Check the values in PowerShell:
$env:CLAUDISH_MODEL
$env:OPENROUTER_API_KEYWSL, Linux and macOS
Create ~/.env:
ANTHROPIC_API_KEY=your-anthropic-key
ANTHROPIC_AUTH_TOKEN=your-anthropic-token
OPENROUTER_API_KEY=sk-or-v1-xxxxxxxxxxxxxxxx
CLAUDISH_MODEL=openrouter@openai/gpt-4.1
CLAUDISH_MODEL_OPUS=openrouter@openai/gpt-4.1
CLAUDISH_MODEL_SONNET=openrouter@openai/gpt-4.1-mini
CLAUDISH_MODEL_HAIKU=openrouter@openai/gpt-4.1-nanoLoad it from ~/.bashrc, ~/.zshrc or ~/.bash_profile:
if [ -f "$HOME/.env" ]; then
set -a
source "$HOME/.env"
set +a
fiThen edit Claude Code's settings at ~/.claude/settings.json:
{
"env": {
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-5",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-5",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4-5",
"OPENROUTER_API_KEY": "sk-or-v1-xxxxxxxxxxxxxxxx",
"CLAUDISH_MODEL": "openrouter@openai/gpt-4.1",
"CLAUDISH_MODEL_OPUS": "openrouter@openai/gpt-4.1",
"CLAUDISH_MODEL_SONNET": "openrouter@openai/gpt-4.1-mini",
"CLAUDISH_MODEL_HAIKU": "openrouter@openai/gpt-4.1-nano"
}
}Check the values:
source ~/.bashrc
echo $CLAUDISH_MODEL
echo $OPENROUTER_API_KEYUse
Run a session
Interactive mode
Start a session with your default model. No model picker appears; it starts at once with CLAUDISH_MODEL.
claudishSingle-shot mode
Run one task with one command. Name a model to override the default.
claudish "task description"
claudish --model "openrouter@openai/gpt-4.1" "task description"Tier routing for subagents
When Claude Code starts a subagent on a given tier, Claudish routes it:
- The opus tier goes to
CLAUDISH_MODEL_OPUS. - The sonnet tier goes to
CLAUDISH_MODEL_SONNET. - The haiku tier goes to
CLAUDISH_MODEL_HAIKU.
Claude Code and Claudish side by side
The first line runs Claude Code on its own. The second runs the same task through Claudish.
claude --model sonnet "task"
claudish "task"Claudish does not keep conversation history. Claude Code does that.
Models
Choose a model
Find models
List every model, search by name, or show the top models.
claudish --models
claudish --models "sonnet"
claudish --models "gpt"
claudish --top-modelsModel IDs
A model ID has the form provider@model:
openrouter@openai/gpt-4.1
openrouter@openai/gpt-4.1-mini
openrouter@openai/gpt-4.1-nano
openrouter@anthropic/claude-opus-4-5
openrouter@google/gemini-3-pro
openrouter@deepseek/deepseek-r1Which setting wins
Claudish reads the tier settings in this order. The first one found is used.
- Command-line flags:
--model-opus,--model-sonnet,--model-haiku - The
CLAUDISH_MODEL_*environment variables - The
ANTHROPIC_DEFAULT_*_MODELenvironment variables - Profile defaults
Advanced
Endpoints and usage
Custom API endpoints
Point Claudish at your own endpoint, such as an Ollama server on the local network.
GEMINI_BASE_URL=https://custom-gemini-endpoint.com
OPENAI_BASE_URL=https://custom-openai-endpoint.com
OPENROUTER_BASE_URL=https://custom-openrouter-endpoint.com
OLLAMA_BASE_URL=http://192.168.1.100:11434
OLLAMA_HOST=http://192.168.1.100:11434Usage and cost
Track what each model used and what it cost on the OpenRouter activity dashboard.
Troubleshooting
When something does not work
Environment variables not loaded
On WSL, Linux and macOS:
source ~/.bashrc
env | grep CLAUDISHIn Windows PowerShell:
$env:CLAUDISH_MODELModel not found
Check that the key is set, then refresh the model list.
echo $OPENROUTER_API_KEY
claudish --models --force-updateSettings not applied
Check the file is in the right place: C:\Users\[username]\.claude\settings.json on Windows , ~/.claude/settings.json elsewhere. Then print the block Claude Code reads:
cat ~/.claude/settings.json | jq '.env'Related
Language models in a process plant
Claudish gives Claude Code any provider's model: a cheaper one, a new one or one on your own hardware. We also put such models to work for plant staff, on procedures, logs and reports.