unbound-claude-code
Version:
Claude Code with Unbound integration - Drop-in replacement for Claude Code with multi-provider routing and cost optimization
100 lines (66 loc) • 2.67 kB
Markdown
# Unbound Code
Unbound Code is a drop-in replacement for Claude Code that automatically routes your API calls through [Unbound](https://getunbound.ai).
### Installation
```bash
npm install -g unbound-claude-code
```
### Usage
Simply replace `claude` with `unbound-claude-code` in your commands:
```bash
# Instead of: claude chat
unbound-claude-code chat
# Instead of: claude
unbound-claude-code
# All Claude Code options work the same
unbound-claude-code --help
```
### First Time Setup
1. Get your Unbound API key from [gateway.getunbound.ai](https://gateway.getunbound.ai)
2. Run `unbound-claude-code` - you'll be prompted to enter your API key
3. Your API key will be securely stored for future use
4. Use Claude Code normally - it will authenticate with your Claude/Anthropic key as usual
## 🔧 Configuration
### API Key Management
```bash
# Set API key directly
unbound-claude-code --api-key YOUR_UNBOUND_KEY
# Use environment variable
export UNBOUND_API_KEY=your_key_here
unbound-claude-code
# View current configuration
unbound-claude-code --show-config
# Clear stored configuration
unbound-claude-code --clear-config
```
### Available Options
```bash
# Show help
unbound-claude-code --help
# Enable debug logging
unbound-claude-code --debug
# Skip authentication (requires UNBOUND_API_KEY env var)
unbound-claude-code --skip-auth
# Show version
unbound-claude-code --version
```
## 🏗️ How It Works
Unbound Code works by intercepting Claude Code's API calls and routing them through Unbound:
1. **You use Claude Code normally** - All commands, shortcuts, and features work identically
2. **Claude Code authenticates normally** - Uses your Claude/Anthropic API key as usual
3. **Unbound Code intercepts API calls** - Transparently redirects calls to Unbound AI
4. **Dual authentication** - Sends both your Claude key and Unbound key to Unbound's API
5. **Smart model routing** - Unbound AI routes to the best available model
6. **Seamless responses** - You get responses exactly as if you were using Claude Code directly
## 📋 Environment Variables
| Variable | Description | Default |
|----------|-------------|---------|
| `UNBOUND_API_KEY` | Your Unbound API key | None (prompted if not set) |
| `UNBOUND_LOG_LEVEL` | Logging level (debug, info, warn, error) | `info` |
| `ANTHROPIC_API_KEY` | Your Claude/Anthropic API key (handled by Claude Code) | None |
## 🤝 Compatibility
- **Node.js**: >= 16.0.0
- **Claude Code**: Latest version (bundled)
- **Operating Systems**: macOS, Linux, Windows
- **Terminals**: All terminals supported by Claude Code
## 📄 License
MIT License - see [LICENSE](LICENSE) file for details.