TokenPilotAPI documentation
English简体中文繁體中文
Console ↗
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 --version

Windows

winget install Anthropic.ClaudeCode
claude --version
Official instructions

Configure TokenPilot

bash / zsh

export ANTHROPIC_BASE_URL="https://api.tokentpilot.com"
export ANTHROPIC_AUTH_TOKEN="$TOKENPILOT_API_KEY"
claude --model REPLACE_WITH_MODEL_ID

PowerShell

$env:ANTHROPIC_BASE_URL = "https://api.tokentpilot.com"
$env:ANTHROPIC_AUTH_TOKEN = $env:TOKENPILOT_API_KEY
claude --model REPLACE_WITH_MODEL_ID

Verify 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.