№ 0483GitHub
muse-openrouter gateway
A localhost compatibility gateway that lets the native Muse Code harness run on OpenRouter's muse-spark-1.2-contributor, rewriting only the model name and never falling back silently to another model.
muse-openrouter
A transparent compatibility gateway that lets the native Muse Code harness use OpenRouter Contributor without changing Muse semantics.
Muse Code
→ localhost compatibility gateway (127.0.0.1:9911)
→ OpenRouter
→ meta/muse-spark-1.2-contributor
Muse continues to think it talks to:
- provider:
meta - model:
muse-spark-1.2 - profile:
tbh
Only the top-level model name is rewritten for the upstream transport to meta/muse-spark-1.2-contributor. No silent fallback to meta/muse-spark-1.2 or any other model.
Requirements
- Node.js
>=24 - Muse Code installed separately (
muse --versionshould show0.2.1) - OpenRouter account and API key (
sk-or-v1-...)
Install
npm install -g muse-openrouter
Verify:
muse-or --help
muse-or-proxy --help
muse-or doctor
The original muse binary is never replaced.
Setup
Run once:
muse-or setup
This will:
- find the real
musebinary in yourPATH - show the detected Muse version
- ask for your OpenRouter API key (input hidden)
- save it securely to
~/.config/muse-openrouter/config.jsonwith0600permissions - prepare an isolated Muse config at
~/.config/muse-openrouter/xdg/muse/settings.json - verify the setup
Setup is idempotent. Re-running it keeps existing settings unless you pass --force.
If you prefer env-based automation, OPENROUTER_API_KEY can override the stored key at runtime, but normal use is the persisted config.
Usage
Terminal 1 – gateway (foreground, Ctrl+C to stop):
muse-or-proxy
Startup summary:
Muse OpenRouter Gateway
Listen 127.0.0.1:9911
Upstream OpenRouter
Model meta/muse-spark-1.2-contributor
Bridge namespace
Normalizer schema-aware
Status ready
Health: http://127.0.0.1:9911/health
Terminal 2 – Muse:
cd ~/your-project
muse-or --reasoning-effort xhigh
muse-or resume SESSION_ID
All native Muse arguments are forwarded unchanged, including --reasoning-effort. The reasoning request object is passed through untouched.
If the gateway is not running, muse-or fails fast:
gateway is not running on 127.0.0.1:9911
run: muse-or-proxy
No automatic fallback to direct Meta and no background daemon.
How it works
Muse Code 0.2.1 sends tools as a Responses type: "namespace" container (muse with nested read_file, bash,





