Connection details For your apps and API clients
Use this base URL and API key in your client. Keep the key on your server.
Models:
muse-spark for chat and code, muse-image for images, and muse-video for video.
See API docs for examples.
Accounts
0
Available
0
Issues
0
Disabled
0
Media files
0
Add accounts Bulk import supported
Paste your muse.ai cookie string. Required cookies include
hatch_sess, hatch_gw, and hatch_vml.
For bulk import, enter one account per line as label | cookie string. The label is optional.
Account list 0
β Automatic keepaliveBackground keepalive checks sessions periodically. Accounts are rotated by recent usage. Test opens muse.ai to verify a session.
| Label | Account ID | Status | Expires | Quota | Enabled | Cookies | Last used | Notes | Actions |
|---|---|---|---|---|---|---|---|---|---|
| Loading⦠| |||||||||
Method 1: Browser extension Recommended
The extension imports the muse.ai session from the browser where you are already logged in.
No Python or terminal is needed.
The required cookies are
The required cookies are
HttpOnly, so page scripts such as document.cookie cannot read them. The extension uses the browser cookies API.
1
Download and unzip the extension
Unzip it to a folder you will keep, such as
β¬ Download muse2api-extension.zip
D:\muse2api-extension.
2
Load the extension
In Chrome, Edge, or another Chromium-based browser:
- Enter
chrome://extensionsin the address bar and press Enter - Turn on Developer mode
- Click Load unpacked
- Select the folder extracted in step 1
3
Log in to muse.ai, and then click the extension icon to import
Open
https://muse.ai/ in this browser and log in until you see the chat screen.
Click the extension icon, enter the values below, and choose "Read cookies and import".
Method 2: Copy cookies manually No extension
You can copy the cookie string from a request header in your browser's Network panel.
Use the
cookie: request header because it includes HttpOnly cookies that the Console cannot read.
- Log in at
https://muse.ai/and open the chat screen - Press F12 and open the Network panel
- Press F5 to refresh the page
- Select a request to muse.ai
- Open Headers and scroll to Request Headers
- Copy the full value after
cookie: - Paste it into Method 3 below and click Import
Use the
cookie: request header. The set-cookie response header may contain only some cookies.
Method 3: Paste cookies or use the local script Advanced
Paste the cookie string here, including a string copied with Method 2.
The helper script opens a separate browser session and imports its cookies.
It uses only the Python standard library; no pip packages are required.
CopyGenerating command...
β’ Log in to muse.ai in the browser window. The script imports the cookies and closes the window.
Cookie expiration Observed values
Cookie lifetimes may vary by account:
| Cookie | HttpOnly | Approximate lifetime | Purpose |
|---|---|---|---|
| hatch_sess | Yes | About 30 days | Main session, determines whether you can log in |
| hatch_gw | Yes | About 1 year | Gateway token |
| hatch_vml | Yes | About 2 days | Short-lived session token |
| hatch_native_auth_device | Yes | About 30 days | Device identification (anonymous visitors also have, not login credentials) |
The account expires when a required cookie expires. The short-lived
Background keepalive may renew the session when muse.ai accepts the request. A displayed expiration is based on the cookies or an estimate; it does not prove the server session is valid.
Use Test to check an account. Reimport its cookies if authentication fails or required cookies are missing.
hatch_vml token often lasts about two days.Background keepalive may renew the session when muse.ai accepts the request. A displayed expiration is based on the cookies or an estimate; it does not prove the server session is valid.
Use Test to check an account. Reimport its cookies if authentication fails or required cookies are missing.
Generation tasks 0
Video tasks progress from queued to processing, then succeeded or failed.
| Task ID | Type | Prompt | Status | Duration | Created | Result / error | |
|---|---|---|---|---|---|---|---|
| Loading⦠| |||||||
Media Library 0
Generated images and videos stored on this server. Download them or use their links in your apps.
Loadingβ¦
Online image generation test POST /v1/images/generations
This sends a real request to muse.ai. Image generation can take several minutes.
Online video generation test POST /v1/videos
Video generation runs as a task. This page polls for progress.
API integration
OpenAI-compatible clients can use this service by setting
Base URL:
base_url and api_key.
Base URL:
β
1. Available models
| Model ID | Purpose | Interface |
|---|---|---|
| muse-spark | Text/code conversation (supports streaming) | POST /v1/chat/completions POST /v1/responses |
| muse-image | Image generation and editing | POST /v1/images/generations |
| muse-video | Text-to-video and image-to-video | POST /v1/videos β GET /v1/videos/{id} |
These model IDs represent chat, image, and video capabilities. The muse.ai web interface routes requests automatically; it does not offer a model selector.
Common aliases such as
gpt-4o, claude-sonnet-4, and dall-e-3 are mapped to the corresponding capability for client compatibility.
2. Chat and code
Copy# Non-streaming curl -X POST "BASE/v1/chat/completions" \ -H "Authorization: Bearer $MUSE2API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"muse-spark","messages":[{"role":"user","content":"Write a Python quicksort function"}]}' # For streaming, add "stream":true. The response uses SSE.
3. Generate an image (curl)
Copycurl -X POST "BASE/v1/images/generations" \ -H "Authorization: Bearer $MUSE2API_KEY" \ -H "Content-Type: application/json" \ -d '{"prompt":"A Shiba Inu wearing an astronautical helmet","size":"1:1","response_format":"url"}' # Return {"created":1790148495,"data":[{ "revised_prompt":"A Shiba Inu wearing an astronautical helmet", "url":"http://your-server:18610/v1/media/xxxx.webp", "kind":"image","bytes":23860}]} # The media URL can be rendered or downloaded directly. /v1/media/* does not require authentication. # If you want base64, pass "response_format":"b64_json".
4. Generate video (curl, asynchronous)
Copy# β Create task curl -X POST "BASE/v1/videos" \ -H "Authorization: Bearer $MUSE2API_KEY" \ -H "Content-Type: application/json" \ -d '{"prompt":"A kitten walking on the grass","duration":5,"size":"16:9"}' # β {"id":"task_xxx","status":"queued"} # β‘ Polling results curl "BASE/v1/videos/task_xxx" -H "Authorization: Bearer $MUSE2API_KEY" # β {"status":"succeeded","result":{"url":"/v1/media/xxx.mp4"}}
5. Python (OpenAI SDK compatible)
Copyfrom openai import OpenAI import time client = OpenAI(base_url="BASE/v1", api_key="m2a_...") # Generate an image r = client.images.generate(model="muse-image", prompt="A Shiba Inu wearing an astronautical helmet") print(r.data[0].url) # Generate a video (asynchronous task) import requests t = requests.post("BASE/v1/videos", json={"prompt":"Kitten walking","duration":5}, headers={"Authorization":"Bearer m2a_..."}).json() while True: s = requests.get(f"BASE/v1/videos/{t['id']}", headers={"Authorization":"Bearer m2a_..."}).json() if s["status"] in ("succeeded","failed"): break time.sleep(5) print(s)
6. Admin endpoints
| Method | Path | Description |
|---|---|---|
| GET | /admin/status | Service overview + account pool + recent tasks |
| GET | /admin/accounts | Account list |
| POST | /admin/accounts | Add one or more accounts |
| PATCH | /admin/accounts/{id} | Change label/enable/disable |
| DELETE | /admin/accounts/{id} | Delete account |
| POST | /admin/accounts/{id}/test | Verify session and refresh quota |
| POST | /admin/accounts/{id}/quota | Read the remaining balance of the account in real time |
| POST | /admin/accounts/{id}/cookies | Update the account cookie |
| GET | /admin/tasks | Task Record |
| GET | /admin/media | Media library list |
| POST | /admin/media/delete | Delete media files in batches |
7. Authentication
All endpoints except
/healthz, /readyz, and /v1/media/* require
Authorization: Bearer <API Key>. Set the key with MUSE2API_KEY in .env.
8. Connect an API client
Enter these values in a client that supports a custom OpenAI-compatible endpoint:
| Configuration item | What to fill in |
|---|---|
| Base URL / API address | http://<your-server-IP-or-domain>:18610/v1 |
| API key | m2a_... (shown in Connection details) |
| Model name | muse-spark |
Common model aliases such as
gpt-4o, gpt-5, claude-sonnet-4,
deepseek-chat, and gemini-2.5-pro map to Muse capabilities. Use muse-spark for chat unless your client requires an alias.
Client compatibility
| Client type | Dependency capability | Status |
|---|---|---|
| Dialog/Chat type (desktop, Web UI, browser plug-in) | POST /v1/chat/completions | β Available |
| Streaming output (typewriter effect) | stream:true (standard SSE) | β Available |
| Code completion / inline completion plug-in | POST /v1/chat/completions | β Available |
| Translation / summary / explanation tools | POST /v1/chat/completions | β Available |
| Drawing client | POST /v1/images/generations | β Available |
| Video generation client | POST /v1/videos (asynchronous polling) | β Available |
| Autonomous Agent mode that requires "tool call" | tool_calls / function calling | β οΈ Not available |
Tool calling is not supported. The muse.ai web assistant does not return structured
tool_calls.
Autonomous agents that require tool execution will not work reliably. If a client sends a tools field, this service accepts the request but handles it as an ordinary chat response.