How to connect OpenClaw to Anthropic via LiteAI in 2026
Step-by-step guide: LiteAI API key, openclaw.json5 config, ANTHROPIC_BASE_URL, model list opus4.8 / sonnet4.6 / haiku4.5 / fable-5, prompt caching, 1M context, Docker pitfalls.
How to connect OpenClaw to Anthropic via LiteAI in 2026
OpenClaw is an open-source AI gateway that lets you run one CLI across multiple providers (Anthropic, OpenAI, Qwen, GLM) and automatically switch between models. The OpenClaw docs support two Anthropic auth routes: an API key (direct) or Claude CLI (reusing a local Claude Code login). For developers in Russia in 2026, the most reliable path is API-key via LiteAI: ruble payment, no VPN, no foreign bank cards, and the same integration as direct Anthropic.
This article explains what OpenClaw actually does with Anthropic, how to get a LiteAI key in 30 seconds and wire it into agents.defaults.model, the specifics of the claude-fable-5 reasoning model, and the Docker pitfalls of OpenClaw.
TL;DR
- Open liteai.tech/pricing and buy a
sk-bf-…key — from 30 ₽ per 1M tokens. - Install OpenClaw (
npm i -g openclawor Docker). - Put
ANTHROPIC_API_KEY=sk-bf-…andANTHROPIC_BASE_URL=https://api.liteai.tech/anthropicin~/.openclaw/openclaw.json5. - Run
openclaw onboard --anthropic-api-key "$ANTHROPIC_API_KEY". - Verify with
openclaw models list --provider anthropic— you should seeanthropic/claude-opus-4-8,anthropic/claude-sonnet-4-6,anthropic/claude-haiku-4-5,anthropic/claude-fable-5.
Time: under 5 minutes. No VPN, no foreign card.
What is OpenClaw and why run it through Anthropic
OpenClaw sits between your requests and LLM providers. The benefits for a developer:
- Multi-model from one CLI. Switch between Claude Opus 4.8 for reasoning and Claude Haiku 4.5 for bulk tasks without touching your code.
- Failover. If Anthropic goes down, OpenClaw switches to OpenAI, Qwen, or GLM.
- Persisted config. Providers and models live in
~/.openclaw/openclaw.json5, not patched into your CLI. - Open source. The whole stack runs locally — the Anthropic proxy through LiteAI stays under your control.
Inside the OpenClaw Anthropic plugin (per the official docs):
| Backend | When to use | How it connects |
|---|---|---|
| API key | Standard path for production and shared automation | ANTHROPIC_API_KEY + optional ANTHROPIC_BASE_URL |
| Claude CLI | Reuse an existing local Claude Code login | claude --version + openclaw onboard → Claude CLI |
For developers outside the supported Anthropic regions in 2026, the API-key path through LiteAI is the realistic option. Claude CLI requires installing Claude Code CLI, and Claude CLI subscription auth is tied to Pro/Max plans — which aren't directly buyable in Russia.
Why LiteAI, not console.anthropic.com
console.anthropic.com for a developer outside supported regions is blocked at three levels (the same wall we describe in Claude Code in Russia):
- Registration requires a supported phone number.
- API-key creation requires Stripe address verification.
- Payments reject most non-supported card BIN codes.
ANTHROPIC_BASE_URL=https://api.liteai.tech/anthropic (or the LiteAI OpenAI-compatible endpoint) lifts all three blocks. LiteAI tariffs:
| Model | Price per 1M tokens |
|---|---|
| Claude Opus 4.8 | 30 ₽ (input and output identical) |
| Claude Sonnet 4.6 | 30 ₽ |
| Claude Haiku 4.5 | 30 ₽ |
| Claude Fable 5 (reasoning) | 50 ₽ |
In USD terms that's about $0.33 per 1M tokens on the main models — 9–45× cheaper than direct Anthropic for Russia-side teams. For non-Russia card holders, the pricing description on the front page already mentions "$1 per 1M tokens" for the same key.
Install OpenClaw and connect Anthropic via LiteAI
Step 1. Buy a LiteAI key
- Open liteai.tech/pricing.
- Pick a package by volume (1M for 30 ₽ trial, 5M for 150 ₽ active, 100M for 2 000 ₽ production).
- Pay via SBP, bank card or USDT (Bitbanker). The
sk-bf-…key arrives in 30 seconds by email and to the Telegram bot @liteaitech_bot.
Step 2. Install OpenClaw
macOS / Linux:
npm install -g openclaw
Windows:
npm install -g openclaw
Or via Docker — see docs.openclaw.ai/install/docker.
Step 3. Create the config that proxies through LiteAI
Create ~/.openclaw/openclaw.json5 (or add to an existing one):
{
env: {
ANTHROPIC_API_KEY: "sk-bf-your-key",
ANTHROPIC_BASE_URL: "https://api.liteai.tech/anthropic",
},
agents: {
defaults: {
model: { primary: "anthropic/claude-opus-4-8" },
},
},
}
What's happening:
ANTHROPIC_API_KEY— your LiteAI key, formatsk-bf-…. OpenClaw proxies it through LiteAI viaANTHROPIC_BASE_URL.ANTHROPIC_BASE_URL=https://api.liteai.tech/anthropic— the LiteAI proxy endpoint that fronts Anthropic API.agents.defaults.model.primary: "anthropic/claude-opus-4-8"— default model. OpenClaw uses theanthropic/prefix for all Claude models.
Step 4. Run onboarding and verify models
openclaw onboard --anthropic-api-key "$ANTHROPIC_API_KEY"
openclaw models list --provider anthropic
Expected output once LiteAI is wired:
anthropic/claude-opus-4-8 1M ready
anthropic/claude-opus-4-8-1m 1M ready
anthropic/claude-sonnet-4-6 200K ready
anthropic/claude-haiku-4-5 200K ready
anthropic/claude-fable-5 200K ready
If a model is missing or shows unavailable, check your balance in @liteaitech_bot and confirm ANTHROPIC_BASE_URL is spelled exactly right.
Step 5. Run your first request
openclaw run --model anthropic/claude-sonnet-4-6 "Hello, world"
If you got a reply back, OpenClaw is reaching Anthropic through LiteAI and returning Claude Sonnet 4.6. From this point on OpenClaw can swap models on demand.
OpenClaw and claude-fable-5: reasoning defaults
The new anthropic/claude-fable-5 model (available through LiteAI as a separate tariff at $10 per 1M tokens) has one important property in OpenClaw:
anthropic/claude-fable-5always uses adaptive thinking and defaults tohigheffort. Anthropic does not allow thinking to be disabled on this model, so/think offand/think minimalare remapped tolow.
What this means for OpenClaw:
- Don't pass a custom temperature — OpenClaw omits it for Fable 5 automatically.
- To suppress thinking, use
/think:lowinstead of/think:off. - For the rest of the models (
claude-opus-4-8,claude-sonnet-4-6,claude-haiku-4-5) thinking defaults to off. Turn it on explicitly with/think high|xhigh|maxor per-model params.
Config to force thinking on Opus 4.8:
{
agents: {
defaults: {
models: {
"anthropic/claude-opus-4-8": {
params: { thinking: "high" },
},
},
},
},
}
Details: OpenClaw doc for fable-5 thinking defaults and our «fable-5 model» blog post.
Prompt caching through LiteAI
OpenClaw supports Anthropic prompt caching for all models. The LiteAI proxy passes cacheRetention through to Anthropic without rewriting.
Cache durations from docs.openclaw.ai/providers/anthropic:
| Value | Duration | Notes |
|---|---|---|
"short" (default) |
5 minutes | Auto-applied for API-key auth |
"long" |
1 hour | Extended cache for long agent sessions |
"none" |
none | Disable caching |
Example config with long cache for the research agent:
{
agents: {
defaults: {
model: { primary: "anthropic/claude-opus-4-6" },
models: {
"anthropic/claude-opus-4-6": {
params: { cacheRetention: "long" },
},
},
},
list: [
{ id: "research", default: true },
{ id: "alerts", params: { cacheRetention: "none" } },
],
},
}
Config merge order:
agents.defaults.models["provider/model"].paramsagents.list[].params(matchingid, overrides by key)
This lets one agent on the same model keep a long-lived cache while another agent on the same model disables caching for bursty traffic.
1M context through LiteAI
Anthropic 4.x (Opus 4.8, Opus 4.7, Opus 4.6, Sonnet 4.6) supports 1M context through LiteAI. OpenClaw config:
{
agents: {
defaults: {
models: {
"anthropic/claude-opus-4-6": {},
},
},
},
}
OpenClaw recognises GA-capable models automatically, so params.context1m: true is no longer required. Old configs with context-1m-2025-08-07 beta headers are silently ignored.
anthropic/claude-opus-4-8 has 1M context by default — no extra params needed.
Troubleshooting
401 errors / token suddenly invalid
Your LiteAI key is stable while your balance is positive. Steps to check:
- Balance in @liteaitech_bot → "Check balance".
- Tariff is still active (LiteAI doesn't revoke keys but disables them at zero balance).
- LiteAI proxy didn't just roll out a major version — usually takes less than 10 minutes and clients don't notice.
No API key found for provider "anthropic"
OpenClaw keeps Anthropic auth per agent: new agents don't inherit the key from the main agent. Fix:
- Run
openclaw onboardfor that agent. - Or set the key at gateway-host level (
agents.defaults.env).
No credentials found for profile "anthropic:default"
openclaw models status shows which auth profile is active. Re-run openclaw onboard, or confirm ANTHROPIC_API_KEY is actually in the environment.
No available auth profile (all in cooldown)
LiteAI doesn't impose cooldowns — we don't rate-limit per-model. If this message appears, run openclaw models status --json and check auth.unusableProfiles. Most likely it's an OpenClaw config artifact, not LiteAI.
OpenClaw in Docker: the docs warning
From docs.openclaw.ai/install/docker#claude-cli-backend-in-docker:
- Docker can persist
~/.claudeinside the container, andclaudelogin inside works. - Podman and other containers that don't mount host
~/.claudeare not suitable for Claude CLI backend. For these, only Anthropic API key works — which is exactly the LiteAI path.
When running OpenClaw in Docker, the API-key path through LiteAI stays the most reliable option: the key and ANTHROPIC_BASE_URL are passed through env, no dependency on claude CLI inside the container.
Bottom line
OpenClaw through LiteAI is the practical path for developers outside supported Anthropic regions: one CLI over Claude Opus 4.8, Sonnet 4.6, Haiku 4.5 and Fable 5, payment in rubles in 30 seconds, no VPN, no foreign cards. The sk-bf-… key works in ANTHROPIC_BASE_URL=https://api.liteai.tech/anthropic immediately after purchase.
Want to try? Start with the 1M / 30 ₽ package on liteai.tech/pricing. That's enough for the first 20–30 requests — enough to test every model and find your config.
OpenClaw provider docs: https://docs.openclaw.ai/providers/anthropic. Our LiteAI docs: /docs.
Ready to try LiteAI?
An Anthropic API key for Claude Opus, Sonnet and Haiku — in 30 seconds, paid with USDT.