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
Method 1: nvm (Recommended)
bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm install --ltsMethod 2: Debian / Ubuntu
bash
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejsWSL Users
- Make sure WSL2 is installed (Ubuntu distribution recommended)
- Using nvm is recommended to avoid permission issues
Verify installation:
bash
node --version
npm --versionStep 2: Install Claude Code
bash
npm install -g @anthropic-ai/claude-codeVerify installation:
bash
claude --versionStep 3: Set Environment Variables
Method 1: Temporary (Current Session)
bash
export ANTHROPIC_BASE_URL="https://anyapi.pro"
export ANTHROPIC_AUTH_TOKEN="your_api_key"Method 2: bash Permanent (Recommended)
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 ~/.bashrcMethod 3: zsh Permanent
bash
echo 'export ANTHROPIC_BASE_URL="https://anyapi.pro"' >> ~/.zshrc
echo 'export ANTHROPIC_AUTH_TOKEN="your_api_key"' >> ~/.zshrc
source ~/.zshrcVerify environment variables:
bash
echo $ANTHROPIC_BASE_URL
echo $ANTHROPIC_AUTH_TOKENStep 4: Start Using
bash
claudeCommon 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-codeAccessing 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 ~