Claude Code Setup Guide
Install and configure the Claude Code CLI to connect to CodyRouter.
Claude Code is Anthropic's official CLI coding assistant. This guide walks you through installation and configuration.
Step 1: Install Claude Code
Open Terminal, PowerShell, or CMD, then run:
bash
npm install -g @anthropic-ai/claude-codeIf you hit permission issues on macOS or Linux, use sudo:
bash
sudo npm install -g @anthropic-ai/claude-codeVerify Installation
bash
claude --versionIf a version number is shown, Claude Code is installed successfully.
Step 2: Set Environment Variables
Claude Code needs two environment variables to connect to CodyRouter:
ANTHROPIC_BASE_URL: service endpointANTHROPIC_AUTH_TOKEN: your API key
Replace YOUR_API_KEY with the API key copied from the dashboard, choose your system, then copy the command into Terminal and press Enter.
bash
cat >> ~/.zshrc << 'EOF'
export ANTHROPIC_BASE_URL="https://api.codyrouter.com/"
export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"
EOF
source ~/.zshrcbash
cat >> ~/.bashrc << 'EOF'
export ANTHROPIC_BASE_URL="https://api.codyrouter.com/"
export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"
EOF
source ~/.bashrcpowershell
[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://api.codyrouter.com/", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "YOUR_API_KEY", "User")Replace YOUR_API_KEY with an API key copied from the dashboard.
Step 3: Start Using Claude Code
bash
claudeClaude Code will analyze the current directory and provide coding assistance.