BRUCEAI
Claude Code setup
You can connect Claude Code to the BRUCEAI API without removing your existing Claude Code login. After testing, you can switch back at any time.
For the first test, set environment variables only in the current terminal. Avoid writing them into ~/.zshrc or ~/.bashrc until you are sure you want the setup to persist.
Copy these model IDs into config files, API request bodies, or any OpenAI-compatible client that asks for a model name.
Prepare your API key
After signing in, open the API key page to create or copy an API key. It looks like sk-or-v1-xxxxxxxxxxxx. Treat it like a password.
Create API keyClaude Code uses this Base URL directly. Do not append /v1.
Do not share your API key with anyone, and do not commit it to GitHub, GitLab, or any public repository.
The commands below will switch to the system you choose.
Install Claude Code
Run this only if Claude Code is not installed yet.
npm install -g @anthropic-ai/claude-codeSet environment variables
Replace sk-or-v1-your-key with your own BRUCEAI API key.
unset ANTHROPIC_API_KEY
export ANTHROPIC_BASE_URL="https://api.bruceai.net"
export ANTHROPIC_AUTH_TOKEN="sk-or-v1-your-key"Use ANTHROPIC_AUTH_TOKEN, not ANTHROPIC_API_KEY.
Start Claude Code
Run claude inside your project folder. After it opens, type /status to confirm the Base URL points to BRUCEAI.
If Claude Code shows opus 4.8, you can ignore it for now. The actual backend route is handled by BRUCEAI.
claudeGPT-5.6 Sol, Terra, and Luna support about 1.05M input context. When input plus cached input exceeds 272K tokens, the entire request is billed at long-context rates. Claude Code automatic routing may still select another supported model based on the task and upstream availability.
Switch back to your own Claude Code account
ANTHROPIC_AUTH_TOKEN has higher priority than the Claude Code login in the current terminal. Once it is set, Claude Code will use the BRUCEAI API, but your original login is not deleted.
To switch back, unset the environment variables or close the current terminal and open a new one.
unset ANTHROPIC_BASE_URL ANTHROPIC_AUTH_TOKEN