Login
Back to Blog
EnglishTutorial

Claude Code Installation and Usage Guide: AI Programming Assistant Setup

Complete guide to installing and configuring Claude Code, the AI programming assistant. Step-by-step instructions for macOS, Linux, and Windows with Crazyrouter API integration.

C
Crazyrouter Team
February 23, 2026 / 426 views
Share:
Claude Code Installation and Usage Guide: AI Programming Assistant Setup

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#

  • Node.js version โ‰ฅ 18.0
  • Supported operating systems: macOS, Linux, Windows (WSL)

๐Ÿš€ Quick Start#

1. Install Node.js#

๐Ÿ’ก Tip: If you already have Node.js 18.0 or higher installed, you can skip this step.

Ubuntu / Debian Users#

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 Users#

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

2. Install Claude Code#

Install Claude Code globally using npm:

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

# Verify installation
claude --version

3. Configure and Start Using#

Obtain Required Configuration Information#

You need to prepare two important configuration items:

ConfigurationDescriptionHow to Obtain
ANTHROPIC_AUTH_TOKENAPI authentication tokenAfter registration, click Add Token on the API Tokens page (starts with sk-)
ANTHROPIC_BASE_URLAPI service addressUse https://crazyrouter.com/ (same as the main site address)

๐Ÿ“ Recommended settings when creating a token:

  • Name: Any name you prefer
  • Quota: Set to unlimited
  • Group: Select Claude Code dedicated or Official Claude 3 and above
  • Other options: Keep default settings

Launch Claude Code#

Run in your project directory:

Linux / macOS:

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

# Set environment variables
export ANTHROPIC_AUTH_TOKEN=sk-...  # Replace with your actual token
export ANTHROPIC_BASE_URL=https://crazyrouter.com/
export API_TIMEOUT_MS=300000  # Set to 300 seconds timeout

# Launch Claude Code
claude

Windows PowerShell:

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

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

# Launch Claude Code
claude

Windows CMD:

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

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

# Launch Claude Code
claude

First Run Configuration#

After launching, you will see the following configuration steps:

  1. Select Theme โ†’ Choose your preferred theme + Press Enter
  2. Safety Notice โ†’ Confirm safety notice + Press Enter
  3. Terminal Configuration โ†’ Use default configuration + Press Enter
  4. Working Directory Trust โ†’ Trust current directory + Press Enter

โœจ Congratulations! Now you can start coding with your AI programming partner!

โ“ FAQ#

Q: Getting "Invalid API Key ยท Please run /login" error?#

A: This indicates Claude Code didn't detect the environment variables. Please check:

  • Whether ANTHROPIC_AUTH_TOKEN and ANTHROPIC_BASE_URL are set correctly
  • Whether environment variable values are correct (token starts with sk-)
  • If using permanent configuration, whether you restarted the terminal

Q: Why does it show "offline" status?#

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

Q: Why does web page Fetch fail?#

A: Claude Code needs to call Claude service for security checks before accessing web pages. You need to:

  • Maintain a stable international internet connection
  • Use a global proxy if necessary

Q: Requests always show "fetch failed"?#

A: This may be caused by network environment issues. Solution:

  1. Try using a proxy tool
  2. Check your network connection

Q: How to handle API errors?#

A: This may be caused by unstable forwarding proxy. Recommendations:

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

Q: Web login error?#

A: Try clearing the site's cookies, then log in again.

๐Ÿ“Œ Notes#

  • This site directly connects to the official Claude Code forwarding service
  • Only supports Claude Code API traffic, not other API calls
  • Please keep your API token secure and avoid leakage

๐Ÿ’ก Tip: If you encounter other issues, please check the official documentation or contact technical support.

Implementation Guides

Related Posts

Codex CLI Installation Guide: Setup OpenAI's AI Coding Agent in MinutesTutorial

Codex CLI Installation Guide: Setup OpenAI's AI Coding Agent in Minutes

Complete guide to installing and configuring OpenAI Codex CLI, the AI-powered terminal coding agent. Step-by-step setup for macOS, Linux, and Windows with troubleshooting tips.

Feb 20
How to Access 300+ AI Models with One API Key in 5 MinutesTutorial

How to Access 300+ AI Models with One API Key in 5 Minutes

Stop juggling multiple API keys. Learn how to access Claude, GPT, Gemini, DeepSeek and 300+ models through a single OpenAI-compatible endpoint with zero code...

Feb 15
Claude Code Builds a Multi-Model Odds Alert Router: claude-fable-5 vs GPT-5.5 vs QwenTutorial

Claude Code Builds a Multi-Model Odds Alert Router: claude-fable-5 vs GPT-5.5 vs Qwen

The third Claude Code World Cup analytics project: route the same odds alert JSON task across claude-fable-5, GPT-5.5, Qwen Plus, and Gemini to measure valid JSON rate, latency, and fallback behavior through Crazyrouter.

Jun 13
Text-Embedding-3-Small Complete Guide: OpenAI's Cost-Effective Embedding ModelTutorial

Text-Embedding-3-Small Complete Guide: OpenAI's Cost-Effective Embedding Model

A practical guide to OpenAI's text-embedding-3-small model. Covers API usage, dimension reduction, performance benchmarks, and how to build semantic search with code examples.

Feb 23
OpenClaw Architecture: How OpenClaw Works Under the Hood in 2026Tutorial

OpenClaw Architecture: How OpenClaw Works Under the Hood in 2026

A technical deep dive into OpenClaw architecture exploring the Gateway layer, Agent Runtime, Markdown-based memory system, plugin slots, and complete message lifecycle. Learn how OpenClaw processes AI assistant requests from send to reply.

Mar 7
Codex CLI Installation Guide 2026: macOS, Linux, Windows, Proxies, and CITutorial

Codex CLI Installation Guide 2026: macOS, Linux, Windows, Proxies, and CI

A developer-focused June 2026 guide to Codex CLI installation, alternatives, implementation patterns, pricing tradeoffs, and when to use Crazyrouter for unified AI API access.

Jun 4