Save 45% on Claude API costs — Use Claude Code through Crazyrouter's OpenAI-compatible API gateway.
Crazyrouter is an AI API gateway that gives you access to all major models (Claude, GPT, Gemini, etc.) through a single API key — at significantly lower prices.
| Model | Official Price (Input/Output) | Crazyrouter Price | Savings |
|---|---|---|---|
| Claude Opus 4 | $15 / $75 per 1M tokens | $8.25 / $41.25 | 45% |
| Claude Sonnet 4 | $3 / $15 per 1M tokens | $1.65 / $8.25 | 45% |
| Claude Haiku 3.5 | $0.80 / $4 per 1M tokens | $0.44 / $2.20 | 45% |
Sign up at crazyrouter.com and grab your API key.
export ANTHROPIC_BASE_URL=https://crazyrouter.com?utm_source=github&utm_medium=github&utm_campaign=dev_community
export ANTHROPIC_API_KEY=sk-your-crazyrouter-keyOr add to your shell profile (~/.bashrc, ~/.zshrc):
echo 'export ANTHROPIC_BASE_URL=https://crazyrouter.com?utm_source=github&utm_medium=github&utm_campaign=dev_community' >> ~/.zshrc
echo 'export ANTHROPIC_API_KEY=sk-your-crazyrouter-key' >> ~/.zshrc
source ~/.zshrcclaudeThat's it! Claude Code will now route through Crazyrouter automatically.
curl -fsSL https://raw.githubusercontent.com/xujfcn/crazyrouter-claude-code/main/setup.sh | bashOr clone and run:
git clone https://github.com/xujfcn/crazyrouter-claude-code.git
cd crazyrouter-claude-code
chmod +x setup.sh
./setup.sh# Required
export ANTHROPIC_BASE_URL=https://crazyrouter.com?utm_source=github&utm_medium=github&utm_campaign=dev_community
export ANTHROPIC_API_KEY=sk-your-crazyrouter-key
# Optional: Set default model
export CLAUDE_MODEL=claude-sonnet-4-20250514Run claude and use /config to set:
API Base URL: https://crazyrouter.com?utm_source=github&utm_medium=github&utm_campaign=dev_community
API Key: sk-your-crazyrouter-key
| Model ID | Description |
|---|---|
claude-opus-4-20250514 |
Most capable, best for complex tasks |
claude-sonnet-4-20250514 |
Balanced performance and cost |
claude-haiku-3-5-20241022 |
Fastest, most affordable |
Q: Is Crazyrouter compatible with Claude Code? A: Yes, 100% compatible. Crazyrouter provides an Anthropic-compatible API endpoint.
Q: Will I lose any features? A: No. All Claude Code features work exactly the same — streaming, tool use, file editing, etc.
Q: How does Crazyrouter offer lower prices? A: Crazyrouter aggregates API usage across users and passes volume discounts to you.
Q: Can I use other models too? A: Yes! With a single Crazyrouter key, you can access GPT-4o, Gemini, Llama, and 200+ other models.
Q: Is my data safe? A: Crazyrouter does not store or log your prompts or completions. All traffic is encrypted via HTTPS.
MIT License — see LICENSE for details.