Claude Code CLI.
Use any model through Aurora Gateway directly from Anthropic's Claude Code CLI.
Overview
Claude Code CLI is Anthropic's terminal-based AI assistant. When pointed at Aurora Gateway, it can use any model from any provider — not just Anthropic's Claude models. Aurora translates Claude Code's Anthropic-format requests to OpenAI format and routes them to the configured provider.
The gateway's Anthropic ingress (enable_anthropic_ingress: true) accepts requests at POST /v1/messages in Anthropic format, converts them to internal OpenAI /v1/chat/completions format, and translates the streaming response back.
Setup
Environment Variables
Set these in your terminal or add them to your Claude Code settings file:
# Required: gateway URLexport ANTHROPIC_BASE_URL="http://localhost:8080"# Auth: use your gateway master key or managed API keyexport ANTHROPIC_AUTH_TOKEN="your-master-key"# Model alias name (create it in the Models page)export ANTHROPIC_MODEL="my-alias"# PowerShell equivalents:$env:ANTHROPIC_BASE_URL="http://localhost:8080"$env:ANTHROPIC_AUTH_TOKEN="local-dev-key"$env:ANTHROPIC_MODEL="my-alias"Persistent Config
Add the env vars to your Claude Code settings.jsonso you don't need to set them each time:
{
"env": {
"ANTHROPIC_BASE_URL": "http://localhost:8080",
"ANTHROPIC_AUTH_TOKEN": "local-dev-key",
"ANTHROPIC_MODEL": "my-alias",
"CLAUDE_CODE_SUBAGENT_MODEL": "my-alias"
}
}Model Aliases
Claude Code has a hardcoded model list in its CLI. To use any gateway model, create a model alias in the Gateway Models page that maps a short name to the actual model. For example:
Alias name: minimax-m2.7Target: MiniMax-M2.7# Then use it in Claude Code:claude --model minimax-m2.7Auth
The gateway checks the Authorization header first, then falls back to x-api-key. Claude Code sendsAuthorization: Bearer <token> whenANTHROPIC_AUTH_TOKEN is set, and x-api-key when onlyANTHROPIC_API_KEY is set.
Use ANTHROPIC_AUTH_TOKEN — it takes priority and directly matches the gateway master key.
If you see an auth conflict warning, run /logout inside Claude Code to clear any previously managed key, or removeprimaryApiKey from yourconfig.json.
How It Works
┌──────────────┐ POST /v1/messages (Anthropic format) ┌──────────────┐│ Claude Code │ ──────────────────────────────────────────▶ │ Aurora ││ CLI │ │ Gateway ││ │ ◀────────────────────────────────────────── │ ││ │ Streaming SSE (Anthropic format) │ │└──────────────┘ └──────┬───────┘ │ POST /v1/chat/completions (OpenAI format) │ ┌────────▼───────┐ │ Provider │ │ (OpenAI, etc) │ └────────────────┘