Install and configure
Install Claude Code using its official method and confirmclaude --version, then set:
ANTHROPIC_API_KEY, assign the same key to that variable. The model must support Anthropic Messages and tool use.
Persist variables in your shell profile, Windows user environment, or the env object in ~/.claude/settings.json. Never commit a real key.
Troubleshooting
Not logged in or login prompt
If Claude Code shows Not logged in · Please run /login or opens the Anthropic login options, it usually has not loaded a valid Bianxie AI configuration or its first-run onboarding is incomplete. Check thatANTHROPIC_AUTH_TOKEN, ANTHROPIC_BASE_URL, and ANTHROPIC_MODEL are available in the current terminal and are not overridden by stale global variables or a CC Switch profile. After confirming the key, Base URL, and model ID, you can skip first-run onboarding as follows:
-
Locate
.claude.jsonin the user home directory:- macOS / Linux:
~/.claude.json - Windows:
C:\Users\%USERNAME%\.claude.json
- macOS / Linux:
-
Set
hasCompletedOnboardingtotrue:
- Save the file and run
claudeagain.
If
.claude.json already contains other fields, add or update only hasCompletedOnboarding; do not replace the entire file.Other errors
401: Do not copy the literalAPI_KEYplaceholder into the configuration.400 Incorrect model ID: Copy the exact model ID from the live model page.- CC Switch and manual settings conflict: remove stale global
ANTHROPIC_*variables.
