Claude Code
Claude Code
Claude Code
Prepare
Use a gateway root, a virtual key with model access and a public model name. Test GET /v1/models first.
Configure
Set the gateway root without /v1 because the client appends /v1/messages. Use an Anthropic Messages deployment. Start a shell with these settings and remove conflicting provider tokens.
Verify and troubleshoot
Send “Hello, introduce yourself.” and inspect the call ID in XHub request logs. Verify streaming, tool calls and images separately against deployment capabilities. For 401 check the virtual key; for 403 check model scope; for 404 check the URL and duplicated /v1. Client settings vary by version.
Request example
export ANTHROPIC_BASE_URL="http://localhost:4000"
export ANTHROPIC_AUTH_TOKEN="$XHUB_API_KEY"
export ANTHROPIC_MODEL="YOUR_MODEL_NAME"
claude