Autonomous agents are a different cost shape than chatbots. A chat session is a few model calls per conversation. An agent doing real work — checking flights, summarizing inboxes, scraping a site, filling forms — fires off dozens or hundreds of calls per task. Multiply that by a few users on your machine, or by the agent's "ambient" background tasks, and you'll watch a Claude or GPT subscription chew through credits faster than expected.
The good news: OpenClaw's model gateway supports custom OpenAI-compatible providers. Setting MicroDC.ai as the backend takes about five minutes and a single config block. The agent doesn't notice the swap; the bill does.
Why this combo works.
OpenClaw's gateway routes model requests to whichever provider is configured for the chosen model name. It already supports OpenAI's hosted API, Anthropic's Claude, and any custom OpenAI-compatible endpoint — exactly the shape MicroDC.ai exposes at https://api.microdc.ai/v1. The result:
- No fork, no patch. You're not modifying OpenClaw. You're using its built-in custom-provider mechanism.
- Open-weight models. Llama 3.x, Qwen 2.5, Mistral, DeepSeek, Phi, Gemma — pick any from the MicroDC.ai catalog. Many handle agentic tool-call patterns well.
- Async batch under the hood. OpenClaw's request comes back synchronously, but it runs through MicroDC.ai's distributed queue — see why that matters for cost.
- Local agent, distributed compute. Your data stays on your machine for everything that doesn't need a model. Only the prompt content actually sent to a model leaves — and end-to-end-encrypted jobs are an option if even that needs to stay opaque.
Step 1: install OpenClaw.
If you haven't already, install the latest OpenClaw via npm and onboard the daemon:
npm install -g openclaw@latest
openclaw onboard --install-daemon
The dashboard comes up at http://127.0.0.1:18789/. Walk through the onboarding wizard if it's your first install — it'll ask you for one model provider to start with. You can set MicroDC.ai as that provider directly, or finish onboarding with whatever you have and add MicroDC.ai as a second provider afterward.
Step 2: get a MicroDC.ai API key.
Create a free account at console.microdc.ai — takes about a minute, no credit card. Generate an API key from the dashboard. New accounts get welcome credits, so you can run real OpenClaw workloads through the integration before adding any funds.
Pick a model from the catalog. For an agent that needs to follow tool-call instructions reliably, qwen3:32b is our recommended default — modern, mid-sized, and reliable on the OpenAI tool-call format. llama3:70b is the heavier alternative if you want more reasoning headroom. For lighter background tasks where speed matters more than depth, drop to gpt-oss:20b or phi4:latest — meaningfully cheaper per call. The catalog uses Ollama-style name:tag identifiers; copy them verbatim.
Step 3: register MicroDC.ai as a custom provider.
OpenClaw's config lives at ~/.openclaw/openclaw.json. You can edit it directly or use the openclaw config set CLI. Either way, the provider entry looks like this (matching OpenClaw's documented custom-provider shape):
{
"models": {
"mode": "merge",
"providers": {
"microdc": {
"baseUrl": "https://api.microdc.ai/v1",
"apiKey": "mDC_your_api_key_here",
"api": "openai-completions",
"models": [
{
"id": "qwen3:32b",
"name": "Qwen 3 32B (MicroDC.ai)",
"reasoning": false,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 32000,
"contextTokens": 24000,
"maxTokens": 8000
},
{
"id": "gpt-oss:20b",
"name": "GPT-OSS 20B (MicroDC.ai)",
"reasoning": false,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 32000,
"contextTokens": 24000,
"maxTokens": 4000
}
]
}
}
}
}
Or via the CLI in one line (escape the JSON to taste in your shell):
openclaw config set models.providers.microdc \
'{ "baseUrl":"https://api.microdc.ai/v1", "apiKey":"mDC_your_key", "api":"openai-completions", "models":[ {"id":"qwen3:32b","name":"Qwen 3 32B","input":["text"],"contextWindow":32000,"contextTokens":24000,"maxTokens":8000} ] }' \
--strict-json --merge
The --merge flag preserves existing providers — so any Claude / GPT entries you already had remain untouched. Now you can route specific agents to specific providers based on cost, latency, or quality needs.
Step 4: point your default agent at the new provider.
OpenClaw addresses models as provider/model-id. To make MicroDC.ai the default for a given agent:
{
"agents": {
"defaults": {
"model": {
"primary": "microdc/qwen3:32b",
"fallbacks": ["microdc/gpt-oss:20b"]
},
"models": {
"microdc/qwen3:32b": { "alias": "MicroDC.ai Qwen 3" }
}
}
}
}
The fallback chain is useful: primary task on the 32B Qwen, drop to the smaller GPT-OSS if the primary is congested. Both calls bill at MicroDC.ai rates — fractional cost either way.
What to expect.
A few honest notes from running this combo in practice:
- Latency. OpenClaw will see roughly the same response shape as a hosted OpenAI call — a few hundred ms of overhead vs a real-time provider, often invisible to the agent. For interactive UI bound workflows where every millisecond matters, you'd want a real-time provider; for typical agent task loops the queue overhead is in the noise.
- Tool-call format. Most modern open-weight chat models handle the OpenAI tool-call shape correctly via their chat template. Llama 3.x and Qwen 2.5 are reliable. If you hit a model that doesn't, switch to one that does — the catalog is large.
- Cost telemetry. OpenClaw's gateway tracks per-call cost using the
costblock in the provider config. The example above zeros these out (we recommend setting them to your actual MicroDC.ai per-token rates so OpenClaw's spend dashboard reflects reality — pull current rates from the pricing page). - Context window. Set
contextWindowandmaxTokensbased on the model's actual limits, not OpenClaw's defaults. Llama 3.x is 128K context; smaller models vary.
The pitch.
OpenClaw on a premium API works, but it's a luxury for serious agent use. Every autonomous step is a metered call, and "the AI that actually does things" can do quite a few things in a day. Routing through MicroDC.ai swaps the most expensive part of the stack for a fractional-cost equivalent without changing the agent itself, your data flow, or the local feel of the product.
Combine this with a model you trust on tool calls, set a sensible fallback chain, and you have a personal AI assistant whose monthly cost looks more like a hosting bill than an enterprise SaaS line item.