Setting Up Claude Code¶
What to Use¶
For Claude Code, the primary Nexus endpoint is:
POST /v1/messages
Token counting is also supported:
POST /v1/messages/count_tokens
Environment Variables¶
The simplest option:
export ANTHROPIC_BASE_URL="https://api.nexus-hub.ru"
export ANTHROPIC_AUTH_TOKEN="your_nexus_key"
After that, Claude Code will send requests through Nexus.
Recommended Model¶
A good default option:
claude-sonnet-4-6
If your key has access to other Claude models, they will appear in GET /v1/models.
What to Check If It Does Not Work¶
- There are no old
ANTHROPIC_*variables in the environment. - The key was copied without extra spaces.
- The model appears in
GET /v1/models. - The base URL is
https://api.nexus-hub.ru, without/v1.