Claude Code is Anthropic’s official command-line coding assistant. It hitsDocumentation Index
Fetch the complete documentation index at: https://docs.ruapi.ai/llms.txt
Use this file to discover all available pages before exploring further.
api.anthropic.com by default — set ANTHROPIC_BASE_URL to point it at RuAPI instead, no proxy layer required.
This page covers direct setup. If you’d rather manage multiple providers in a GUI, see CC Switch.
Prerequisites
RuAPI account + API key
If you haven’t yet: register at www.ruapi.ai, top up with USDT, then Console → Tokens → Create token to get a
sk-... string. See Top-up and API keys & security.Node.js ≥ 18
Install Claude Code
- macOS / Linux
- Windows
Point Claude Code at RuAPI
Three configuration methods, in order of preference:Method 1: settings.json (recommended)
Edit ~/.claude/settings.json (macOS / Linux) or %USERPROFILE%\.claude\settings.json (Windows). Create it if missing:
What each field does
What each field does
| Field | Meaning |
|---|---|
ANTHROPIC_BASE_URL | The RuAPI endpoint |
ANTHROPIC_API_KEY | Your RuAPI token (not the official Anthropic key) |
ANTHROPIC_MODEL | Default Claude model. claude-sonnet-4-6 is the best price/performance balance |
ANTHROPIC_SMALL_FAST_MODEL | Tiny model Claude Code uses for internal tasks (title generation, path completion) — claude-haiku-4-5 keeps costs low |
Method 2: shell env vars
For a quick trial:- macOS / Linux (zsh / bash)
- Windows (PowerShell)
~/.zshrc or ~/.bashrc to make them permanent.Method 3: use CC Switch
If you bounce between RuAPI and your official account, install CC Switch and manage providers from a GUI.First call
Open a new terminal (so env vars are loaded),cd into any project:
Switch models on the fly
Inside a session:Troubleshooting
401 Unauthorized / Invalid API key
401 Unauthorized / Invalid API key
404 / model not found
404 / model not found
- Typo in the model ID. Claude model names on RuAPI match Anthropic’s official IDs:
claude-sonnet-4-6,claude-opus-4-7,claude-haiku-4-5. - Don’t add
/v1toANTHROPIC_BASE_URL.
402 / insufficient balance
402 / insufficient balance
Check USD balance on the Console home page and top up more USDT. Long-context conversations and tool calls burn tokens fast — 5–10 USD is a reasonable starting buffer.
Network timeout / can't connect
Network timeout / can't connect
- Verify reachability:
curl -I https://www.ruapi.ai - If you’re behind a corporate proxy, make sure
HTTPS_PROXYisn’t routing to a dead endpoint. - No VPN required.
Advanced
- MCP servers: independent of which backend API you use — configure as usual.
- Tool calls / function calling: RuAPI forwards Anthropic’s tool calls unchanged.
- Streaming / SSE: on by default, nothing extra to configure.