API documentationInstall and configure Claude Code
Install and configure Claude Code
Install the CLI, then connect it to TokenPilot using the Anthropic Messages protocol.
macOS / Linux
curl -fsSL https://claude.ai/install.sh | bash
claude --versionWindows
winget install Anthropic.ClaudeCode
claude --versionConfigure TokenPilot
bash / zsh
export ANTHROPIC_BASE_URL="https://api.tokentpilot.com"
export ANTHROPIC_AUTH_TOKEN="$TOKENPILOT_API_KEY"
claude --model REPLACE_WITH_MODEL_IDPowerShell
$env:ANTHROPIC_BASE_URL = "https://api.tokentpilot.com"
$env:ANTHROPIC_AUTH_TOKEN = $env:TOKENPILOT_API_KEY
claude --model REPLACE_WITH_MODEL_IDVerify the connection
Set TOKENPILOT_API_KEY first. Start Claude Code in the project directory, run /status, and send a short prompt. Check that the request appears in TokenPilot usage logs. A successful /v1/messages request verifies the basic route. Individual Claude Code features may require additional endpoints.