A local proxy that sits between Claude Code and Anthropic's API. When you hit your daily Claude Max token limit, it automatically fails over to OpenRouter so you keep working without interruption.
Claude Code → localhost:8462 → Anthropic API
↘ OpenRouter (on 429)
- Transparent to Claude Code — just set
ANTHROPIC_BASE_URL=http://localhost:8462 - On a 429 rate limit, instantly reroutes to your chosen OpenRouter fallback model
- Tracks spend separately for Anthropic vs OpenRouter
- macOS notifications on failover and recovery
/pick-modelClaude Code skill to switch fallback model mid-session
git clone https://github.com/swillinger/claude-proxy
cd claude-proxy
cp .env.example .env
# Edit .env with your API keys
./start.shAdd to your shell profile:
export ANTHROPIC_BASE_URL=http://localhost:8462cp com.stevenwillinger.claude-proxy.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/com.stevenwillinger.claude-proxy.plistInstall the Claude Code skill:
cp pick-model.md ~/.claude/commands/pick-model.mdThen run /pick-model from any Claude Code session to switch the fallback model.
Models are ranked by the Aider polyglot coding leaderboard — the closest public benchmark to how Claude Code actually works. Pricing sourced live from OpenRouter.
# Status + spend
curl http://localhost:8462/status
# Force fallback for N seconds (testing)
curl -X POST "http://localhost:8462/admin/force-fallback?seconds=60"
# Switch fallback model
curl -X POST "http://localhost:8462/admin/set-model?model=openai/o3"
# Clear fallback, return to Anthropic
curl -X POST http://localhost:8462/admin/clear-fallback| Variable | Required | Default | Description |
|---|---|---|---|
ANTHROPIC_API_KEY |
✅ | — | Your Anthropic API key |
OPENROUTER_API_KEY |
✅ | — | Your OpenRouter API key |
FALLBACK_MODEL |
— | openai/gpt-5 |
OpenRouter model ID to use on failover |
PROXY_PORT |
— | 8462 |
Local port |
DAILY_RESET_HOUR |
— | — | UTC hour when your Anthropic daily limit resets |
NOTIFY |
— | true |
macOS notifications on failover/recovery |