1. Install Claude Code
Shell
npm install -g @anthropic-ai/claude-code
# Linux / macOS alternative
curl -fsSL https://claude.ai/install.sh | bash2. Configure ~/.claude/settings.json
JSON
{
"env": {
"ANTHROPIC_BASE_URL": "http://127.0.0.1:8313",
"ANTHROPIC_AUTH_TOKEN": "1",
"ANTHROPIC_MODEL": "YOUR_MESSAGES_MODEL_ID",
"API_TIMEOUT_MS": "1200000"
}
}Replace the placeholder with an approved gha_... token when ghc-api authentication is enabled. Do not append /v1 to the Anthropic base URL.
3. Select a Messages model
Shell
curl http://127.0.0.1:8313/v1/models/full/Choose a model whose supported_endpoints includes /v1/messages. Copy the live model ID rather than a version from an old guide. The older ANTHROPIC_SMALL_FAST_MODEL variable is deprecated in current Claude Code documentation.
4. Troubleshoot
- 401: missing or unapproved token.
- 404: the base URL probably contains an extra
/v1. - Unsupported model: the account or organization has not enabled it, or it lacks Messages support.
- Idle stream: keep SSE keepalive enabled and use a sufficiently long client timeout.
Next step
Inspect the models and endpoints available to your account before copying a model ID into client configuration.
Inspect models and parameters →