muse.ai, reverse-engineered into an OpenAI-shaped API
A Python service that drives muse.ai's web frontend via headless Chromium and re-exposes it as standard chat, image, and video endpoints.
What it does
muse2api wraps the muse.ai web app in an OpenAI-compatible REST API. It speaks /v1/chat/completions (plus the newer /v1/responses), /v1/images/generations and /v1/images/edits, and an async video task API for text-to-video and first-frame image-to-video. Under the hood it’s a headless-browser automation rig: CDP protocol, warm WebSocket tunnels, and session management keep the upstream web session alive and responsive.
The interesting bit
The engineering is mostly in the plumbing — a multi-account pool with warm-tab affinity and LRU scheduling, per-account isolation via Chromium’s Target.createBrowserContext incognito containers, automatic 48-hour session renewal, and a conflict scheduler so the same account never steps on itself. A companion Chrome extension (or Tampermonkey script) exports login cookies, including HttpOnly ones, straight into the account pool.
Key highlights
- Claims 2–3 second first-token latency on streaming chat via hot-tab and WebSocket tunnel reuse.
- Model alias mapping routes familiar names like
gpt-4o,gpt-5,claude-sonnet-4,deepseek-chatto Muse’s models. - Video generation supports 5/6/8/10-second durations (actual length depends on upstream) and 9:16 or 16:9 framing, with a built-in media endpoint for generated MP4/WebP files.
- Per-account HTTP/SOCKS5 proxies; proxy failures raise errors rather than silently falling back to direct connection.
- Dark-mode admin console with account pool status, task replay, media library, and a one-click online upgrade that preserves local config.
Caveats
- This is reverse-engineering a commercial service — expect it to break whenever muse.ai changes its frontend, and mind the terms-of-service implications of account pooling.
- Default concurrency is 2; scaling up depends on your machine running multiple Chromium contexts.
- The README notes session renewal only stores what upstream actually returns — revoked or restricted accounts still need manual re-import.
Verdict Worth a look if you want a self-hosted OpenAI-compatible gateway over muse.ai accounts and accept the fragility that comes with scraping a moving target. Skip it if you need a stable, sanctioned API — this is glue code with a shelf life.
Frequently asked
- What is czg86389-hub/muse2api?
- A Python service that drives muse.ai's web frontend via headless Chromium and re-exposes it as standard chat, image, and video endpoints.
- Is muse2api open source?
- Yes — czg86389-hub/muse2api is open source, released under the MIT license.
- What language is muse2api written in?
- czg86389-hub/muse2api is primarily written in Python.
- How popular is muse2api?
- czg86389-hub/muse2api has 1.1k stars on GitHub.
- Where can I find muse2api?
- czg86389-hub/muse2api is on GitHub at https://github.com/czg86389-hub/muse2api.