Setup Guide
This guide covers installing and configuring the OpenRouter proxy for Claude Code.
Prerequisites
Before starting, ensure you have:
- Docker Desktop - Download from https://www.docker.com/products/docker-desktop
- Claude Code CLI - Download from https://claude.ai/download
- OpenRouter API Key - Get from https://openrouter.ai/keys
Installation
Option 1: Using Launcher Scripts (Recommended)
The launcher scripts handle everything automatically.
Windows (PowerShell):
.\launch-claude-openrouter.ps1
Mac/Linux (Bash):
chmod +x launch-claude-openrouter.sh
./launch-claude-openrouter.sh
The script will:
- Check if Docker is running (waits up to 60 seconds if starting)
- Build and start the y-router proxy
- Prompt for your OpenRouter API key (if not configured)
- Prompt for model selection (if not configured)
- Launch Claude Code
Option 2: Using .env File (Skip Prompts)
For a prompt-free experience, configure a .env file first.
- Copy the template:
cp .env.example .env - Edit .env with your settings:
ANTHROPIC_AUTH_TOKEN=sk-or-v1-your-api-key-here ANTHROPIC_MODEL=qwen/qwen-2.5-coder-32b-instruct ANTHROPIC_SMALL_FAST_MODEL=z-ai/glm-4.5-air - Run the launcher - it will use your .env automatically:
.\launch-claude-openrouter.ps1
See configuration.md for detailed .env options.
Option 3: Manual Setup
If you prefer manual control:
- Start the proxy:
docker compose up -d - Verify it’s running:
curl http://localhost:8787/health -
Set environment variables:
Windows (PowerShell):
$env:ANTHROPIC_BASE_URL = "http://localhost:8787" $env:ANTHROPIC_AUTH_TOKEN = "sk-or-v1-YOUR_API_KEY_HERE" $env:ANTHROPIC_MODEL = "qwen/qwen-2.5-coder-32b-instruct" $env:ANTHROPIC_SMALL_FAST_MODEL = "z-ai/glm-4.5-air"Mac/Linux (Bash):
export ANTHROPIC_BASE_URL="http://localhost:8787" export ANTHROPIC_AUTH_TOKEN="sk-or-v1-YOUR_API_KEY_HERE" export ANTHROPIC_MODEL="qwen/qwen-2.5-coder-32b-instruct" export ANTHROPIC_SMALL_FAST_MODEL="z-ai/glm-4.5-air" - Launch Claude Code:
claude
Verifying Your Setup
After installation, verify everything works:
# Check proxy is running
docker ps | grep y-router
# Check proxy health
curl http://localhost:8787/health
# View proxy logs
docker logs y-router
Stopping the Proxy
docker compose down
Rebuilding After Updates
If you’ve updated the proxy code:
# Clean rebuild
docker compose build --no-cache
# Restart
docker compose up -d
Next Steps
- Configuration Guide - Environment variables and .env setup
- Model Guide - Choosing the right OpenRouter model
- Troubleshooting - Common issues and solutions