№ 0277GitHub
muse-openrouter-shim
A local shim that lets the unmodified muse coding CLI run on any OpenRouter API key by translating its Responses-API-plus-extension wire protocol, so no Meta account is needed.
# muse-openrouter-shim Run Meta's `muse` coding CLI on any OpenRouter API key. No Meta account, no Meta Model API key, any model you want. ``` muse (unmodified) ──> local shim (port 8399) ──> openrouter.ai/api/v1/responses ``` ## Why Muse Code ships with a single compiled provider that talks to `api.meta.ai` and only accepts a Meta Model API key. The multi-provider code (OpenRouter, OpenAI, Anthropic) exists in the binary but is feature-gated out of the public build. It turns out the wire protocol is just the OpenAI Responses API plus one proprietary endpoint, `GET /muse-code/models`, that muse needs at startup. So a ~180 line local proxy is enough: - serves a synthetic model catalog at `/muse-code/models` - streams `POST /responses` through to OpenRouter untouched (auth passes through, muse never knows) - maps muse's extended reasoning efforts (`xhigh`, `ultra`) down to `high` - swallows telemetry so nothing else phones home The catalog wire format was recovered by pointing `--base-url` at a local listener and iterating on the binary's serde decode errors until the schema parsed. Full field layout is documented in `shim.py`. ## Setup Requires Python 3 (stdlib only, no pip installs) and an installed `muse` (`curl -fsSL https://dev.meta.ai/install.sh | bash`). ```bash git clone https://github.com/joymadhu49/muse-openrouter-shim cd muse-openrouter-shim cp .env.example .env # paste your OpenRouter key into .env ``` ## Use ```bash ./muse-or # interactive TUI ./muse-or exec "fix the failing test" ./muse-or --model x-ai/grok-4.3 ``` `muse-or` starts the shim automatically if it is not already running, injects the base URL and model, and hands your OpenRouter key to muse as `META_API_KEY` so the shim can pass it through as the Bearer token. Set a default model with `MUSE_OR_MODEL` in `.env`. ## Model compatibility Verified working end to end, including tool calls: | Model | Status | |---|---| | meta/muse-spark-1.2 | works (Meta's own model, via OpenRouter billing) | | openai/gpt-5.1 | works (default) | | x-ai/grok-4.3 | works | | google/gemini-2.5-pro | works | | deepseek/deepseek-v3.2 | works | | qwen/qwen3-coder | works | | anthropic/* | blocked: the provider returns a Terms of Service 403 for this scaffold | | moonshotai/kimi-k2 | fails: 131k context is smaller than muse's startup prompt | Anything on openrouter.ai/models with a



ChatForm
Tgmlabs