ctrl-alt-win
v1.0.51
Published
Use Claude Code without an Anthropics account and route it to another LLM provider
Maintainers
Readme
CTRL + ALT + WIN
A powerful tool to route Claude Code requests to different models and customize any request.
✨ Features
- Model Routing: Route requests to different models based on your needs (e.g., background tasks, thinking, long context).
- Multi-Provider Support: Supports various model providers like OpenRouter, DeepSeek, Ollama, Gemini, Volcengine, and SiliconFlow.
- Request/Response Transformation: Customize requests and responses for different providers using transformers.
- Dynamic Model Switching: Switch models on-the-fly within Claude Code using the
/modelcommand. - GitHub Actions Integration: Trigger Claude Code tasks in your GitHub workflows.
- Plugin System: Extend functionality with custom transformers.
🚀 Getting Started
1. Installation
First, ensure you have Claude Code installed:
npm install -g @anthropic-ai/claude-codeThen, install CTRL + ALT + WIN:
npm install -g ctrl-alt-win2. Configuration
Create and configure your ~/.claude-code-router/config.json file. For more details, you can refer to config.example.json.
The config.json file has several key sections:
PROXY_URL(optional): You can set a proxy for API requests, for example:"PROXY_URL": "http://127.0.0.1:7890".LOG(optional): You can enable logging by setting it totrue. When set tofalse, no log files will be created. Default istrue.LOG_LEVEL(optional): Set the logging level. Available options are:"fatal","error","warn","info","debug","trace". Default is"debug".Logging Systems: The CTRL + ALT + WIN uses two separate logging systems:
- Server-level logs: HTTP requests, API calls, and server events are logged using pino in the
~/.claude-code-router/logs/directory with filenames likecaw-*.log - Application-level logs: Routing decisions and business logic events are logged in
~/.claude-code-router/ctrl-alt-win.log
- Server-level logs: HTTP requests, API calls, and server events are logged using pino in the
APIKEY(optional): You can set a secret key to authenticate requests. When set, clients must provide this key in theAuthorizationheader (e.g.,Bearer your-secret-key) or thex-api-keyheader. Example:"APIKEY": "your-secret-key".HOST(optional): You can set the host address for the server. IfAPIKEYis not set, the host will be forced to127.0.0.1for security reasons to prevent unauthorized access. Example:"HOST": "0.0.0.0".NON_INTERACTIVE_MODE(optional): When set totrue, enables compatibility with non-interactive environments like GitHub Actions, Docker containers, or other CI/CD systems. This sets appropriate environment variables (CI=true,FORCE_COLOR=0, etc.) and configures stdin handling to prevent the process from hanging in automated environments. Example:"NON_INTERACTIVE_MODE": true.Providers: Used to configure different model providers.Router: Used to set up routing rules.defaultspecifies the default model, which will be used for all requests if no other route is configured.API_TIMEOUT_MS: Specifies the timeout for API calls in milliseconds.
3. Running Claude Code with the Router
Start Claude Code using the router:
caw codeNote: After modifying the configuration file, you need to restart the service for the changes to take effect:
caw restart
4. UI Mode
For a more intuitive experience, you can use the UI mode to manage your configuration:
caw uiThis will open a web-based interface where you can easily view and edit your config.json file.
