Skip to content

macOS Guide

This guide helps you configure AI coding tools on macOS using Any API as the API gateway.

Step 1: Install Node.js

bash
brew install node

If Homebrew is not installed:

bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Method 2: Official Website

  1. Visit https://nodejs.org
  2. Download the LTS version .pkg file and install

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

Check your shell type:

bash
echo $SHELL

macOS Catalina and later use zsh by default.

Method 1: Temporary (Current Session)

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

Method 3: bash Permanent

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

Edit the config file vim ~/.claude/settings.json:

json
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "Replace with your API Key",
    "ANTHROPIC_BASE_URL": "https://anyapi.pro",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": 1
  },
  "permissions": {
    "allow": [],
    "deny": []
  }
}

Verify Environment Variables

bash
echo $ANTHROPIC_BASE_URL
echo $ANTHROPIC_AUTH_TOKEN

Step 4: Start Using

bash
claude

Use in a specific project:

bash
cd ~/Projects/my-project
claude

Common Issues

Security Block

  1. Open System Preferences > Privacy & Security
  2. Find the blocked app and click "Open Anyway"

npm Permission Error (EACCES)

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

API PLAT