Qwen Code in Russia: install it and connect an API without a VPN or a foreign card
Qwen Code is an open-source coding agent from the Qwen team (Alibaba) that runs in the terminal, in VS Code and as a desktop app. The free Qwen OAuth sign-in was shut down on 15 April 2026, so models are now connected with an API key. With a RuAPI key, Qwen Code works with Qwen 3.8, DeepSeek, GPT and Claude — requests go to www.ruapi.ai without a VPN, and you top up in USDT.
Updated:
from openai import OpenAI
client = OpenAI(
api_key="sk-...",
base_url="https://www.ruapi.ai/v1",
)
resp = client.chat.completions.create(
model="deepseek-flash",
messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)Before setting up Qwen Code, test your key with this request (cURL tab): deepseek-flash already works on the trial balance. In Qwen Code you enter the same address https://www.ruapi.ai/v1 and the same key.
Why people connect Qwen Code through RuAPI
Free sign-in via Qwen OAuth is gone.
Qwen Code used to run with a qwen.ai account, with no key and no payment. That free quota ended on 15 Apr 2026, and Qwen OAuth was removed from the /auth menu (Qwen Code docs, 2 Nov 2026). The agent now needs a provider with an API key — RuAPI, for example.
Coding Plan means $50 a month and an Alibaba Cloud bill.
Coding Plan Lite is no longer sold; what is left is Pro at $50 a month, with a limited number of slots (alibabacloud.com/help/en/model-studio/coding-plan, 2 Nov 2026). It is paid through Alibaba Cloud, where Russian cards do not go through. RuAPI has no subscription: you top up from 5 USDT and pay only for tokens.
Models from different vendors in one agent.
Qwen Code is not tied to Qwen models: in OpenAI-compatible mode it accepts any model ID. One RuAPI key gives you qwen3.8-max, deepseek-flash, gpt-5.4 and claude-sonnet-5-5, and you switch between them with the /model command in the middle of a session.
How to connect Qwen Code to RuAPI: 4 steps
Checked against the docs and source code of Qwen Code v0.26.5 (github.com/QwenLM/qwen-code, 2 Nov 2026). Menu items below are named exactly as the terminal version labels them.
Sign up for RuAPI and top up
Create an account at www.ruapi.ai with email, Google or Yandex — no phone number needed. Top up in USDT from 5 USDT on TRC20, BEP20, TON or Polygon; USDC and foreign-issued cards are accepted too. No USDT yet? It can be bought with rubles via SBP: docs.ruapi.ai/en/buy-usdt
New accounts usually get $0.05 right away. The trial balance covers claude-haiku-5-5, deepseek-flash and gpt-6-luna; the other models, Qwen included, unlock after your first top-up.
Create a key for Qwen Code
In the Console, open API Keys → "Create API key". An agent fires many requests in a row on its own, so a separate key for Qwen Code with a spending limit is handy: it cannot spend past that limit.


Install Qwen Code
- Linux and macOS: curl -fsSL https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen-standalone.sh | bash
- Windows (PowerShell): irm https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen-standalone.ps1 | iex
- With npm, if you have Node.js 22 or newer: npm install -g @qwen-code/qwen-code@latest. On macOS and Linux there is also Homebrew: brew install qwen-code.
- Restart the terminal after installing, go to your project folder and run qwen.
Add RuAPI as a Custom Provider
- In a Qwen Code session, type /auth and choose Custom Provider (RuAPI is not in the Third-party Providers list).
- Protocol: OpenAI-compatible. API: Chat Completions — in Responses mode RuAPI passes GPT requests through as is and converts them for other models, but Chat Completions is the safer choice for Qwen Code.
- Base URL: https://www.ruapi.ai/v1 — ending in /v1. API Key: your sk-… key.
- Model IDs: several IDs separated by commas, e.g. deepseek-flash, qwen3.8-max, claude-sonnet-5-5.
- You can skip Advanced Config. Better leave Enable thinking unchecked: with it, Qwen Code adds Alibaba’s enable_thinking parameter to requests for every model in the list, GPT and Claude included. On the Review step press Enter and the setup is saved to settings.json; switch models later with /model.
All model IDs: docs.ruapi.ai/en/models. Your first API request step by step: docs.ruapi.ai/en/quickstart
What to enter in Qwen Code
/auth → Custom Provider
Protocol: OpenAI-compatible
API: Chat Completions
Base URL: https://www.ruapi.ai/v1
API Key: sk-…
Environment variables
OPENAI_API_KEY=sk-…
OPENAI_BASE_URL=https://www.ruapi.ai/v1
OPENAI_MODEL=deepseek-flash
Payment
USDT / USDC from 5 USDT
TRC20 · BEP20 · TON · Polygon
foreign-issued cards
What models for Qwen Code cost
Prices in USD per 1M tokens, from the RuAPI pricing page. No monthly fee: only the tokens the agent actually spends are charged.
| model | input $/M | output $/M |
|---|---|---|
| qwen3.8-flash | $0.14 cache read $0.0288 | $0.49 |
| deepseek-flash | $0.17 cache read $0.0120 | $1.44 |
| gpt-5.4-mini | $0.90 cache read $0.0900 | $5.40 |
| qwen3.8-27b | $0.54 cache read $0.11 | $2.16 |
| qwen3.8-max | $2.16 cache read $0.43 | $6.46 |
| gpt-5.4 | $3.00 cache read $0.30 >272K: $6.00 | $18.00 >272K: $27.00 |
| claude-sonnet-5-5 | $2.40 cache read $0.12 | $12.00 |
Each time, the agent sends the model its system prompt, tool descriptions and session history, so input tokens far outnumber output tokens. Our estimate for one request with 30,000 input and 1,000 output tokens, no cache: qwen3.8-flash about $0.005, deepseek-flash about $0.0065, qwen3.8-max about $0.071, claude-sonnet-5-5 about $0.084. DeepSeek and GPT automatically bill a repeated request prefix at the cheaper cache-read rate. Qwen Code adds no cache_control marks for third-party endpoints (per its source code, 2 Nov 2026), so for Claude RuAPI adds them itself when the next agent step comes within 5 minutes; the estimate above leaves this discount out (docs.ruapi.ai/en/prompt-caching).
The grey “>272K” line is the vendor’s rate for long prompts: if a prompt goes over the threshold, the whole request is billed at that rate.
RuAPI or Alibaba Cloud Coding Plan
| Qwen Code + RuAPI | Qwen Code + Coding Plan | |
|---|---|---|
| Price | Tokens only, no monthly fee; top-ups from 5 USDT | Pro — $50 a month; Lite not sold since 20 Mar 2026 |
| Paying from Russia | USDT or USDC — USDT can be bought with rubles via SBP; foreign-issued cards work too | Alibaba Cloud billing: Visa, Mastercard, AMEX, JCB cards enabled for international payments, or PayPal |
| Limits | No monthly request quota, and the key works in scripts and CI too: spending is capped by your balance and by a key limit, if you set one | Up to 6,000 requests per 5 hours, 45,000 per week and 90,000 per month; slots are limited; interactive use in coding tools only, not scripts |
| Models | Qwen 3.8, DeepSeek, GPT, Claude, GLM, Kimi, MiniMax | qwen3.7-plus, qwen3.6-plus, qwen3.5-plus, kimi-k2.5, glm-5, MiniMax-M2.5 |
Coding Plan details: alibabacloud.com/help/en/model-studio/coding-plan (page updated 11 Oct 2026, checked 2 Nov 2026); payment methods: Alibaba Cloud Payment FAQ (alibabacloud.com/help/en/user-center/support/payment-faq, checked 2 Nov 2026). Since March 2022, Russian-issued Visa and Mastercard cards do not work abroad, and PayPal is closed in Russia.
