SHENWENAI
+ 01
+ 02
ShenwenAI
QUICK_START

Claude Code Setup

Welcome to ShenwenAI. You can connect Claude Code to our API without deleting your existing Claude Code login, and switch back any time after testing.

For the lowest-risk setup, set environment variables only in the current terminal instead of writing them into ~/.zshrc or ~/.bashrc.

Supported model IDs

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

API_KEY_REQUIRED

Prepare your API key first

1. Go to your account page

After logging in, create or copy an API key from your account page. It looks like sk-or-v1-xxxxxxxxxxxx. Treat it like a password.

Go to account page
2. Confirm the Base URL

Claude Code uses this Base URL. Do not append /v1.

https://api.shenwenai.com

Do not share your API key with others or commit it to GitHub, GitLab, or any public repository.

Choose your system first

The commands below will switch based on your selected system.

Install Claude Code

Run this only if Claude Code is not installed yet.

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

Set environment variables

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

macOS / Linux
bash
unset ANTHROPIC_API_KEY
export ANTHROPIC_BASE_URL="https://api.shenwenai.com"
export ANTHROPIC_AUTH_TOKEN="sk-or-v1-your-key"

Use ANTHROPIC_AUTH_TOKEN, not ANTHROPIC_API_KEY.

Start using it

Run claude in your project folder. After entering Claude Code, use /status to confirm that the Base URL points to ShenwenAI.

If Claude Code shows the model as opus 4.8, you can ignore it for now. The backend will use ShenwenAI model routing.

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.

macOS / Linux
bash
claude

Switch back to your own Claude Code account

ANTHROPIC_AUTH_TOKEN takes priority over the /login subscription account, so setting it routes requests through ShenwenAI API. Your original login is not removed.

To switch back, unset the environment variables or open a new terminal.

macOS / Linux
bash
unset ANTHROPIC_BASE_URL ANTHROPIC_AUTH_TOKEN