Skip to main content
Claude Code is Anthropic’s official command-line coding assistant. It hits api.anthropic.com by default — set ANTHROPIC_BASE_URL to https://www.ruapi.ai to point it at RuAPI instead, no proxy layer required. You don’t need an Anthropic subscription or an Anthropic login for this. RuAPI accepts the native Anthropic Messages format (/v1/messages) — the format the Claude Code docs describe for a gateway connected through ANTHROPIC_BASE_URL (LLM gateway protocol). So you need no converter such as claude-code-router or LiteLLM. Updated: Nov 5, 2026 For a short overview of why it’s better to connect Claude Code from Russia through RuAPI rather than an Anthropic account, see www.ruapi.ai/claude-code-v-rossii; the setup steps are below.
This page covers direct setup. If you’d rather manage multiple providers in a GUI, see CC Switch.

Prerequisites

1

RuAPI account + API key

If you haven’t yet: register at www.ruapi.ai, top up with USDT, then Console → API Keys → Create API key to get a sk-... string. See Top-up and API keys & security.
2

Node.js ≥ 22

Claude Code is installed via npm, which needs Node.js 22 or newer. Check with:
If it’s missing or older, grab the LTS from nodejs.org, or on macOS:
The quickest way is to copy ready-made settings from the Console. Open Console → API Keys, click Connect Claude Code, Cline & more and pick Claude Code: the RuAPI address and your key are already filled in. Install the app as shown below; you can then skip “Point Claude Code at RuAPI”.
RuAPI API Keys page: the https://www.ruapi.ai address and the “Connect Claude Code, Cline & more” button

Console → API Keys: the “Connect Claude Code, Cline & more” button

The “Connect an app” window in the RuAPI Console with ready-made settings for Claude Code

The “Connect an app” window with Claude Code selected: the address and key are filled in (key hidden in the screenshot)

Install Claude Code

Via npm:
Confirm:
The official Claude Code installers from claude.ai (install.sh, install.ps1, install.cmd) don’t work from Russia: claude.ai redirects to an “unavailable in your region” page (claude.com/app-unavailable-in-region). Install via npm instead — the package and the app binary come from registry.npmjs.org, and you get the same app. In our check on Nov 3, 2026, that address was reachable from Russia without a VPN. If Claude Code offers to switch to the native install (claude install), decline: it downloads from claude.ai too.

Point Claude Code at RuAPI

Three configuration methods, in order of preference: Edit ~/.claude/settings.json (macOS / Linux) or %USERPROFILE%\.claude\settings.json (Windows). Create it if missing and paste this in, with your own key:
Do not append /v1 to ANTHROPIC_BASE_URL. The Anthropic SDK adds /v1/messages itself, and an extra /v1 causes 404s.
The ANTHROPIC_MODEL variable also sets the model, but it overrides the model field: while it is set, the default you pick in /model resets after a restart. If ANTHROPIC_MODEL is still in env from an older setup, remove it.
ANTHROPIC_API_KEY works too (RuAPI accepts both headers), but with it Claude Code asks on first launch whether to use that key — answer “no” by accident and requests bypass RuAPI. ANTHROPIC_AUTH_TOKEN skips that question. The old ANTHROPIC_SMALL_FAST_MODEL variable is deprecated — use ANTHROPIC_DEFAULT_HAIKU_MODEL instead.

Method 2: shell env vars

For a quick trial:
Here ANTHROPIC_MODEL sets the model for this window only. For a permanent setup use method 1: if you put ANTHROPIC_MODEL in ~/.zshrc or ~/.bashrc, the default you pick in /model stops being saved.

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:
In the interactive prompt, ask the simplest possible thing:
You should get an immediate Claude reply, and the RuAPI Console → Usage Logs should show the request with a token-level cost line.
To double-check the call really went through RuAPI, open RuAPI Console → Usage Logs and look at the newest entry — the model name should match claude-sonnet-5-5 (or whatever you configured).

Check with /status

Inside Claude Code, type /status:
  • the Anthropic base URL line should show https://www.ruapi.ai;
  • the Auth token line should name ANTHROPIC_AUTH_TOKEN.
If the URL line is missing, the variables were not picked up — open a new terminal or check settings.json. More on the Claude Code in Russia page.

Switch models on the fly

Inside a session:
Besides Claude, Claude Code works with other vendors’ models: DeepSeek, GPT, Gemini, Kimi, GLM, Qwen, MiniMax and Grok. Claude Code sends Anthropic Messages requests, and RuAPI converts them into the format each model understands. We tested every family with Claude Code-format requests (a tool call, the follow-up step with the tool result, streaming and non-streaming) — for example deepseek-flash, gpt-5.4-mini, gemini-3.8-flash, kimi-k3.1-pro, glm-5.3, qwen3.8-max, MiniMax-M3.1-Flash, grok-4.7:
The /model menu lists all of these models your key can use; other vendors’ models appear with an anthropic/ prefix (for example anthropic/kimi-k3.1-pro), because Claude Code requires it. The /model command accepts both forms, with or without the prefix. The full list with prices is on the pricing page. DeepSeek has its own guide — Claude Code on DeepSeek.
Claude Code’s built-in web search (WebSearch) isn’t available with other vendors’ models: that tool simply isn’t passed to them. Your regular tools (commands, file edits, MCP) work with every model.

How to save money

Reading code, small edits, tests and routine questions are handled fine by deepseek-flash, which costs many times less than Claude Sonnet. Make it your main model ("model": "deepseek-flash" in settings.json) and switch only for a hard task (a big refactor, a tangled bug):
When you’re done, go back with /model deepseek-flash; if you made Sonnet the default in the /model menu, set deepseek-flash back as the default there, or the next launch will start on Sonnet too. Switch between tasks rather than in the middle of one: each model has its own prompt cache, so after a switch the long context is paid in full the first time. To run all of Claude Code on DeepSeek, background tasks included, see Claude Code on DeepSeek; more ways to cut the bill are in Saving on Claude Code and Cline.

Troubleshooting

Some versions of Claude Code check the connection to api.anthropic.com on first launch even when ANTHROPIC_BASE_URL is set, and that address is unreachable from Russia. The workaround is on the Claude Code in Russia page.
  • ANTHROPIC_AUTH_TOKEN must be your RuAPI token (sk-...), not Anthropic’s sk-ant-....
  • Watch for trailing whitespace or line breaks when copying.
  • In RuAPI Console → API Keys, confirm the key is enabled and that the model you’re calling is in the key’s Allowed models (if that list is set).
  • Typo in the model ID. Claude model families on RuAPI are Claude Sonnet, Claude Opus, and Claude Haiku; for the exact names of all models, see the /model menu or the pricing page.
  • Don’t add /v1 to ANTHROPIC_BASE_URL.
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.
  • Verify reachability: curl -I https://www.ruapi.ai
  • If you’re behind a corporate proxy, make sure HTTPS_PROXY isn’t sending requests through a proxy that’s down.
  • No VPN required.
Use CC Switch for one-click toggling, or direnv to bind different env vars per project directory.

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.
  • anthropic-version and anthropic-beta headers sent by Claude Code are supported.
  • Prompt caching: cache_control markers are passed to the Anthropic API — see Prompt caching.
For more Claude Code tips, see the official documentation.