π v1.1.0 - Now with advanced CLI tools, analytics, smart routing, and configuration templates!
Use Claude Code as a single interface to access multiple AI providers with intelligent routing for optimal performance, cost, and quality.
ccr test <provider> [model] # Test provider connectivity
ccr benchmark --compare-speed # Benchmark all providers
ccr analytics today # View usage statistics
ccr config validate # Validate configuration
ccr health --all-providers # Check provider health- Cost Tracking: Monitor spending per provider and model
- Usage Analytics: Track requests, latency, and success rates
- Performance Metrics: Detailed performance insights
- Health Monitoring: Real-time provider health checks
- Adaptive Routing: Learns from past performance
- Cost-Aware Selection: Optimizes for budget constraints
- Performance-Based: Prioritizes speed when needed
- Quality-Focused: Ensures best results for critical tasks
ccr config template performance-optimized # Speed prioritized
ccr config template cost-optimized # Budget friendly
ccr config template quality-focused # Maximum quality
ccr config template development # Coding optimized
ccr config template balanced # Best of all worlds- Node.js 16+ Support: Compatible with modern Node.js environments
- 7 Provider Support: OpenAI, Anthropic, Gemini, Qwen, GLM, OpenRouter, GitHub Copilot
- Smart Intent-Based Routing: Automatically selects the best model based on your request
- Advanced CLI Tools: Test, benchmark, analyze, and monitor your setup
- Analytics & Cost Tracking: Detailed insights into usage and spending
- Configuration Templates: Pre-optimized setups for different use cases
- Health Monitoring: Real-time provider status and automatic failover
- Enhanced Logging: Detailed logs with metrics and performance data
| Request Type | Provider | Model |
|---|---|---|
| Code writing, debugging | OpenAI | gpt-4o |
| Deep analysis, architecture | Anthropic | claude-sonnet-4 |
| Quick responses, summaries | Gemini | gemini-2.5-flash |
| Simple tasks | Qwen | qwen-plus |
| Translation, multilingual | GLM | glm-4.6 |
| Complex algorithms | OpenAI | o1 |
| Coding assistance | GitHub Copilot | copilot |
- Node.js: >= 16.0.0
- Package Manager: pnpm (preferred) or npm
Caution
Conflict Warning: Do NOT install using both Homebrew and PNPM/NPM simultaneously. Choose only ONE method to avoid command conflicts.
The easiest way to install and keep updated on macOS.
brew uninstall ccr # Remove old versions if present
brew install halilertekin/tap/claude-code-router-configAfter installation, edit your API keys in ~/.env and start the router:
ccr codeUse this if you are on Linux or prefer using a Node package manager.
Warning
If you have previously installed via Homebrew, please uninstall it first: brew uninstall claude-code-router-config
pnpm add -g @halilertekin/claude-code-router-config
# System is ready! Run: ccr --helppnpm add -g @musistudio/claude-code-routermkdir -p ~/.claude-code-router
cp config/config.json ~/.claude-code-router/
cp config/intent-router.js ~/.claude-code-router/Create .env file:
cp .env.example ~/.env
# Edit ~/.env with your API keysOr add to ~/.zshrc / ~/.bashrc:
# Claude Code Router - API Keys
export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."
export GEMINI_API_KEY="AIza..."
export QWEN_API_KEY="sk-..."
export GLM_API_KEY="..."
export OPENROUTER_API_KEY="sk-or-..."
export GITHUB_COPIOT_API_KEY="ghu_..."
# Router Connection
export ANTHROPIC_BASE_URL="http://127.0.0.1:3456"
export NO_PROXY="127.0.0.1"source ~/.zshrc
ccr code# Test provider connectivity
ccr test openai gpt-4o
ccr test anthropic claude-sonnet-4-latest
# Benchmark all providers
ccr benchmark --all --compare-speed
ccr benchmark full 5 --provider=openai --provider=anthropic
# Load testing
ccr benchmark load openai gpt-4o --concurrent=5 --duration=30# Validate configuration
ccr config validate
# Backup configuration
ccr config backup
# Apply templates
ccr config template performance-optimized
ccr config template cost-optimized
ccr config template quality-focused
ccr config template development
ccr config template balanced
# Show detailed status with costs
ccr status --detailed --show-costs# View today's analytics
ccr analytics today --detailed
# View period analytics
ccr analytics week --detailed
ccr analytics month --detailed
# Export data
ccr analytics export --format=csv --period=month
# Health monitoring
ccr health --all-providersccr start # Start router
ccr code # Start with Claude Code
ccr stop # Stop routerInside Claude Code:
/model openai,gpt-4o
/model anthropic,claude-sonnet-4-latest
/model gemini,gemini-2.5-flash
/model qwen,qwen-plus
/model glm,glm-4.6
/model copilot,copilot
| Provider | Link | Notes |
|---|---|---|
| OpenAI | https://platform.openai.com/api-keys | gpt-4o, o1 models |
| Anthropic | https://console.anthropic.com/settings/keys | Claude models |
| Gemini | https://aistudio.google.com/apikey | Google AI models |
| Qwen | https://dashscope.console.aliyun.com/apiKey | Alibaba Cloud |
| GLM | https://open.bigmodel.cn/usercenter/apikeys | Zhipu AI |
| OpenRouter | https://openrouter.ai/keys | Multiple models |
| GitHub Copilot | https://github.com/settings/tokens | copilot scope |
# Test different routing scenarios
claude "Write a Python sorting function" # β OpenAI
claude "Explain microservices architecture" # β Anthropic
claude "Quick summary of REST APIs" # β Gemini
claude "List files in current directory" # β Qwen
claude "Translate to Chinese: Hello" # β GLM
claude "Help me debug this React component" # β GitHub Copilot| Template | Best For | Priority | Cost | Speed |
|---|---|---|---|---|
| performance-optimized | Real-time apps, chatbots | Speed | Low | βββββ |
| cost-optimized | Budget-conscious, bulk processing | Cost | βββββ | βββ |
| quality-focused | Critical tasks, research | Quality | High | ββ |
| development | Coding, debugging | Coding | Medium | ββββ |
| balanced | General use | Balanced | Medium | ββββ |
# Quick template selection
ccr config template performance-optimized # Fastest
ccr config template cost-optimized # Cheapest
ccr config template quality-focused # Best quality- Learning: Improves routing based on historical performance
- Context Awareness: Considers request complexity and timing
- Cost Awareness: Respects budget constraints and optimization goals
- Health Checks: Monitors provider status every 30 seconds
- Circuit Breaker: Automatically routes around failed providers
- Graceful Degradation: Maintains service during provider issues
- Latency Tracking: Monitors and optimizes for speed
- Success Rate: Reliability-based routing decisions
- Load Balancing: Distributes requests optimally
View comprehensive analytics via:
# Web Dashboard (if enabled)
ccr ui
# CLI Analytics
ccr analytics today --detailedMetrics tracked:
- Request volume and patterns
- Cost per provider/model
- Response times and latency
- Success/error rates
- Provider health status
- Complete Documentation (EN)
- Complete Documentation (TR)
- Setup Prompt (EN)
- Setup Prompt (TR)
- Configuration Templates Guide
- β¨ Advanced CLI tools for testing and benchmarking
- π Built-in analytics and cost tracking
- π§ Smart routing with machine learning
- π Configuration templates for different use cases
- π Health monitoring and auto-fallback
- π Enhanced logging with metrics
- π Enhanced web dashboard
- π Plugin system for custom providers
- π€ AI-powered optimization recommendations
- π± Mobile-friendly analytics dashboard
This package provides configuration for @musistudio/claude-code-router, an excellent tool that enables Claude Code functionality with multiple AI providers.
The original Claude Code Router project is developed and maintained by musistudio. This package contains pre-configured routing logic, advanced CLI tools, and provider configurations to help users get started quickly and optimize their AI workflows.
MIT Β© Halil Ertekin
Note: This is an enhanced configuration package. To use it, you need to install the original @musistudio/claude-code-router package.
If you find this useful, please give it a β on GitHub!