Skip to main content

Overview

Claude Code is Anthropic’s official command-line AI programming assistant. You can connect it to Crazyrouter by configuring environment variables.

Configuration

Set Environment Variables

export ANTHROPIC_BASE_URL=https://crazyrouter.com
export ANTHROPIC_API_KEY=sk-xxx
Add to ~/.bashrc or ~/.zshrc for persistence:
echo 'export ANTHROPIC_BASE_URL=https://crazyrouter.com' >> ~/.bashrc
echo 'export ANTHROPIC_API_KEY=sk-xxx' >> ~/.bashrc
source ~/.bashrc

Launch Claude Code

claude

Verification

After launching, enter any question. If you get a normal response, the configuration is successful.
Claude Code uses the Anthropic native API format (/v1/messages), which Crazyrouter fully supports. Note that the Base URL should not include the /v1 suffix.
Make sure your token has Claude models enabled (e.g. claude-sonnet-4-20250514).