Purpose: AI music generation for iOS/web app research using Google's MagentaRT.
POST /generate – Generate 4–8 bars of music (HTTP, bar-aligned)POST /jam/start – Start continuous jamming (HTTP)GET /jam/next – Get next chunk (HTTP)POST /jam/consume – Confirm a chunk as consumed (HTTP)POST /jam/stop – End session (HTTP)WEBSOCKET /ws/jam – Realtime streaming (mode="rt")GET /docs – API documentation (Gradio)Connect to wss://<your-space>/ws/jam and send:
{
"type": "start",
"mode": "rt",
"binary_audio": false,
"params": {
"styles": "warmup",
"temperature": 1.1,
"topk": 40,
"guidance_weight": 1.1,
"pace": "realtime", // or "asap" to bootstrap quickly
"max_decode_frames": 50 // default ~2.0s; try 36–45 on smaller GPUs
}
}
Update parameters live:
{
"type": "update",
"styles": "jazz, hiphop",
"style_weights": "1.0,0.8",
"temperature": 1.2,
"topk": 64,
"guidance_weight": 1.0,
"pace": "realtime",
"max_decode_frames": 40
}
Stop:
{"type":"stop"}
pace: "realtime".Licensing: Uses MagentaRT (Apache 2.0 + CC-BY 4.0). Users are responsible for outputs.
See /docs for full API details and client examples.