Dify in Russia: Claude, GPT, DeepSeek and Gemini for agents, no VPN or foreign card
Dify is an open-source platform for building chatbots, AI agents, workflows and RAG over your own documents: you run it on your own server with Docker or use the hosted Dify Cloud. Dify has no models of its own — they come from model provider plugins. The OpenAI-API-compatible plugin only needs the address https://www.ruapi.ai/v1 and one RuAPI key to bring Claude, GPT, Gemini, DeepSeek and Qwen into Dify. Requests go through without a VPN, and the balance is topped up in USDT.
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)The example on the cURL tab tests your key from a terminal — handy to run right on the server where Dify lives. In the OpenAI-API-compatible plugin the same values go into the API Base URL (https://www.ruapi.ai/v1) and API Key fields.
What gets in the way of connecting models to Dify from Russia
Without a model key, Dify can do nothing.
Every LLM node, agent and chatbot in Dify reaches its model through a provider plugin, and the plugin needs a key. Anthropic and OpenAI do not offer their APIs in Russia — it is missing from both companies’ supported-country lists (anthropic.com/supported-countries, developers.openai.com, 2 Nov 2026). A RuAPI key is issued right after you sign up with email, Google or Yandex.
A plugin per vendor means separate keys and bills.
Dify has plugins for Claude, GPT, DeepSeek and Gemini, but each needs an account and a payment method with its own company. Through RuAPI, models from different vendors go into one OpenAI-API-compatible plugin with one key: to move an LLM node to another model, just pick it in the list. The cost of every request shows up in the RuAPI console log.
A published app spends money for every visitor.
A Dify chatbot can be opened as a web app or called over the API, and workflows run without you. So give the RuAPI key a budget: once it runs out, the key stops, however much is left on the balance. Housekeeping tasks such as chat titles go to the system model, so it pays to make it a light one: deepseek-flash costs $0.168 per 1M input tokens.
How to connect RuAPI to Dify: 3 steps
Works for self-hosted Dify in Docker and for Dify Cloud alike. Model providers are managed by the workspace owner or an admin (docs.dify.ai, 2 Nov 2026).
Sign up for RuAPI and top up
Register at www.ruapi.ai with email, Google or Yandex; you will not be asked for a phone number. The minimum top-up is 5 USDT on TRC20, BEP20, TON or Polygon, and USDC is accepted as well. Where to get USDT for rubles via SBP is shown at docs.ruapi.ai/en/buy-usdt. Cards from foreign banks can also be used.
A new account usually gets $0.05 right away: enough to try a Dify app on claude-haiku-5-5, deepseek-flash or gpt-6-luna. Everything else opens up once you top up for the first time.
Create a separate key for Dify
Console → API Keys → "Create API key". A key saved in Dify is shared by the whole workspace: every member and every app uses it, published ones included. So turn off "Unlimited" in the Credit limit block and enter an amount — Dify will not spend more than that.


Install the OpenAI-API-compatible plugin and add models
- Open Integrations → Model Provider. Under Install model providers or in the Marketplace, find the OpenAI-API-compatible plugin by langgenius and install it.
- On the plugin card click Add Model and choose the LLM type. Model Name — the model ID exactly as on the pricing page, e.g. deepseek-flash. API Key — your sk-… key. API Base URL — https://www.ruapi.ai/v1, with /v1.
- Model context size is the model’s context window: 1,000,000 tokens for deepseek-flash and claude-sonnet-5-5. Upper bound for max tokens sets the ceiling for the max_tokens parameter in app settings, e.g. 8192. For agents set Function Call Type to Tool Call; for models that read images, set Vision Support to Support. Leave API Type on Chat Completions: the app works more reliably with all models that way.
- Click Save — Dify checks the key with a short test request. Add other models the same way with the same key. Then, in Default Models, set the System Reasoning Model, e.g. deepseek-flash: among other things Dify uses it to name chats.
RuAPI addresses and keys: docs.ruapi.ai/en/quickstart · tool calling: docs.ruapi.ai/en/function-calling
What to set in Dify
OpenAI-API-compatible plugin
API Base URL: https://www.ruapi.ai/v1
API Key: sk-…
Model Name: deepseek-flash
Model type: LLM (for embeddings, add a separate Text Embedding model)
Anthropic plugin (Claude only)
API URL: https://www.ruapi.ai
API Key: sk-…
Payment
USDT / USDC from 5 USDT
foreign-issued cards
no subscription
Model prices for Dify apps
What the models that suit Dify agents, chatbots and RAG cost, in USD per 1M tokens, as on the pricing page. No subscription: only the tokens your apps spend are charged.
| model | input $/M | output $/M |
|---|---|---|
| deepseek-flash | $0.17 cache read $0.0120 | $1.44 |
| glm-5.3-flash | $0.14 cache read $0.0420 | $0.50 |
| 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.5-flash | $1.80 cache read $0.18 | $10.80 |
| deepseek-v4-pro | $1.58 cache read $0.0600 | $4.75 |
| claude-sonnet-5-5 | $2.40 cache read $0.12 | $12.00 |
Input is the price of new input tokens, “cache read” of input tokens from the cache, output of the model’s reply. In a RAG app Dify adds the retrieved document chunks to every question, so input tokens usually outnumber output tokens. GPT and DeepSeek cache a repeated request prefix with no extra setup. The OpenAI-API-compatible plugin adds no cache_control marks; for Claude RuAPI adds them when the request already holds earlier model replies and the previous call came less than 5 minutes ago. One-off questions to a RAG app usually do not meet that condition, so for Claude caching the Anthropic plugin with its cache settings is the better fit (docs.ruapi.ai/en/prompt-caching). For the knowledge base RuAPI offers the embedding models text-embedding-3-small and text-embedding-3-large — see the FAQ below for how to add them.
The grey “>100K” line is the vendor’s rate for long prompts: if a prompt goes over the threshold, the whole request is billed at that rate.
Dify or n8n for AI tasks
| Dify + RuAPI | n8n + RuAPI | |
|---|---|---|
| Built for | Apps around an LLM: chatbots, agents, RAG over documents, workflows | Automating processes across services; the model is one node in a workflow |
| Knowledge base (RAG) | Built in: document upload, chunking, retrieval | Assembled from Vector Store nodes and an embedding model |
| How RuAPI connects | OpenAI-API-compatible plugin, API Base URL https://www.ruapi.ai/v1 | OpenAI credential, Base URL https://www.ruapi.ai/v1 |
| Self-hosted license | Modified Apache 2.0: no multi-tenant service and no removing the Dify logo without permission | Sustainable Use License (fair-code): free for internal use |
Based on github.com/langgenius/dify (LICENSE file), docs.dify.ai and docs.n8n.io, checked 2 Nov 2026. The two are not mutually exclusive: Dify apps have an API, and n8n can call them with a plain HTTP request.
