Install Claude Code

Prerequisites

Before you begin, make sure your environment meets these requirements:

  • Node.js 18+ (Node.js 22 LTS recommended)
  • npm 9+ or pnpm 9+
  • Operating system: macOS, Linux, or Windows WSL2
  • Terminal: Any terminal emulator with ANSI color support

Check your Node.js version:

terminal
bash
node --version
# Should output v18.x.x or higher

If you don't have Node.js installed, use nvm to manage versions:

terminal
bash
# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash

# Install Node.js 22 LTS
nvm install 22
nvm use 22

Install Claude Code

Install globally with npm:

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

Or with pnpm:

terminal
bash
pnpm add -g @anthropic-ai/claude-code

Verify the installation:

terminal
bash
claude --version

You should see a version number like 1.x.x.

Get Your Chuizi.AI API Key

  1. Go to app.chuizi.ai and create an account
  2. Navigate to the API Keys page
  3. Click Create Key and enter a recognizable name (e.g., "claude-code")
  4. Copy the generated key (starts with ck-)

The key is shown only once. Store it securely. If you lose it, create a new one.

Verify the Installation

Set temporary environment variables and launch Claude Code:

terminal
bash
ANTHROPIC_BASE_URL=https://api.chuizi.ai/anthropic \
ANTHROPIC_API_KEY=ck-your-key-here \
claude

If everything is working, you'll see the Claude Code interactive interface. Send a simple message to test connectivity:

> Hello, what's today's date?

A successful response means the installation is complete. You can also check the request log at app.chuizi.ai to confirm the request went through.

Update Claude Code

Claude Code is updated frequently. Keep it current:

terminal
bash
npm update -g @anthropic-ai/claude-code

Check the current version:

terminal
bash
claude --version

Uninstall

To remove Claude Code:

terminal
bash
npm uninstall -g @anthropic-ai/claude-code

Next Steps

After installation, follow the Configuration Guide to make Chuizi.AI your default API endpoint so you don't need to set environment variables manually each time.