OpenClaw
OpenClaw is an open-source AI agent interface that connects to a model server to run tasks across your project. It speaks the Anthropic Messages API, which optiq serve exposes via /v1/messages.
Quick start: optiq run
One command starts optiq serve for the model (or reuses one already running on the port), configures OpenClaw for that session only, and launches it. When OpenClaw exits, a server it started is stopped. Arguments after -- go to OpenClaw.
$ optiq run openclaw -m mlx-community/Qwen3.5-9B-OptiQ-4bit -- agent --local -m "What is 2+2?"
OpenClaw runs with a per-session copy of ~/.openclaw/openclaw.json with OptiQ merged in and set as the default model. Your own file is not edited. OpenClaw 2026.9 needs Node 24 or newer.
The steps below set up the same connection by hand, for when you run optiq serve yourself. See optiq run for every option.
1. Install OpenClaw
# macOS / Linux / WSL: $ curl -fsSL https://openclaw.ai/install.sh | bash # Windows PowerShell: PS> iwr -useb https://openclaw.ai/install.ps1 | iex # or, project-local via npm: $ npm install openclaw
2. Start optiq serve
$ optiq serve \ --model mlx-community/Qwen3.5-9B-OptiQ-4bit \ --mtp --mtp-depth 2 \ --port 8080
3. Configure OpenClaw
Drop this into ~/.openclaw/openclaw.json. If you already have other providers configured, add "mode": "merge" next to "providers" so OpenClaw splices OptiQ in without replacing them:
{
"models": {
"providers": {
"optiq": {
"baseUrl": "http://localhost:8080/v1",
"apiKey": "sk-optiq-local",
"api": "anthropic-messages",
"models": [
{ "id": "qwen-9b", "name": "Qwen3.5-9B (OptiQ)" }
]
}
}
}
}
Keys are camelCase (baseUrl, apiKey), api is "anthropic-messages", and models is an array (not a dict). The id is a short alias OpenClaw uses to address the model. optiq serve ignores the request body's model field and serves whatever you started it with. Validate with openclaw config validate after saving.
Sanity-check the wire with a one-shot:
$ openclaw capability model run --local \ --model "optiq/qwen-9b" \ --prompt "What is 2+2? Just the number."
Notes
- Same endpoint as Claude Code: both tools use
/v1/messages. You can run both against the sameoptiq servesimultaneously. - Tool use: Qwen/Llama-style
<tool_call>blocks are translated to Anthropictool_useblocks; OpenClaw's agent loop works on 9B+ models. - Verified: tested against OpenClaw 2026.9.4, including
optiq runon macOS (Apple Silicon).