> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ruapi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude Code in Russia: how to install and use it without a VPN

> Does Claude Code work in Russia, how to install it without a VPN or an Anthropic account, how to pay, and what to do about the “Unable to connect to Anthropic services” and “Invalid API key” errors.

**Short answer:** Claude Code itself is free, and you can install it from Russia via npm. What doesn't work is the Anthropic account: Russia is not on the list of supported countries, and since 1 October 2026 accounts from Russia are once again being blocked en masse. So Claude Code is connected to an API gateway instead: set two environment variables and it works without a VPN, without an Anthropic account or subscription, and you pay in USDT only for the tokens you use.

## Does Claude Code work in Russia

| Option | Works from Russia? | What gets in the way |
| - | - | - |
| Claude Pro / Max subscription and signing in to an Anthropic account | Only with a VPN, and it's risky | Russia is not on the list of supported countries; Russian cards are not accepted; since October 2026 there has been a new wave of bans, including paid accounts |
| A key from the Anthropic Console (paying for the API) | Only with a VPN, and it's risky | The same, plus you need a card from a foreign bank |
| Through an API gateway (e.g. RuAPI) | **Yes, without a VPN** | You need a gateway key and a balance |

> [!NOTE]
>
> The country list is on the [Supported Regions Policy](https://www.anthropic.com/supported-countries) page (checked 22 October 2026): "Any country or region not listed is unsupported", and Russia is not on the list. The bans are reported by The Moscow Times and The Bell, October 2026.

## How to install Claude Code in Russia

**1. Node.js 22 or newer**

Check your version with `node --version`. If you don't have Node.js or your version is older, install the LTS version from [nodejs.org](https://nodejs.org).

**2. Install via npm**

```bash theme={null}
npm install -g @anthropic-ai/claude-code
claude --version
```

The command is the same on macOS, Linux and Windows (PowerShell). The official installer from `claude.ai` may not open from Russia — npm gives you the same result.

## How to connect Claude Code without an Anthropic account

**1. RuAPI key**

Sign up at [www.ruapi.ai](https://www.ruapi.ai/?lng=en\&utm_source=docs\&utm_campaign=en-claude-code-russia) (with email, Google or Yandex), top up your balance, and in the Console open **API Keys** → **Create API key** — you'll get an `sk-...` string.

**2. Address and key in settings.json**

Open `~/.claude/settings.json` (Windows: `%USERPROFILE%\.claude\settings.json`; if the file doesn't exist, create it) and add:

```json theme={null}
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://www.ruapi.ai",
    "ANTHROPIC_AUTH_TOKEN": "sk-your-RuAPI-key",
    "ANTHROPIC_MODEL": "claude-sonnet-5-5"
  }
}
```

> [!WARNING]
>
> The address goes **without** `/v1` at the end — Claude Code adds `/v1/messages` itself.

**3. Launch**

Open a new terminal, go to your project folder and run `claude`. You don't need to sign in to an Anthropic account. The request will show up in the RuAPI Console → **Usage Logs**.

Detailed setup — models for `/model opus` and `/model haiku`, environment variables instead of the file, Windows — is in the guide [How to connect Claude Code to RuAPI](/en/integrations/claude-code.md).

## How to pay for Claude Code in Russia

You don't need a subscription: you pay only for the tokens Claude Code uses.

* **USDT or USDC** on TRC20, BEP20 or Polygon, from 5 USDT — no foreign card needed. If you don't have USDT yet, you can buy it with rubles via SBP (Faster Payments System): [step-by-step guide](/en/buy-usdt.md); the first time takes 15–30 minutes.
* **Cards from foreign banks** (Visa / Mastercard) are accepted too. Cards from Russian banks, including Mir, are not.
* **Prompt caching works:** Claude Code connects through the native Anthropic API, so the context it re-sends at every step costs at least 10 times less than regular input.

How to spend less: [How to cut your Claude Code and Cline bill](/en/claude-code-cline-costs.md).

## Errors and what to do about them

| What you see | Why | What to do |
| - | - | - |
| `Unable to connect to Anthropic services` / `Failed to connect to api.anthropic.com: ERR_BAD_REQUEST` / `Claude Code might not be available in your country` | Some versions of Claude Code check the connection to `api.anthropic.com` on first launch — even if `ANTHROPIC_BASE_URL` is set. That address is not reachable from Russia | Mark the first launch as completed — see below. Check that `ANTHROPIC_BASE_URL` is set |
| `Invalid API key · Please run /login` or `401` | The key goes to the wrong place, or it's the wrong key: `ANTHROPIC_BASE_URL` is not set (the RuAPI key is sent to Anthropic), an Anthropic `sk-ant-...` key is used instead of the RuAPI key, or an old `ANTHROPIC_API_KEY` is left in the environment | Check `/status` and the variables — see below. Copy the key from the RuAPI Console again, without spaces |
| Claude Code asks you to sign in (`/login`) | The key didn't reach Claude Code: for example, it's in `.claude/settings.json` inside the project, and those settings only apply after the first launch | Put the key in `~/.claude/settings.json` in your home folder or in environment variables |
| `Auth conflict` / `auth may not work as expected` warning | Both the RuAPI key and a saved Anthropic account sign-in are active | Run `/logout` in Claude Code — only the RuAPI key will remain |
| `403` — insufficient funds | Your balance has run out | [Top up your balance](/en/topup.md) |
| `404` | An extra `/v1` at the end of `ANTHROPIC_BASE_URL` | Keep it as `https://www.ruapi.ai` |
| `503`, model not found | A typo in the model name | Check the name against the [pricing page](https://www.ruapi.ai/pricing?lng=en\&utm_source=docs\&utm_campaign=en-claude-code-russia) |

### "Unable to connect to Anthropic services": how to fix it

This is a known Claude Code issue ([GitHub issue](https://github.com/anthropics/claude-code/issues/26935)): in some versions it calls `api.anthropic.com` on first launch regardless of your `ANTHROPIC_BASE_URL`. The workaround is described in that issue, and users confirm it in [another discussion](https://github.com/musistudio/claude-code-router/issues/494): mark the first launch as completed:

1. Close Claude Code.
2. Open `~/.claude.json` (Windows: `%USERPROFILE%\.claude.json`) — this is a **different** file, not `settings.json`.
3. Add the line `"hasCompletedOnboarding": true` inside the curly braces. If the file is empty or doesn't exist, its contents should be:

   ```json theme={null}
   {
     "hasCompletedOnboarding": true
   }
   ```

   If the file already has other lines, add this one with a comma, otherwise the JSON will break.
4. Run `claude` again.

### "Invalid API key": check where requests go and with which key

Inside Claude Code, run `/status` and look at two lines:

* `Anthropic base URL` should show `https://www.ruapi.ai`. If this line is missing, `ANTHROPIC_BASE_URL` didn't reach Claude Code, and requests are going to Anthropic.
* `Auth token` should name `ANTHROPIC_AUTH_TOKEN`. If you see a `Login method` line with a claude.ai account instead, the RuAPI key wasn't picked up.

Then check which Anthropic variables are set on your system:

```bash macOS / Linux theme={null}
env | grep ANTHROPIC
```

```powershell Windows (PowerShell) theme={null}
Get-ChildItem Env:ANTHROPIC*
```

* You should see `ANTHROPIC_BASE_URL=https://www.ruapi.ai`.
* If there's an `ANTHROPIC_API_KEY` with an old key, remove it (or put the RuAPI key in it). It's better to keep the RuAPI key in `ANTHROPIC_AUTH_TOKEN`: that way Claude Code doesn't ask whether to use the key.
* The command won't show variables from `settings.json` — check the file itself too. If the same variable is set both in the system and in `settings.json`, the value from `settings.json` wins.
* If the key is in `ANTHROPIC_API_KEY`, Claude Code asks once whether to use it; if you answered "no" back then, the key is silently ignored — turn it on in `/config` → `Use custom API key`.

> [!TIP]
>
> Claude Code makes background calls to Anthropic's servers — update checks, telemetry. These requests may not get through from Russia; this doesn't affect working through RuAPI, but you can turn them off by adding the line `"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"` to `env`. This also turns off auto-update — update Claude Code with `npm install -g @anthropic-ai/claude-code@latest`.

All API error codes are on the [Error codes](/en/errors.md) page.

## FAQ

> **Does Claude Code work in Russia in 2026?**
>
> Yes, if you connect it to RuAPI: Claude Code talks to [www.ruapi.ai](http://www.ruapi.ai), and that address is reachable from Russia directly. You don't need an Anthropic account or subscription, so account bans don't affect you.

> **Do I need a VPN?**
>
> No. Neither for installing via npm nor for working: requests to the models go only to [www.ruapi.ai](http://www.ruapi.ai).

> **Can I use Claude Code for free?**
>
> The program itself is free, but you pay for the models. RuAPI has no subscription: you pay only for the tokens you use. We usually give new users \$0.05 right away to try deepseek-flash — and you can [run Claude Code on DeepSeek](/en/integrations/claude-code-deepseek.md), which is many times cheaper than Claude.

> **How much does it cost?**
>
> It depends on the model and the amount of work. For example, claude-sonnet-5-5 costs \$2.40 per 1M input tokens, \$0.12 per 1M cached tokens and \$12 per 1M output tokens (prices on the pricing page as of 22 October 2026; the price in your account may be lower). All models and prices are on the [pricing page](https://www.ruapi.ai/pricing?lng=en\&utm_source=docs\&utm_campaign=en-claude-code-russia).

> **Are these the original Claude models?**
>
> Yes. These are Anthropic's original models — claude-opus-5-5, claude-sonnet-5-5, claude-haiku-5-5 and others — with no quality cuts and no substitution.

> **Can I use both an Anthropic account and RuAPI?**
>
> Yes — switch between them in one click with [CC Switch](/en/integrations/ccswitch.md).

## Next steps

> **[Claude Code in Russia — no VPN, no account](https://www.ruapi.ai/claude-code-v-rossii?lng=en\&utm_source=docs\&utm_campaign=en-claude-code-russia)**
>
> Why it's better to connect Claude Code through a gateway from Russia.

> **[Detailed Claude Code setup](/en/integrations/claude-code.md)**
>
> Models, environment variables, Windows.

> **[Claude Code on DeepSeek](/en/integrations/claude-code-deepseek.md)**
>
> The same Claude Code — many times cheaper.

> **[How to buy USDT with rubles](/en/buy-usdt.md)**
>
> Crypto Bot, Bybit P2P or an exchanger — three ways.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.