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.
Installation
Section titled “Installation”# macOS / Linux / WSL2curl -fsSL https://openclaw.ai/install.sh | bash
# Windows (PowerShell)iwr -useb https://openclaw.ai/install.ps1 | iexOr via npm (Node 22.22.3+, 24.15+, or 25.9+ required):
npm install -g openclaw@latest --allow-scripts=openclawInitial launch with the daemon:
openclaw onboard --install-daemonConfiguration
Section titled “Configuration”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"withbaseUrl: "https://api.mixen.ai/v1", but the Anthropic-protocol variant gets you prompt caching out of the box. Ifapiis omitted entirely, a provider with abaseUrlis treated asopenai-completions— so set the field explicitly.models[]— the models the agent will see;idis the Mixen ID, sent to the API as is. Optional entry fields:reasoning(defaultfalse),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→ theenvblock ofopenclaw.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:
MIXEN_API_KEY="your-api-key"Running and managing
Section titled “Running and managing”openclaw # terminal session with the agentopenclaw gateway status # daemon statusopenclaw dashboard # web dashboardConfiguration helpers: openclaw configure and openclaw models auth login.
Verifying the connection
Section titled “Verifying the connection”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.
Picking a model per task
Section titled “Picking a model per task”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 ₽ |
Cache and savings for agent sessions
Section titled “Cache and savings for agent sessions”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.
Troubleshooting
Section titled “Troubleshooting”- 401 / Invalid API Key — the process doesn’t see the key: check
~/.openclaw/.envand 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 neededid. - Requests go to another provider — check
agents.defaults.model.primary: the prefix must bemixen/…. - Slow endpoint / timeouts — a provider supports
timeoutSecondsinmodels.providers.<id>.