Claude Code (CLI) Integration
Configure Anthropic's official agentic terminal assistant, Claude Code, with Nyxos API.
Claude Code is Anthropic's official terminal-based agent that reads, edits, and debugs code across your repository.
Claude Code speaks the Anthropic-native protocol and appends /v1/messages itself, so it connects to the root host of Nyxos API — never add /v1.
Installation
Requires Node.js 18+ — install the LTS version from nodejs.org, then:
npm install -g @anthropic-ai/claude-code
claude --versionRequired Settings
| Variable | Value | Purpose |
|---|---|---|
ANTHROPIC_BASE_URL | https://api.nyxos.shop | Routes requests through the gateway (no /v1). |
ANTHROPIC_AUTH_TOKEN | sk-YOUR_NYXOS_KEY | Sent as the Authorization: Bearer credential. |
You do not need to set any model variables: when you run Claude models, Claude Code's built-in model aliases resolve automatically against the gateway. Only set ANTHROPIC_MODEL explicitly if you want to pin a specific non-default model ID.
Option A: Settings File (Recommended — persists everywhere)
Edit your user settings file:
- Windows:
%USERPROFILE%\.claude\settings.json - macOS / Linux:
~/.claude/settings.json
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.nyxos.shop",
"ANTHROPIC_AUTH_TOKEN": "sk-YOUR_NYXOS_KEY"
}
}Restart Claude Code after editing.
Option B: Shell Environment Variables
Linux / macOS (~/.bashrc, ~/.zshrc):
export ANTHROPIC_BASE_URL="https://api.nyxos.shop"
export ANTHROPIC_AUTH_TOKEN="sk-YOUR_NYXOS_KEY"Windows PowerShell (persistent, user scope):
[System.Environment]::SetEnvironmentVariable('ANTHROPIC_BASE_URL', 'https://api.nyxos.shop', 'User')
[System.Environment]::SetEnvironmentVariable('ANTHROPIC_AUTH_TOKEN', 'sk-YOUR_NYXOS_KEY', 'User')Launch and Verify
claudeInside Claude Code, run /status and confirm:
- A line
Anthropic base URL: https://api.nyxos.shopappears — without it, Claude Code is not pointed at the gateway. - The credential line reads
Auth token(ANTHROPIC_AUTH_TOKEN) — if it shows a claude.ai Login method instead, your variable is not being picked up: setANTHROPIC_AUTH_TOKENsomewhere Claude Code reads before first-run setup (a shell export or theenvblock in the usersettings.json).
Notes
- Your key must belong to a group that includes the model — the automatic
Auto-Agroup covers the catalog (see Groups & Multipliers). - Claude models on the gateway support prompt caching and extended thinking; check features per model on
/pricing. - Want to pin a specific Claude ID (e.g. an older or experimental one from
/pricing)? Set it explicitly withANTHROPIC_MODELin the sameenvblock.