> ## 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.

# OpenRouter not working: 403 “Access denied by security policy” — what to do

> OpenRouter returns 403 “Access denied by security policy” and the website shows “Sorry, you have been blocked”: why the refusal depends on your IP address, not your key, and how to move your code, Claude Code and Cline to RuAPI without a VPN — base URL, key and a model-name table.

**Short answer:** if OpenRouter isn't working and returns a 403 with the text `Access denied by security policy`, that's the protection at OpenRouter's front door — the request never reaches the models or the key check. This is how OpenRouter currently answers requests from Russian IP addresses (our check, 21 Nov 2026). The protection checks the IP address the request comes from, so neither a new key nor a second account will help. To keep working without a VPN, move your code to RuAPI: the request format is the same OpenAI-compatible one. You change three things — the base URL, the key and the model names (table below).

## What the error looks like

A request to the API (`/api/v1/chat/completions`, `/api/v1/models` and others) gets a **403**:

```json theme={null}
{ "success": false, "error": "Access denied by security policy." }
```

In the OpenAI Python SDK the error looks like this: `openai.PermissionDeniedError: Error code: 403 - {'success': False, 'error': 'Access denied by security policy.'}`.

The openrouter.ai website doesn't open either: instead you get a Cloudflare page, “Sorry, you have been blocked”, with the line “You are unable to access openrouter.ai”.

> [!NOTE]
>
> Checked on 21 Nov 2026 with [globalping.io](https://globalping.io): hosting-provider nodes in Moscow and Saint Petersburg got this response from `/api/v1/models` and `/api/v1/chat/completions` (requests without a key), while a node in Germany got the model list for the same `/api/v1/models` request. Home internet nodes — MTS, Rostelecom, Beeline and MGTS — got the same response from `/api/v1/models`, and the same Cloudflare page instead of the site.

## Why OpenRouter returns 403

* **It's an IP block, not a key error.** OpenRouter's regular errors, [according to its documentation](https://openrouter.ai/docs/api-reference/errors) (checked on 21 Nov 2026), look different: `{"error": {"code": …, "message": …}}`. This response comes from the Cloudflare protection in front of the site — the same one that shows “Sorry, you have been blocked” in a browser. The request never reaches OpenRouter's API or the key check.
* **First payments were cut off, then access.** On 11 May 2026, owners of accounts with the region set to Russia received an email from OpenRouter: the service no longer supports usage and payments associated with their geography. After that, top-ups failed both by card and with crypto via Coinbase ([Habr post of 12 May 2026](https://habr.com/ru/articles/1034012/)). Now the service itself doesn't open either — see the check above. We found no official announcement from OpenRouter. For the top-up options that articles suggest and their risks, see [How to top up OpenRouter from Russia](https://docs.ruapi.ai/en/pay-openrouter-russia.md).
* **A VPN breaches the terms.** Section 5.7 of the [OpenRouter terms](https://openrouter.ai/terms) (version of 31 Aug 2026) prohibits using a VPN or proxy to reach models whose providers don't allow use in certain countries, or circumventing OpenRouter's safeguards that restrict such access. A breach counts as material: access to the service can be suspended or terminated right away. Under section 9, unused credits are not refunded if you violate the terms.

## What to do if OpenRouter isn't working

| Where OpenRouter was set up | What to change |
| - | - |
| Your own code on the OpenAI SDK, LangChain and the like | The base URL, the key and the model names — [steps below](#how-to-move-your-code-from-openrouter-to-ruapi) |
| Claude Code | Two variables and the model names — [Claude Code section](#claude-code-instead-of-openrouter) |
| Cline, Kilo Code, Continue and other tools with a built-in “OpenRouter” option | Replace the “OpenRouter” provider with a RuAPI connection (details in the [FAQ](#faq)) |

## How to move your code from OpenRouter to RuAPI

**1. Account**

Sign up at [www.ruapi.ai](https://www.ruapi.ai/?lng=en\&utm_source=docs\&utm_campaign=en-openrouter-403-access-denied) — with email, Google or Yandex.

**2. Balance**

Console → **Wallet**: USDT or USDC (TRC20 / BEP20 / Polygon; USDT also on TON), from 5 USDT, no foreign card needed. No USDT yet? [Buy it with rubles via SBP](https://docs.ruapi.ai/en/buy-usdt.md). You can also pay with a card from a foreign bank (Visa / Mastercard).

**3. Key**

Console → **API Keys** → **Create API key**. A RuAPI key starts with `sk-`; use it in place of your OpenRouter key (`sk-or-…`).

**4. Code**

Change `base_url`, the key and the model name. Messages, streaming, function calling and image input work as before.

```python Python theme={null}
from openai import OpenAI

# Before: OpenAI(api_key="sk-or-...", base_url="https://openrouter.ai/api/v1")
client = OpenAI(
    api_key="sk-your-RuAPI-key",
    base_url="https://www.ruapi.ai/v1",
)

resp = client.chat.completions.create(
    model="claude-sonnet-5-5",  # before: "anthropic/claude-sonnet-5.5"
    messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)
```

```javascript Node.js theme={null}
import OpenAI from "openai";

// Before: baseURL: "https://openrouter.ai/api/v1"
const client = new OpenAI({
  apiKey: "sk-your-RuAPI-key",
  baseURL: "https://www.ruapi.ai/v1",
});

const resp = await client.chat.completions.create({
  model: "claude-sonnet-5-5", // before: "anthropic/claude-sonnet-5.5"
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(resp.choices[0].message.content);
```

```bash curl theme={null}
curl https://www.ruapi.ai/v1/chat/completions \
  -H "Authorization: Bearer sk-your-RuAPI-key" \
  -H "Content-Type: application/json" \
  -d '{"model": "claude-sonnet-5-5", "messages": [{"role": "user", "content": "Hello!"}]}'
```

## Model names: OpenRouter → RuAPI

The general rule: drop the prefix before “/” (`anthropic/`, `openai/`, `google/` …). For Claude models, replace the dot in the version number with a hyphen: `5.5` → `5-5`. The exceptions are `deepseek-flash` and `MiniMax-M3.1-Flash` (letter case matters) — see the table.

| OpenRouter | RuAPI |
| - | - |
| `anthropic/claude-opus-5.5` | `claude-opus-5-5` |
| `anthropic/claude-sonnet-5.5` | `claude-sonnet-5-5` |
| `anthropic/claude-haiku-5.5` | `claude-haiku-5-5` |
| `anthropic/claude-fable-5.2` | `claude-fable-5-2` |
| `openai/gpt-6.2-sol` | `gpt-6.2-sol` |
| `openai/gpt-6.2-astra` | `gpt-6.2-astra` |
| `openai/gpt-6.1-sol` | `gpt-6.1-sol` |
| `openai/gpt-6-luna` | `gpt-6-luna` |
| `openai/gpt-5.4-mini` | `gpt-5.4-mini` |
| `google/gemini-4-argon` | `gemini-4-argon` |
| `google/gemini-3.8-flash` | `gemini-3.8-flash` |
| `deepseek/deepseek-v4.1-flash` | `deepseek-flash` |
| `deepseek/deepseek-v4-pro` | `deepseek-v4-pro` |
| `moonshotai/kimi-k3.1-pro` | `kimi-k3.1-pro` |
| `qwen/qwen4-max` | `qwen4-max` |
| `z-ai/glm-5.3` | `glm-5.3` |
| `x-ai/grok-4.7` | `grok-4.7` |
| `minimax/minimax-m3.1-flash` | `MiniMax-M3.1-Flash` |

The full list is on the [pricing page](https://www.ruapi.ai/pricing?lng=en\&utm_source=docs\&utm_campaign=en-openrouter-403-access-denied), or call `GET https://www.ruapi.ai/v1/models` with your key. Table current as of 21 Nov 2026.

### What else to remove from the request

| OpenRouter | RuAPI |
| - | - |
| `HTTP-Referer` and `X-Title` headers | Not needed, remove them |
| `provider`, `models` (fallback models), `transforms` fields | Not needed: RuAPI picks the provider, and if one channel fails, the request automatically fails over to a backup |
| `:free`, `:nitro`, `:floor`, `:online` suffixes on the model name | Remove them — use the model name without a suffix |
| `reasoning: {"effort": "high"}` | The standard `reasoning_effort: "high"` parameter — works for GPT and Claude ([details](https://docs.ruapi.ai/en/openai-vs-anthropic-format.md)) |

## Claude Code instead of OpenRouter

[OpenRouter's guide](https://openrouter.ai/docs/guides/coding-agents/claude-code-integration) (checked on 21 Nov 2026) sets up Claude Code like this: `ANTHROPIC_BASE_URL=https://openrouter.ai/api`, the key in `ANTHROPIC_AUTH_TOKEN`, an empty `ANTHROPIC_API_KEY`. RuAPI uses the same scheme; only the values change. RuAPI accepts the Anthropic Messages format that Claude Code speaks natively, so no router is needed.

In `~/.claude/settings.json`:

```json theme={null}
{
  "model": "claude-sonnet-5-5",
  "env": {
    "ANTHROPIC_BASE_URL": "https://www.ruapi.ai",
    "ANTHROPIC_AUTH_TOKEN": "sk-your-RuAPI-key",
    "ANTHROPIC_API_KEY": "",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-5-5",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5-5",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-5-5"
  }
}
```

If you followed OpenRouter's guide and set the variables in `~/.zshrc` / `~/.bashrc` or in the project's `.claude/settings.local.json`, delete the lines with `openrouter.ai` and `OPENROUTER_API_KEY` there: project settings override `~/.claude/settings.json`. Replace names like `anthropic/claude-opus-5.5[1m]` or `~anthropic/claude-opus-latest` with names from the table above — including in `ANTHROPIC_DEFAULT_FABLE_MODEL` and `CLAUDE_CODE_SUBAGENT_MODEL` if you set them (for example `claude-fable-5-2`, `claude-opus-5-5`). `ANTHROPIC_BASE_URL` must not end with `/v1`. Then open a new terminal and run `/status`: the `Anthropic base URL` line should say `https://www.ruapi.ai`. Full setup: [Claude Code: setup](https://docs.ruapi.ai/en/integrations/claude-code.md).

## FAQ

> [accordion] Will a new key or another OpenRouter account help?
>
> No. The request is refused based on the IP address it came from, before the key is checked. From the same IP address a new key or a new account gets the same 403.

> [accordion] Why does OpenRouter work for a colleague abroad?
>
> Because their requests come from an IP address in another country. In our check, a node in Germany got the usual model list from `/api/v1/models`, while nodes in Moscow and Saint Petersburg got a 403.

> [accordion] Are the models on RuAPI the same ones I used on OpenRouter?
>
> The main ones, yes: Claude, GPT, Gemini, DeepSeek, Kimi, Qwen, GLM, Grok and MiniMax (see the table above). These are the original models at their native precision, with no extra quantization. Only the names differ.

> [accordion] The error comes from a tool, not my own code
>
> In the tool's settings, remove the “OpenRouter” provider and connect RuAPI. Connect Claude over the Anthropic protocol so prompt caching works; connect other models as “OpenAI Compatible”. In both cases the key is your RuAPI key, and the model name comes from the table above. Depending on the tool, the base URL is `https://www.ruapi.ai` or `https://www.ruapi.ai/v1` (tools build the request path differently), and menu names vary too, so follow the guide for your tool: [Cline](https://docs.ruapi.ai/en/integrations/cline.md), [Kilo Code](https://docs.ruapi.ai/en/integrations/kilo-code.md), [Roo Code](https://docs.ruapi.ai/en/integrations/roo-code.md), [Continue](https://docs.ruapi.ai/en/integrations/continue.md).

## Next steps

> [card] [OpenRouter alternative](https://www.ruapi.ai/openrouter-alternativa?lng=en\&utm_source=docs\&utm_campaign=en-openrouter-403-access-denied)
>
> RuAPI vs OpenRouter: payment, access, refunds of unused balance.

> [card] [OpenRouter: how to top up](https://docs.ruapi.ai/en/pay-openrouter-russia.md)
>
> Payment options from Russia, fees and risks — before you pay.

> [card] [How to buy USDT with rubles](https://docs.ruapi.ai/en/buy-usdt.md)
>
> No USDT yet? Buy it with rubles via SBP to top up RuAPI.

> [card] [RuAPI error codes](https://docs.ruapi.ai/en/errors.md)
>
> 400, 401, 403, 429 — what they mean and how to fix them.


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