Skip to content
RU

OpenClaw

Connect OpenClaw to Mixen — pay from your balance in roubles, an agent daemon with 100+ catalog models over our Anthropic-compatible protocol.

OpenClaw is an open-source (MIT) agent that lives on your machine as a daemon: it works on your project through a local gateway, reports to Telegram, Discord, or Slack, and is driven by the openclaw CLI and a web dashboard. Models come from hosted and local providers — Mixen plugs in as a custom one.

Terminal window
# macOS / Linux / WSL2
curl -fsSL https://openclaw.ai/install.sh | bash
# Windows (PowerShell)
iwr -useb https://openclaw.ai/install.ps1 | iex

Or via npm (Node 22.22.3+, 24.15+, or 25.9+ required):

Terminal window
npm install -g openclaw@latest --allow-scripts=openclaw

Initial launch with the daemon:

Terminal window
openclaw onboard --install-daemon

The main config is ~/.openclaw/openclaw.json (the default path; override it with OPENCLAW_CONFIG_PATH). Add the Mixen provider:

{
models: {
mode: "merge",
providers: {
mixen: {
baseUrl: "https://api.mixen.ai",
apiKey: "${MIXEN_API_KEY}",
api: "anthropic-messages",
models: [
{ id: "anthropic/claude-sonnet-5", name: "Claude Sonnet 5", reasoning: true },
{ id: "z-ai/glm-5.3-flash", name: "GLM 5.3 Flash", reasoning: true },
{ id: "z-ai/glm-5.3", name: "GLM 5.3", reasoning: true }
]
}
}
},
agents: {
defaults: { model: { primary: "mixen/anthropic/claude-sonnet-5" } }
}
}

Key points:

  • api: "anthropic-messages" — the Anthropic Messages protocol. The base URL carries no /v1: the client appends the request path itself. The alternative is "openai-completions" with baseUrl: "https://api.mixen.ai/v1", but the Anthropic-protocol variant gets you prompt caching out of the box. If api is omitted entirely, a provider with a baseUrl is treated as openai-completions — so set the field explicitly.
  • models[] — the models the agent will see; id is the Mixen ID, sent to the API as is. Optional entry fields: reasoning (default false), input (default ["text"]; add "image" for vision models), maxTokens (default 8192), contextWindow.
  • agents.defaults.model.primary — the default model, in the <provider>/<model id> format; slashes inside a Mixen ID are fine.
  • ${MIXEN_API_KEY} — environment variable substitution, so the key doesn’t sit in the config. OpenClaw resolves variables in this order: process environment → ./.env~/.openclaw/.env → the env block of openclaw.json.
  • mode: "merge" — adds the provider without wiping the built-in catalog.

The mxn-… key is issued in the dashboard and goes into ~/.openclaw/.env:

Terminal window
MIXEN_API_KEY="your-api-key"
Terminal window
openclaw # terminal session with the agent
openclaw gateway status # daemon status
openclaw dashboard # web dashboard

Configuration helpers: openclaw configure and openclaw models auth login.

The key and balance are checked with a minimal generating request:

curl https://api.mixen.ai/v1/chat/completions \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{"model":"z-ai/glm-5.3-flash","messages":[{"role":"user","content":"ping"}],"max_tokens":5}'

200 — the key and balance work; 401 — the key was copied incompletely or it is not a Mixen API key; 402 — the balance is empty. GET /v1/models does not check the key — it answers without one.

The agent resends its whole accumulated context on every turn — input price drives the bill. Prices are per 1M tokens, input/output; full tables with cache columns — in the catalog.

Task Model Input / output
Routine: doc research, simple questions, drafts GLM 5.3 Flash (z-ai/glm-5.3-flash) 8.4 / 27.9 ₽
Long tasks in familiar context GLM 5.3 (z-ai/glm-5.3) 156 / 490.2 ₽
Complex multi-step tasks Claude Sonnet 5 (anthropic/claude-sonnet-5) 213.9 / 1069.5 ₽

A daemon with a long history is a perfect prompt-cache client: the system prompt, rules, and read files repeat turn after turn.

  • Repeated context within 5 minutes is billed at ~10% of the input price (21.4 ₽ per 1M for claude-sonnet-5 instead of 213.9 ₽, 1.7 ₽ for glm-5.3-flash), and every hit extends the window by another 5 minutes.
  • A pause longer than 5 minutes (say, the daemon idling overnight) resets the cache — the first turn pays the full input price, then the discount builds up again.
  • Don’t change rules or the system prompt in the middle of an active task — that resets the cache.
  • The limit is 60 RPM per key.
  • 401 / Invalid API Key — the process doesn’t see the key: check ~/.openclaw/.env and the variable resolution order (the process environment wins over files).
  • Mixen models are missing from the list — a custom provider’s picker shows only what its models[] lists; add an entry with the needed id.
  • Requests go to another provider — check agents.defaults.model.primary: the prefix must be mixen/….
  • Slow endpoint / timeouts — a provider supports timeoutSeconds in models.providers.<id>.