Skip to content

Linux / WSL Guide

This guide helps you configure AI coding tools on Linux or Windows WSL using Any API as the API gateway.

Step 1: Install Node.js

bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm install --lts

Method 2: Debian / Ubuntu

bash
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs

WSL Users

  • Make sure WSL2 is installed (Ubuntu distribution recommended)
  • Using nvm is recommended to avoid permission issues

Verify installation:

bash
node --version
npm --version

Step 2: Install Claude Code

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

Verify installation:

bash
claude --version

Step 3: Set Environment Variables

Method 1: Temporary (Current Session)

bash
export ANTHROPIC_BASE_URL="https://anyapi.pro"
export ANTHROPIC_AUTH_TOKEN="your_api_key"
bash
echo '' >> ~/.bashrc
echo '# API config' >> ~/.bashrc
echo 'export ANTHROPIC_BASE_URL="https://anyapi.pro"' >> ~/.bashrc
echo 'export ANTHROPIC_AUTH_TOKEN="your_api_key"' >> ~/.bashrc
source ~/.bashrc

Method 3: zsh Permanent

bash
echo 'export ANTHROPIC_BASE_URL="https://anyapi.pro"' >> ~/.zshrc
echo 'export ANTHROPIC_AUTH_TOKEN="your_api_key"' >> ~/.zshrc
source ~/.zshrc

Verify environment variables:

bash
echo $ANTHROPIC_BASE_URL
echo $ANTHROPIC_AUTH_TOKEN

Step 4: Start Using

bash
claude

Common Issues

npm Permission Error (EACCES)

bash
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
npm install -g @anthropic-ai/claude-code

Accessing Windows Files in WSL

bash
# Windows filesystem is mounted under /mnt/
cd /mnt/c/Users/YourName/

# It's recommended to work in the WSL native filesystem
cd ~

API PLAT