Skip to content

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-code

If you hit permission issues on macOS or Linux, use sudo:

bash
sudo npm install -g @anthropic-ai/claude-code

Verify Installation

bash
claude --version

If 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 endpoint
  • ANTHROPIC_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 ~/.zshrc
bash
cat >> ~/.bashrc << 'EOF'
export ANTHROPIC_BASE_URL="https://api.codyrouter.com/"
export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"
EOF
source ~/.bashrc
powershell
[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
claude

Claude Code will analyze the current directory and provide coding assistance.

CodyRouter integration documentation.