Claude Code

claude code

Claude Code is Anthropic's official coding assistant for the terminal. It supports a custom API endpoint and key, so it can use the Anthropic Messages protocol directly through XSI.

Installation

# macOS / Linux / WSL
curl -fsSL https://claude.ai/install.sh | bash

# macOS (Homebrew)
brew install --cask claude-code
# Windows PowerShell
irm https://claude.ai/install.ps1 | iex

After installing, run claude doctor to check the version and installation status.

Configuration

export ANTHROPIC_BASE_URL="https://api.xsicontrol.com"   # or your own API domain, without /v1
export ANTHROPIC_AUTH_TOKEN="sk-Xvs..."
claude
$env:ANTHROPIC_BASE_URL="https://api.xsicontrol.com"
$env:ANTHROPIC_AUTH_TOKEN="sk-Xvs..."
claude

You can also put these in ~/.claude/settings.json so they apply to every terminal:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.xsicontrol.com",
    "ANTHROPIC_AUTH_TOKEN": "sk-Xvs..."
  }
}

Choosing models

Claude Code uses Claude models by default. To pin a specific model, or to use another Anthropic-compatible model configured by the operator:

export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-5-5"
export ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet-5-5"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-haiku-5-5"

Model names must be in the price list, and the account must be allowed to use them. The operator can also rewrite model names centrally on the server with MODEL_MAPPER, with no client changes.

Verification

claude -p "Answer in one sentence: connection OK"

Usage is shown in the Manage Console and at GET /dashboard/live.

Notes

  • XSI enables sticky sessions for /v1/messages: each session is pinned to the same upstream key for a higher prompt cache hit rate.
  • On 401, check your key; 403 usually means a model or IP allowlist restriction; 429 means a credit or rate limit was hit. See Error Codes.

Resources