Claude Code
Anthropic's CLI against the Messages API
Claude Code speaks the Anthropic Messages API
(POST /v1/messages), not Chat Completions. Point ANTHROPIC_BASE_URL at the orientx host — do
not append /v1; the CLI adds that path itself. Anthropic's
LLM gateway docs cover the same variables.
| Base URL | https://api.orientx.ai |
| Auth | ANTHROPIC_AUTH_TOKEN (Bearer) |
| Config | ~/.claude/settings.json |
| Official docs | Connect to an LLM gateway |
Point it at orientx
Write ~/.claude/settings.json:
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "sk-...",
"ANTHROPIC_BASE_URL": "https://api.orientx.ai",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
}
}Or export the same variables in the current shell. ANTHROPIC_API_KEY (x-api-key) also works;
prefer one of the two, not both.
The model must accept /v1/messages (including tools). Chat Completions-only ids will fail once
the agent starts calling tools. If you previously logged in to Anthropic, override
ANTHROPIC_AUTH_TOKEN so the CLI does not keep using the official account.