Claude Code FAQ
Common setup and runtime issues when running Anthropic's Claude Code CLI against RKAPI, along with proven fixes. For fresh installation steps, see the Claude Code Integration Guide.
1. HTTP 404 because ANTHROPIC_BASE_URL ends with /v1
This is the single most common Claude Code mistake. Claude Code automatically appends /v1/messages to ANTHROPIC_BASE_URL.
- Wrong:
https://api.zwwbai.com/v1→ sends requests to/v1/v1/messages(404 Not Found) - Wrong:
https://s2pbxm0xv5y.adtyai-fz.top→ rejected with403 api_domain_required - Correct:
https://api.zwwbai.com(no trailing/v1and no trailing slash)
export ANTHROPIC_BASE_URL="https://api.zwwbai.com"
export ANTHROPIC_AUTH_TOKEN="<YOUR_API_KEY>"2. ANTHROPIC_AUTH_TOKEN vs. ANTHROPIC_API_KEY
Claude Code supports both environment variables, but mixing them or leaving stale values in shell profiles (~/.zshrc, ~/.bashrc, or Windows System Environment Variables) causes confusing 401 errors or prompts asking whether to use a detected API key.
- Recommended: Set
ANTHROPIC_AUTH_TOKEN(matching our Interactive Setup Wizard) and ensure no conflicting oldANTHROPIC_API_KEYis exported in the same shell. - If you configure credentials inside
~/.claude/settings.jsonunder theenvblock, make sure your shell environment does not override those values with an older key. - Verify what your active shell actually sees:
# macOS / Linux
env | grep -E "ANTHROPIC_|CLAUDE_"# Windows PowerShell
Get-ChildItem Env: | Where-Object { $_.Name -match "^(ANTHROPIC_|CLAUDE_)" }3. OAuth Login Prompt Keeps Appearing
If launching claude opens a browser login flow to claude.ai instead of using your RKAPI API key:
- Confirm both
ANTHROPIC_BASE_URLandANTHROPIC_AUTH_TOKENare set in the exact terminal session (or inside~/.claude/settings.json'senvobject). - Sign out of any cached OAuth session inside Claude Code by running
/logoutor clearing stale OAuth tokens from~/.claude.json/ system keychain if you previously logged in with a consumer subscription. - Ensure
~/.claude.jsonincludes"hasCompletedOnboarding": trueif Claude Code stalls on the first-run login wizard in headless or CI environments.
4. Windows PowerShell Execution Policy & Git Bash Issues
Script Execution Blocked (PSSecurityException)
If PowerShell blocks claude or npm shim scripts with running scripts is disabled on this system:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSignedRestart PowerShell and test claude --version.
Git Bash Not Found on Windows
Claude Code relies on Git Bash on native Windows. If startup fails because bash.exe cannot be located:
- Install Git for Windows if not already installed.
- Point Claude Code directly to your
bash.exepath:
$env:CLAUDE_CODE_GIT_BASH_PATH="C:\Program Files\Git\bin\bash.exe"To persist it across terminals, add CLAUDE_CODE_GIT_BASH_PATH in Windows Environment Variables (or your PowerShell $PROFILE).
5. Prompt Cache Hit Rate Drops Unexpectedly
Claude Code sends large system prompts, tool definitions, and conversation prefixes on every turn. If prompt caching stops hitting (cache_read_input_tokens drops to 0 across back-to-back turns), latency rises and token costs increase dramatically.
Common causes include client version quirks, changing model/beta headers mid-session, or mismatched tool definitions. Follow our dedicated step-by-step guide in Claude Code Cache Fix to diagnose and restore high cache hit rates.
6. Corporate Proxies (HTTPS_PROXY / HTTP_PROXY)
If your network requires an HTTP/SOCKS proxy to reach https://api.zwwbai.com:
export HTTPS_PROXY="http://127.0.0.1:7890"
export HTTP_PROXY="http://127.0.0.1:7890"
export NO_PROXY="localhost,127.0.0.1"- If you see
UNABLE_TO_VERIFY_LEAF_SIGNATUREor TLS handshake errors behind a corporate SSL-inspecting proxy, supply your organization's root CA bundle viaNODE_EXTRA_CA_CERTS="/path/to/corp-ca.pem". - If you previously configured a dead proxy port and forgot about it, unset
HTTP_PROXY,HTTPS_PROXY, andALL_PROXYbefore retrying.
7. Extended Thinking & Effort Parameters
When using Claude models with extended thinking or adaptive effort controls:
- Ensure
max_tokensis always strictly greater than the configured thinking token budget; otherwise the API returns400 Bad Request. - If you override
MAX_THINKING_TOKENSin your environment orsettings.json, keep it proportionate to the task—very high budgets increase latency before the first visible response token appears. - Verify that the model ID configured in Claude Code (including any Haiku/Sonnet/Opus aliases) is enabled inside the concrete model group bound to your RKAPI API key.