Integration
Muse Openclaw
Use Meta Muse Spark models in OpenClaw via Muse Code's OAuth login — no API key, no plugin
Install
openclaw plugins install @openclaw/acpx
Configuration Example
{
"providers": {
"meta": {
"api_base_url": "https://api.meta.ai/v1",
"api_key": "LLM|<id>|<secret>",
"access_token": "dca:...",
"mechanism": "oauth",
"obtained_via": "device_code"
}
}
}
README
# Muse Spark in OpenClaw — via OAuth, no API key
Use Meta's **Muse Spark** models inside [OpenClaw](https://openclaw.ai) authenticated by
**Muse Code's browser login**, instead of pasting a Meta Model API key.
No plugin required. No patched build. Just provider config.
## Why this exists
Meta ships two separate things with **different auth**:
| | auth | what it is |
| --- | --- | --- |
| **Muse Spark** (the model) | API key — `Bearer $MODEL_API_KEY` | what you'd select as a model |
| **Muse Code** (the CLI agent) | `muse login` — browser OAuth | a coding agent |
The documented way to get Muse Spark into a client is an API key. But **`muse login` already
mints a working Model API credential** and writes it to disk. This repo uses that.
## The discovery
After `muse login`, `~/.config/muse/auth.json` contains:
```json
{
"providers": {
"meta": {
"api_base_url": "https://api.meta.ai/v1",
"api_key": "LLM|<id>|<secret>",
"access_token": "dca:...",
"mechanism": "oauth",
"obtained_via": "device_code"
}
}
}
```
Two findings worth knowing:
* **`api_key` works** as a bearer token against `https://api.meta.ai/v1/chat/completions` → `200`.
* **`access_token` does not** — it returns `401 invalid_api_key`. Use `api_key`.
The endpoint is OpenAI-compatible, so **no provider plugin is needed** — a plain
`models.providers.*` entry is enough.
## Setup
```sh
curl -fsSL https://dev.meta.ai/install.sh | bash # installs Muse Code
muse login # browser OAuth
./scripts/setup-muse-openclaw.sh # wire it into OpenClaw
```
The script reads the key from *your* `auth.json`, stores it **write-only** in OpenClaw's
secret store, and references it from config. The key is never written to `openclaw.json`
in plaintext and is never printed.
## The config it writes
```json5
{
models: {
providers: {
muse: {
baseUrl: "https://api.meta.ai/v1",
api: "openai-completions", // REQUIRED — see gotchas
apiKey: { source: "store", provider: "default", id: "META_MODEL_API_KEY" },
models: [
{ name: "Muse Spark 1.3", id: "muse-spark-1.3",
reasoning: true, maxTokens: 32000, contextWindow: 1048576 },
],
},
},
},
}
```
Models must also be approved in `agents.defaults.modelPolicy.allow` as
`muse/muse-spark-1.3`. Registering a provider is **not** enough on its own — the
allow-list is a separate gate, and the script handles it.
## Gotchas
**`api: "openai-completions"` is mandatory.** Without it the HTTP calls still succeed, but
every agent's `models.json` fails to load with:
```
Provider muse, model muse-spark-1.3: no "api" specified. Set at provider or model level.
```
Because the fetch works, this only surfaces as a quiet catalog error. It cost us hours.
**`models.probe` reports failure — ignore it for this provider.** Muse Spark is a heavy
reasoner: in one 299-token completion, 282 were reasoning tokens. The probe's small token
budget returns `content: null` and OpenClaw logs `empty response retries exhausted`. HTTP is
`200`. Judge the provider by `models.list` showing `available: true` and by a real turn.
**Give it room.** With `max_tokens: 32` you get `finish_reason: "length"` and empty content
before it emits anything visible. Use a real budget.
**Contributor tier trains on your data.** `muse-spark-1.3-contributor` is ~10× cheaper
($0.10/$0.20 vs $1.25/$4.25 per M tokens) because Meta may use your content for product
improvement. Muse Code defaults to it. Choose deliberately; the non-contributor id is
`muse-spark-1.3`.
**The official plugin is a dead end (for us).** `@openclaw/meta-provider` installs as id
`meta` and reports trusted-official, but never appeared in our gateway's loaded plugin list
— not `plugins.allow`, not enablement, not trust. Suspected version skew. The plain provider
above sidesteps it entirely.
## Bonus: Muse Code as an ACP harness
Separately, Muse Code can run *as an agent* inside OpenClaw through ACP, also on the OAuth
login:
```sh
npm i -g @bex-co/muse-code-acp
openclaw plugins install @openclaw/acpx
openclaw config set plugins.entries.acpx.config.agents.muse '{"command":"muse-code-acp"}' --strict-json
# add "muse" to acp.allowedAgents, then: /acp spawn muse
```
Note this is a **harness**, not a model — it will not appear in the model picker. acpx's
native-agent discovery only surfaces its built-in harness ids, not custom aliases.
## Verified against
OpenClaw `2026.9.5` · Muse Code `1.3.0` · `@bex-co/muse-code-acp` `0.6.1` · Raspberry Pi 5 (arm64).
## Credits
[`muse-code-acp`](https://github.com/bex-co/muse-code-acp) by bex-co (unofficial ACP adapter).
Muse Code and Muse Spark are products of Meta Platforms, Inc. This project is not affiliated
with, endorsed by, or supported by Meta or OpenClaw.
## License
MIT
integration
Comments
Sign in to leave a comment