@halilertekin/claude-code-router-config
v2.4.4
Published
Multi-provider configuration for Claude Code Router with intent-based routing, advanced CLI tools, analytics, and smart routing. Setup OpenAI, Anthropic, Gemini, Qwen, GLM, OpenRouter, and GitHub Copilot with intelligent routing.
Maintainers
Readme
Claude Code Router Config - Advanced Multi-Provider Setup
🚀 v2.4.4 - Multi-provider Claude Code routing with GLM-5, Claude Pro, DeepSeek & more!
Use Claude Code as a single interface to access multiple AI providers with intelligent routing for optimal performance, cost, and quality.
✨ Quick Start
# 1. Install
npm install -g @halilertekin/claude-code-router-config
# 2. Configure API keys in ~/.env
export GLM_API_KEY="your_key"
# 3. Use with Claude Code
glm # → z.ai GLM-4.7 (Coding Plan)
glm5 # → z.ai GLM-5 (Coding Plan)
glmapi # → z.ai GLM-5 (API Credits)
claude-pro # → Anthropic Claude Pro
deepseek # → DeepSeek📋 Available Aliases
| Alias | Provider | Endpoint | Model | Best For |
|-------|----------|----------|-------|----------|
| glm | z.ai | Coding Plan | GLM-4.7 | Pro subscription coding |
| glm5 | z.ai | Coding Plan | GLM-5 | Max users, complex tasks |
| glmapi | z.ai | API Credits | GLM-5 | Pay-per-use (30$ bakiye) |
| claude-pro | Anthropic | Official | Claude Sonnet 4.5 | Premium coding |
| deepseek | DeepSeek | Anthropic API | deepseek-chat | Budget coding |
| minimax / mm | MiniMax | Anthropic API | M2.5 | Long context |
🚀 Installation
Option 1: NPM (Recommended)
npm install -g @halilertekin/claude-code-router-config
source ~/.zshrcOption 2: Manual
git clone [email protected]:halilertekin/CC-RouterMultiProvider.git ~/code/claude-code-router-configThen add to ~/.zshrc:
[[ -f "$HOME/code/claude-code-router-config/cli/ccc.zsh" ]] && source "$HOME/code/claude-code-router-config/cli/ccc.zsh"🔑 API Key Setup
Add to ~/.env:
# z.ai (GLM) - https://z.ai/apikeys
export GLM_API_KEY="your_zai_key"
# Anthropic Claude Pro - https://console.anthropic.com/settings/keys
export ANTHROPIC_API_KEY="your_anthropic_key"
# DeepSeek - https://platform.deepseek.com/
export DEEPSEEK_API_KEY="your_deepseek_key"
# MiniMax - https://platform.minimax.io/
export MINIMAX_API_KEY="your_minimax_key"
# OpenAI - https://platform.openai.com/api-keys
export OPENAI_API_KEY="your_openai_key"
# Gemini - https://aistudio.google.com/apikey
export GEMINI_API_KEY="your_gemini_key"💻 Claude Code Usage
Direct Aliases
# GLM via Coding Plan (subscription)
glm
# GLM via API Credits (pay-per-use)
glmapi
# Official Claude Pro
claude-pro
# DeepSeek
deepseekWith Arguments
glm "write a React component"
glmapi --print "explain this code"
claude-pro --dangerous-skip-install🏢 Provider Details
z.ai (GLM)
- Website: https://z.ai
- Models: GLM-5 (recommended for max users), GLM-4.7, GLM-4.5
- Endpoints:
- Coding Plan:
https://api.z.ai/api/coding/paas/v4 - API Credits:
https://api.z.ai/api/paas/v4
- Coding Plan:
- Pricing: Very competitive, 3x usage with Coding Plan
- Note: For maximum users/capacity, use GLM-5 as documented in official z.ai docs
Claude Pro
- Website: https://www.anthropic.com/claude
- Models: Claude Sonnet 4.5, Claude Opus 4.5, Claude Haiku
- Access: Use
claude loginor API key
DeepSeek
- Website: https://www.deepseek.com
- Models: deepseek-chat, deepseek-coder
- Pricing: Very affordable
MiniMax
- Website: https://www.minimax.io
- Models: M2.5, M2, M1
- Endpoint:
https://api.minimax.io/anthropic - Features: Ultra-long context (200k+ tokens), very competitive pricing
🛠️ Advanced Features
Full Router Mode
For intent-based routing with automatic model selection:
ccr start # Start router
ccr code # Start Claude Code with router
ccr status # Check status
ccr benchmark # Benchmark providersConfiguration Templates
ccr config template performance-optimized # Fastest
ccr config template cost-optimized # Cheapest
ccr config template quality-focused # Best qualityAnalytics
ccr analytics today --detailed
ccr ui # Web dashboard📖 Documentation
User Guides
Optimization & Best Practices
- 📚 Claude Code Optimization Guide NEW!
- Token optimization tips (25-35% savings)
- Best practices for CLAUDE.md
- Model selection strategies
- Applied optimizations for v2.4.3
🔧 Troubleshooting
"GLM_API_KEY not set"
- Check
~/.envfile exists and has the key - Run
source ~/.zshrcor restart terminal
Model not working
- Verify API key is valid
- Check quotas/balance
🔒 Security
This package follows security best practices:
Vulnerability Management
- Automated scanning: Dependabot monitors dependencies
- Zero vulnerabilities: All reported issues are patched promptly
- Version 2.4.4: All security advisories resolved
Security Updates
# Check for updates
npm outdated -g @halilertekin/claude-code-router-config
# Update to latest
npm update -g @halilertekin/claude-code-router-configAPI Key Safety
- API keys stored in
~/.env(never in code) .envis gitignored by default- Keys are loaded securely with shell source
Reported Vulnerabilities
- ✅ All vulnerabilities fixed in v2.4.4
- See Security Advisories
License
MIT © Halil Ertekin
⭐ Support
If you find this useful, please give it a ⭐ on GitHub!
