Direct access from Russia — no VPN·USDT / USDC in 5 minutes·Original models, no downgrade

LangChain in Russia: Claude, GPT, DeepSeek and Gemini in ChatOpenAI and LangGraph, no VPN

LangChain and LangGraph are open-source Python and JavaScript libraries for agents, RAG and LLM pipelines. The libraries are free, but an OpenAI or Anthropic key is out of reach from Russia. RuAPI fills that gap: give ChatOpenAI the base_url https://www.ruapi.ai/v1 and a RuAPI key, and the same code runs on Claude, GPT, DeepSeek, Gemini, Qwen and GLM. For Claude you can also use the native ChatAnthropic. No VPN, pay in USDT.

Python and JS LangGraph and create_agent Claude, GPT, DeepSeek, Gemini pay 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)
Model replyHello! How can I help you today?

This checks the key with the plain openai SDK. LangChain takes the same two values: https://www.ruapi.ai/v1 goes into base_url and the key into api_key (in JS — configuration.baseURL and apiKey).

What gets in the way of LangChain from Russia

The packages install, the key does not come.

pip install langchain runs fine, but the first model call needs an API key. Neither Anthropic nor OpenAI lists Russia among supported countries (anthropic.com/supported-countries, developers.openai.com/api/docs/supported-countries, 5 Nov 2026), so a direct key is not an option. A RuAPI key is created right after sign-up, and the balance is topped up in USDT.

One package, key and bill per vendor.

LangChain has separate integrations for OpenAI, Anthropic, Google and DeepSeek — langchain-openai, langchain-anthropic, langchain-google-genai, langchain-deepseek — and each expects a key from its own company. Through RuAPI every model answers at one OpenAI-compatible address, so ChatOpenAI and a single key are enough: you switch models with the model field, and the rest of your chain or graph stays the same.

An agent in a loop burns tokens quietly.

At every step a LangGraph agent resends the whole history to the model: messages, tool calls and their results. One bug in the stop condition and the bill keeps growing. So it helps to have a separate key with a budget for development and to run tests on a cheap model: deepseek-flash costs $0.168 per 1M input tokens, and a repeated prefix from cache $0.012.

# how to start

How to connect RuAPI to LangChain: 3 steps

For the current releases: langchain 1.4, langchain-openai 1.7, langchain-anthropic 1.7, LangGraph 1.2 on Python 3.10+ and @langchain/openai 1.8 for JavaScript (PyPI, npm, 5 Nov 2026). Sample code is in the block below.

  1. Sign up for RuAPI and top up

    An account at www.ruapi.ai opens with an email, Google or Yandex login. USDT is the easiest way to top up: from 5 USDT on TRC20, BEP20, TON or Polygon, and USDC is accepted too. USDT can be bought for rubles through SBP — step by step at docs.ruapi.ai/en/buy-usdt. A foreign-issued card works as well.

    New accounts usually get $0.05 right away — enough to run the first examples on claude-haiku-5-5, deepseek-flash or gpt-6-luna. The other models unlock after your first top-up.

  2. Create a key for the project

    Console → API Keys → “Create API key”. For agent experiments, turn off “Unlimited” in the Credit limit block and set an amount: a graph stuck in a loop cannot spend more. Keep the key in an environment variable or a .env file, not in code that goes to git.

    The API Keys page in the RuAPI Console: a key for a LangChain projectThe API Keys page in the RuAPI Console: a key for a LangChain project
  3. Pass the address and key to the LangChain model

    • Python: pip install -U langchain langchain-openai. Then ChatOpenAI(model="deepseek-flash", base_url="https://www.ruapi.ai/v1", api_key="sk-..."). Instead of arguments you can set OPENAI_API_KEY and OPENAI_BASE_URL (or OPENAI_API_BASE) — ChatOpenAI reads them on its own.
    • JavaScript and TypeScript: npm install @langchain/openai @langchain/core. The address goes inside configuration rather than at the top level: new ChatOpenAI({ model: "deepseek-flash", apiKey: "sk-...", configuration: { baseURL: "https://www.ruapi.ai/v1" } }).
    • Claude in the native Anthropic format: pip install -U langchain-anthropic and ChatAnthropic(model="claude-sonnet-5-5", base_url="https://www.ruapi.ai", api_key="sk-..."). This address has no /v1 — the library appends /v1/messages itself.
    • Call llm.invoke("Hello!") and open Console → Usage Logs: a new line with the model and price means you are connected. From there, pass llm to create_agent, LCEL chains or LangGraph nodes like any other model.

Minimal code

Python: any model through ChatOpenAI

pip install -U langchain langchain-openai

from langchain_openai import ChatOpenAI

llm = ChatOpenAI(

model="deepseek-flash",

base_url="https://www.ruapi.ai/v1",

api_key="sk-...",

)

print(llm.invoke("Hello!").content)

JavaScript / TypeScript (ESM)

npm install @langchain/openai @langchain/core

import { ChatOpenAI } from "@langchain/openai";

const llm = new ChatOpenAI({

model: "deepseek-flash",

apiKey: "sk-...",

configuration: { baseURL: "https://www.ruapi.ai/v1" },

});

console.log((await llm.invoke("Hello!")).content);

Claude through ChatAnthropic

pip install -U langchain-anthropic

from langchain_anthropic import ChatAnthropic

# base_url without /v1: the library appends /v1/messages

llm = ChatAnthropic(

model="claude-sonnet-5-5",

base_url="https://www.ruapi.ai",

api_key="sk-...",

max_tokens=4096,

)

print(llm.invoke("Hello!").content)

Model prices for LangChain projects

From cheap models for tests and RAG to strong ones for complex agents. USD per 1M tokens, as on the pricing page. No subscription: only the tokens your code spends are charged.

modelinput $/Moutput $/M
deepseek-flash
$0.17
cache read $0.0120
$1.44
gpt-5.4-mini
$0.90
cache read $0.0900
$5.40
claude-haiku-5-5
$0.12
cache read $0.0120
>100K: $0.60
$0.60
>100K: $3.00
gemini-3.8-flash
$0.90
cache read $0.0900
$4.50
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

Input covers new input tokens, “cache read” the part of the input served from cache, output the model’s reply. GPT and DeepSeek cache a repeated request prefix on their own. Claude caches by cache_control marks. If you set none, RuAPI adds them for both ChatOpenAI and ChatAnthropic: when the request already holds earlier model replies and the previous call to that model with the same key was less than 5 minutes ago, it marks the end of the system prompt and the last user message. After three cache writes in a row that do not pay off, auto-marking pauses for an hour for that key and model. You can pass your own marks in ChatOpenAI message blocks or add them with AnthropicPromptCachingMiddleware from langchain_anthropic.middleware; then RuAPI adds nothing (docs.ruapi.ai/en/prompt-caching).

The “>100K” row, shown in grey, is the vendor’s rate for prompts above the threshold; a request that exceeds it is paid entirely at that rate.

All models and prices →

# faq

FAQ

The libraries themselves do: LangChain and LangGraph are MIT-licensed and install from PyPI and npm. The project is very much alive: langchain-openai 1.7.4 and langchain-anthropic 1.7.10 shipped on 4 Nov 2026, langgraph 1.2.20 on 5 Nov 2026, and the latest commits to github.com/langchain-ai/langchain and langgraph are from 5 Nov 2026 too (checked 5 Nov 2026). The trouble starts only with keys from OpenAI and Anthropic themselves, which cannot be obtained from Russia. With https://www.ruapi.ai/v1 as base_url, requests go straight to our server.

Connect Claude, GPT and DeepSeek to your LangChain agent

Create account