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.

The Claude channel is paused: its upstream is currently unstable, and we are sourcing a new upstream or building our own account pool. It will reopen once it is stable.

For now, use a Grok channel key (it serves Grok models). The GPT Pro and Unrestricted channels no longer support Claude Code, and keys on those channels are refused with a 403.

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. Each model can only be called with a key on its own channel.

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. Create an API key and choose a channel

Select Create API Key, enter a recognizable name, then choose the channel that fits your use case:

GPT Pro · 0.22x (Pro pool)
Prioritizes stability for OpenAI (Codex) and OpenAI-compatible clients. Recommended for long-running or important text workloads.
GPT Economy · 0.09x (Plus pool)
Prioritizes price for OpenAI (Codex) and OpenAI-compatible clients. Recommended for everyday development, learning, testing, and cost-sensitive text workloads.
国产 DeepSeek V4.1 Flash · 60% of official price
Serves deepseek-v4.1-flash only, with a 1M context window, thinking mode, tool calls, and image input. Works with OpenAI (Codex) and OpenAI-compatible clients.
DeepSeek · 85% / 65% of official price
Serves deepseek-v4-flash and deepseek-v4-pro. Works with OpenAI (Codex), OpenAI-compatible clients, and Claude Code.

Claude Code runs only on Claude or Grok channel keys; GPT Pro and Unrestricted keys are refused with a 403. For images, create a separate OpenAI image key or Grok image key. Text and image purposes cannot be mixed in one key.

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

Grok channel: the model name Claude Code displays does not reflect the backend model; Grok 4.7 / 4.6 / 4.5 serve the request.

Claude Code currently works only with a Grok channel key; keys on other channels are refused (the Claude channel is paused).

macOS / Linux
bash
claude
(Optional) Pin a Claude model
bash
export ANTHROPIC_MODEL="claude-opus-5-5"
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