A tool to manage OpenRouter integration with Claude Code.
Project description
Claude OpenRouter Tool
Command-line utility for OpenRouter integration with Claude Code. Automates installation and configuration of @musistudio/claude-code-router npm package.
Installation
pipx install claude-openrouter-tool
Requirements
- Python 3.9+
- Node.js/npm
- OpenRouter API key
Commands
setup
claude-openrouter-tool setup
Interactive configuration wizard. Performs npm verification, package installation, API key input, model selection, and configuration file creation.
check
claude-openrouter-tool check
Validates npm installation, router package status, configuration file structure, and API key functionality.
update
claude-openrouter-tool update
Updates @musistudio/claude-code-router to latest version.
config
claude-openrouter-tool config
Interactive configuration management. Supports viewing settings, editing API keys, managing models, and setting defaults.
Supported Models
| Model | Parameters | Application |
|---|---|---|
deepseek/deepseek-r1:free |
671B | Complex reasoning (default) |
deepseek/deepseek-v3-0324:free |
685B MoE | General coding |
qwen/qwen-2.5-coder-32b-instruct:free |
32B | Code generation |
| Llama/Mistral variants | Various | Lightweight operations |
Configuration
File location: ~/.claude-code-router/config.json
{
"Providers": [{
"name": "openrouter",
"api_base_url": "https://openrouter.ai/api/v1/chat/completions",
"api_key": "sk-or-...",
"models": ["deepseek/deepseek-r1:free"]
}],
"Router": {
"default": "openrouter,deepseek/deepseek-r1:free"
}
}
Usage
- Install:
pipx install claude-openrouter-tool - Obtain API key: OpenRouter.ai
- Configure:
claude-openrouter-tool setup - Verify:
claude-openrouter-tool check
Model Management
Add additional models via configuration menu:
claude-openrouter-tool config
Supported model additions:
anthropic/claude-3-haiku:betagoogle/gemini-pro-1.5openai/gpt-4o-mini
Change default model via "Set Default Model" menu option.
Integration
Router package proxies API requests to OpenRouter. Configured models appear automatically in Claude Code interface.
Troubleshooting
Issues and Solutions
| Problem | Solution |
|---|---|
| npm not found | Install Node.js from nodejs.org, verify PATH |
| Permission denied | Use sudo npm install -g @musistudio/claude-code-router |
| Invalid API key | Verify sk-or-... format, check account credits |
| Configuration missing | Execute claude-openrouter-tool setup |
| Models not visible | Verify package status, restart Claude Code |
Diagnostics
claude-openrouter-tool check
Reports npm status, package version, configuration validity, and API key functionality.
References
Alternative Commands
ortool-claude setup|check|config|update
Development
Technology Stack
- Python 3.9+, Click framework
- pytest with pexpect testing
- uv package management
Environment Setup
git clone <repository-url>
cd claude-openrouter-tool
uv sync
uv run pre-commit install
Testing
uv run pytest
Architecture Components
- JSON configuration management
- Automated npm package handling
- Interactive CLI with inquirer prompts
- Comprehensive validation system
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file claude_openrouter_tool-0.1.0.tar.gz.
File metadata
- Download URL: claude_openrouter_tool-0.1.0.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8320437d7bc49bd643f1d900ca4fa6f98e6b4d704478348686f4dea3c92432f4
|
|
| MD5 |
f2f2d613d4035ab31d09859569f6b0b3
|
|
| BLAKE2b-256 |
7babd90aac53e5a107c3278f303205f52421a51d642b058c2f76df7b5c494ad4
|
File details
Details for the file claude_openrouter_tool-0.1.0-py3-none-any.whl.
File metadata
- Download URL: claude_openrouter_tool-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2f5fc9463484cf55d040025789395423ef2d67186bb335e4f17330711851184
|
|
| MD5 |
6a2db23e5146bb02c945f1671b6bcc09
|
|
| BLAKE2b-256 |
5ccdeb693b23bd5c6f93c40a5b2f5cb183bb4095b389da67a405b3ec4c057fa3
|