Claude Code is Anthropic’s official CLI tool for conversing with Claude and collaborating on code in the terminal. You can configure Claude Code to use AppleRouter as its API backend.
Prerequisites
Install Claude Code
npm install -g @anthropic-ai/claude-code
Claude Code uses environment variables for API endpoint configuration. Set the following:
macOS / Linux
Windows (PowerShell)
# Add to ~/.bashrc or ~/.zshrc
export ANTHROPIC_BASE_URL="https://api.applerouter.ai"
export ANTHROPIC_API_KEY="YOUR_API_KEY"
After editing, run source ~/.bashrc or source ~/.zshrc to apply the changes.# Add to your PowerShell profile
$env:ANTHROPIC_BASE_URL = "https://api.applerouter.ai"
$env:ANTHROPIC_API_KEY = "YOUR_API_KEY"
Or set system environment variables for permanent effect.
Usage
After configuration, run claude in the terminal to start:
Claude Code will automatically use your configured AppleRouter endpoint.
Verify Configuration
Run the following commands to verify your configuration:
claude --version
claude "Hello, how are you?"
If you receive a normal response, the configuration is successful.
If you encounter connection issues, run echo $ANTHROPIC_BASE_URL to check if
the environment variable is set correctly.