Login
Back to Blog
Claude Code Installation and Usage Guide - AI Programming Assistant Setup

Claude Code Installation and Usage Guide - AI Programming Assistant Setup

C
Crazyrouter Team
January 24, 2026
38 viewsEnglishTutorial
Share:

Claude Code is a powerful AI programming assistant that allows you to collaborate with AI directly in your terminal. This guide will walk you through the installation and configuration process.

System Requirements#

Before installing Claude Code, ensure your system meets these requirements:

  • Node.js: Version 18.0 or higher
  • Operating System: macOS, Linux, or Windows (WSL recommended)

Quick Start#

Step 1: Install Node.js#

If you already have Node.js 18.0 or higher installed, you can skip this step.

Ubuntu / Debian#

bash
# Install Node.js LTS version
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo bash -
sudo apt-get install -y nodejs

# Verify installation
node --version

macOS#

bash
# Install Xcode command line tools
sudo xcode-select --install

# Install Homebrew (if not already installed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install Node.js via Homebrew
brew install node

# Verify installation
node --version

Step 2: Install Claude Code#

Install Claude Code globally using npm:

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

# Verify installation
claude --version

Step 3: Configure API Access#

You need two configuration items to use Claude Code with Crazyrouter API:

ConfigurationDescriptionHow to Obtain
ANTHROPIC_AUTH_TOKENAPI authentication tokenCreate a token on the API Tokens page (starts with sk-)
ANTHROPIC_BASE_URLAPI service addressUse https://crazyrouter.com/

Recommended token settings:

  • Name: Any descriptive name
  • Quota: Set to unlimited for development
  • Group: Select "Claude Code" or "Official Claude 3+"
  • Other options: Keep default settings

Step 4: Launch Claude Code#

Linux / macOS#

bash
# Navigate to your project directory
cd your-project-folder

# Set environment variables
export ANTHROPIC_AUTH_TOKEN=sk-your-token-here
export ANTHROPIC_BASE_URL=https://crazyrouter.com/
export API_TIMEOUT_MS=300000

# Launch Claude Code
claude

Windows PowerShell#

powershell
# Navigate to your project directory
cd your-project-folder

# Set environment variables
$env:ANTHROPIC_BASE_URL = "https://crazyrouter.com/"
$env:ANTHROPIC_AUTH_TOKEN = "sk-your-token-here"
$env:API_TIMEOUT_MS = "300000"

# Launch Claude Code
claude

Windows CMD#

cmd
# Navigate to your project directory
cd your-project-folder

# Set environment variables
set ANTHROPIC_BASE_URL=https://crazyrouter.com/
set ANTHROPIC_AUTH_TOKEN=sk-your-token-here
set API_TIMEOUT_MS=300000

# Launch Claude Code
claude

Step 5: First Run Configuration#

After launching Claude Code for the first time, you'll see these configuration steps:

  1. Select Theme - Choose your preferred color theme and press Enter
  2. Safety Notice - Review and confirm the safety notice
  3. Terminal Configuration - Use default configuration or customize
  4. Working Directory Trust - Trust the current directory to allow file access

Congratulations! You're now ready to start coding with your AI programming partner.

Permanent Configuration (Optional)#

To avoid setting environment variables every time, add them to your shell profile:

Bash (~/.bashrc or ~/.bash_profile)#

bash
export ANTHROPIC_AUTH_TOKEN=sk-your-token-here
export ANTHROPIC_BASE_URL=https://crazyrouter.com/
export API_TIMEOUT_MS=300000

Zsh (~/.zshrc)#

bash
export ANTHROPIC_AUTH_TOKEN=sk-your-token-here
export ANTHROPIC_BASE_URL=https://crazyrouter.com/
export API_TIMEOUT_MS=300000

After adding, reload your shell:

bash
source ~/.bashrc  # or source ~/.zshrc

Frequently Asked Questions#

"Invalid API Key" Error#

If you see "Invalid API Key - Please run /login", check:

  • ANTHROPIC_AUTH_TOKEN is set correctly (starts with sk-)
  • ANTHROPIC_BASE_URL is set to https://crazyrouter.com/
  • Restart your terminal after setting environment variables

"Offline" Status#

Claude Code checks network status by connecting to Google. Showing "offline" doesn't affect normal usage - it just indicates inability to connect to Google's servers.

Web Fetch Failures#

Claude Code performs security checks before accessing web pages. Ensure:

  • Stable internet connection
  • Use a global proxy if necessary

Persistent "Fetch Failed" Errors#

This may be caused by network issues. Try:

  1. Exit Claude Code (Ctrl+C)
  2. Re-run the claude command
  3. If the problem persists, try again later

API Errors#

If you encounter API errors:

  • Exit Claude Code (Ctrl+C)
  • Wait a moment and restart
  • Check your token quota on the dashboard

Important Notes#

  • Crazyrouter provides direct forwarding to official Claude Code services
  • Keep your API token secure and never share it publicly
  • Monitor your usage on the dashboard to avoid unexpected charges

Pricing#

Claude Code uses Claude models with the following pricing on Crazyrouter:

ModelInput PriceOutput Price
claude-opus-4-5$2.50/1M tokens$12.50/1M tokens
claude-sonnet-4-5$1.50/1M tokens$7.50/1M tokens
claude-haiku-4-5$0.40/1M tokens$2.00/1M tokens

All prices include a 45% discount compared to official rates.


Need help? Contact support or check the Crazyrouter documentation for more information.

Related Articles