www.ruapi.ai without a VPN.
For a short explanation of why OpenClaw needs a provider like RuAPI, what the models cost and how to pay without a foreign card, see www.ruapi.ai/openclaw-v-rossii; the setup steps are below.
What you need
RuAPI account and API key
claude-haiku-5-5, deepseek-flash and gpt-6-luna work. Other models become available after the first top-up — in USDT from 5 USDT, no foreign card needed (how to buy USDT with rubles via SBP). Foreign-issued bank cards are accepted too.Operating system
Node.js — only for npm installs
Install OpenClaw
- macOS / Linux / WSL2
- Windows (PowerShell)
- Windows Hub
- npm
Connect RuAPI
To OpenClaw, RuAPI is two custom providers that share one key:provider/model, e.g. ruapi/claude-sonnet-5-5 or ruapi-openai/deepseek-flash.
Method 1: openclaw.json (recommended)
Open the config file
~/.openclaw/openclaw.json; this command prints the exact path:models and agents sections (don’t create a second copy of either section).Add the providers and the primary model
idis the exact model name from the pricing page, case-sensitive. List every model you want to call undermodels.input: ["text", "image"]marks the model as image-capable, so OpenClaw passes photos from messengers to it as images. Without this field the model is treated as text-only;glm-5.3has none because it works with text only.fallbacksare backup models: if the primary one fails, OpenClaw tries them in order.
Check the settings
models status should show ruapi/claude-sonnet-5-5 as the primary model and ruapi-openai/deepseek-flash as the fallback. If the changes weren’t picked up, run openclaw gateway restart.How to keep the key out of openclaw.json
How to keep the key out of openclaw.json
~/.openclaw/.env:apiKey: "${RUAPI_API_KEY}". You can also set variables inside openclaw.json itself, under env.vars, e.g. env: { vars: { RUAPI_API_KEY: "sk-…" } }. Keys placed directly under env (without vars), as in older examples, are not accepted by the current OpenClaw.Method 2: the openclaw onboard wizard
The wizard is handy when you need a single provider. The installer opens it automatically; to run it by hand (the same command also switches providers on an existing install):Find Custom Provider
Fill in the fields
glm-5.3): they work with text only. The wizard treats deepseek-flash as text-only on its own; to send it images, add input: ["text", "image"] to it in openclaw.json afterwards.Choose the format explicitly rather than Unknown (detect automatically): auto-detection may connect Claude in the OpenAI format, where OpenClaw sets no cache markers and only RuAPI auto-caching applies.Wait for the check
Second provider — same way
openclaw onboard again and add a second Custom Provider with its own Endpoint ID. You can switch the primary model later with openclaw models set ruapi/claude-sonnet-5-5.First request
Open a chat right in the terminal and ask for a one-sentence hello:openclaw dashboard and send a message there.
You should get a reply, and RuAPI Console → Usage Logs should show an entry for the selected model. Check real charges there: OpenClaw’s own stats count a model without a cost field as free.
To keep the Gateway running in the background and after reboots, install it as a service: openclaw gateway install (or openclaw onboard --install-daemon). Status: openclaw gateway status.
Choosing another model
agents.defaults.model.primary in openclaw.json. The model must be listed under models of its provider.
Claude caching
-
Anthropic format (
ruapiprovider). OpenClaw setscache_controlmarkers on tool definitions, system instructions and recent messages by itself — the cache lives 5 minutes. The agent’s repeated context is billed at the cache-read price. -
One-hour cache is turned on with
cacheRetention: "long"for a specific model. Writing to that cache costs 2 × the input price (see prompt caching)."short"is the regular 5-minute cache,"none"sends no markers. -
OpenAI format. If you connect Claude through
ruapi-openai, OpenClaw sets no markers for it, and only RuAPI auto-caching applies: on the first turn of a new conversation at most the system prompt and tools are cached, and after a gap of more than 5 minutes the cache expires. DeepSeek and GPT cache automatically, no markers needed.
cacheRetention: "short" for the model explicitly.
Troubleshooting
Model not found (503) or 404
Model not found (503) or 404
- The model ID needs the provider in front:
ruapi/claude-sonnet-5-5,ruapi-openai/deepseek-flash. - The model must be in that provider’s
models, and itsidmust match the pricing page exactly, including case (GLM-5.2butglm-5.3). baseUrl:https://www.ruapi.aiforanthropic-messages,https://www.ruapi.ai/v1foropenai-completions.- Before the first top-up, only
claude-haiku-5-5,deepseek-flashandgpt-6-lunawork.
The Gateway won't start after editing openclaw.json
The Gateway won't start after editing openclaw.json
api: "openai" instead of "openai-completions", and models as a list of strings instead of { id, name } objects.Set up with an older version of this guide (ANTHROPIC_BASE_URL)
Set up with an older version of this guide (ANTHROPIC_BASE_URL)
ANTHROPIC_BASE_URL and ANTHROPIC_API_KEY and calling models as anthropic/claude-.... The built-in anthropic provider is designed for Anthropic’s official API, so switch to a custom provider:- Remove
ANTHROPIC_BASE_URLandANTHROPIC_API_KEYfromenv(orenv.vars) inopenclaw.jsonand from~/.zshrc/~/.bashrc. - Add the
ruapiprovider as in method 1 above. - Replace
anthropic/...withruapi/...inagents.defaults.model.
openclaw onboard hangs or the check fails
openclaw onboard hangs or the check fails
- Check connectivity:
curl -I https://www.ruapi.ai. - Exit the wizard (Ctrl+C) and add the provider to
openclaw.jsonby hand (method 1 above).
OpenClaw logs “returned no token usage” for ruapi-openai models
OpenClaw logs “returned no token usage” for ruapi-openai models
compat: { supportsUsageInStreaming: true } to the ruapi-openai models — RuAPI supports it.The agent spends tokens when I'm not messaging it
The agent spends tokens when I'm not messaging it
openclaw automations list --all and turn one off with openclaw automations disable <id>.Ollama and RuAPI together
Ollama and RuAPI together
ollama/...). Add the RuAPI providers alongside it: for example, ruapi/claude-sonnet-5-5 as the primary model and a local model in agents.defaults.model.fallbacks, or the other way round. Details: OpenClaw docs.