System Framework v4.7.0 // BRUCEAI API Gateway
+ 01
+ 02

BRUCEAI

QUICK_START

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.

Supported model IDs

Copy these model IDs into config files, API request bodies, or any OpenAI-compatible client that asks for a model name.

STEP 01 / API_KEY_REQUIRED

Prepare your API key

1. Go to the API key page

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 key
2. Confirm Base URL
https://api.bruceai.net

Claude 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.

Choose your system first

The commands below will switch to the system you choose.

STEP 02

Install Claude Code

Run this only if Claude Code is not installed yet.

macOS / Linux
bash
npm install -g @anthropic-ai/claude-code
STEP 03

Set environment variables

Replace sk-or-v1-your-key with your own BRUCEAI API key.

macOS / Linux
bash
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.

STEP 04

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.

macOS / Linux
bash
claude

GPT-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.

STEP 05

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.

macOS / Linux
bash
unset ANTHROPIC_BASE_URL ANTHROPIC_AUTH_TOKEN