Caricamento in corso...
Caricamento in corso...
Last synced: Today, 22:00
Technical reference for the OpenClaw framework. Real-time synchronization with the official documentation engine.
Use this file to discover all available pages before exploring further.
The
music_generateFor session-backed agent runs, OpenClaw starts music generation as a background task, tracks it in the task ledger, then wakes the agent again when the track is ready so the agent can post the finished audio back into the original channel.
text<Step title="Pick a default model (optional)"> ```json5} { agents: { defaults: { musicGenerationModel: { primary: "google/lyria-3-clip-preview", }, }, }, } ``` </Step> <Step title="Ask the agent"> *"Generate an upbeat synthpop track about a night drive through a neon city."* The agent calls `music_generate` automatically. No tool allow-listing needed. </Step> </Steps> For direct synchronous contexts without a session-backed agent run, the built-in tool still falls back to inline generation and returns the final media path in the tool result.
text<Step title="Cloud auth (optional)"> For Comfy Cloud, set `COMFY_API_KEY` or `COMFY_CLOUD_API_KEY`. </Step> <Step title="Call the tool"> ```text} /tool music_generate prompt="Warm ambient synth loop with soft tape texture" ``` </Step> </Steps>
Example prompts:
textGenerate a cinematic piano track with soft strings and no vocals.
textGenerate an energetic chiptune loop about launching a rocket at sunrise.
| Provider | Default model | Reference inputs | Supported controls | Auth |
|---|---|---|---|---|
| ComfyUI | text workflow | Up to 1 image | Workflow-defined music or audio | text COMFY_API_KEYtext COMFY_CLOUD_API_KEY |
text lyria-3-clip-preview | Up to 10 images | text lyricstext instrumentaltext format | text GEMINI_API_KEYtext GOOGLE_API_KEY | |
| MiniMax | text music-2.6 | None | text lyricstext instrumentaltext durationSecondstext format=mp3 | text MINIMAX_API_KEY |
The explicit mode contract used by
music_generate| Provider | text generate | text edit | Edit limit | Shared live lanes |
|---|---|---|---|---|
| ComfyUI | ✓ | ✓ | 1 image | Not in the shared sweep; covered by text extensions/comfy/comfy.live.test.ts |
| ✓ | ✓ | 10 images | text generatetext edit | |
| MiniMax | ✓ | — | None | text generate |
Use
action: "list"text/tool music_generate action=list
Use
action: "status"text/tool music_generate action=status
Direct generation example:
text/tool music_generate prompt="Dreamy lo-fi hip hop with vinyl texture and gentle rain" instrumental=true
Session-backed music generation runs as a background task:
music_generatequeuedrunningmusic_generateaction: "status"openclaw tasks listopenclaw tasks show <taskId>music_generate| State | Meaning |
|---|---|
text queued | Task created, waiting for the provider to accept it. |
text running | Provider is processing (typically 30 seconds to 3 minutes depending on provider and duration). |
text succeeded | Track ready; the agent wakes and posts it to the conversation. |
text failed | Provider error or timeout; the agent wakes with error details. |
Check status from the CLI:
bashopenclaw tasks list openclaw tasks show <taskId> openclaw tasks cancel <taskId>
json5{ agents: { defaults: { musicGenerationModel: { primary: "google/lyria-3-clip-preview", fallbacks: ["minimax/music-2.6"], }, }, }, }
OpenClaw tries providers in this order:
modelmusicGenerationModel.primarymusicGenerationModel.fallbacksIf a provider fails, the next candidate is tried automatically. If all fail, the error includes details from each attempt.
Set
agents.defaults.mediaGenerationAutoProviderFallback: falsemodelprimaryfallbacksIf you are debugging ComfyUI-specific behavior, see ComfyUI. If you are debugging shared provider behavior, start with Google (Gemini) or MiniMax.
The shared music-generation contract supports explicit mode declarations:
generateeditNew provider implementations should prefer explicit mode blocks:
typescriptcapabilities: { generate: { maxTracks: 1, supportsLyrics: true, supportsFormat: true, }, edit: { enabled: true, maxTracks: 1, maxInputImages: 1, supportsFormat: true, }, }
Legacy flat fields such as
maxInputImagessupportsLyricssupportsFormatgenerateeditmusic_generateOpt-in live coverage for the shared bundled providers:
bashOPENCLAW_LIVE_TEST=1 pnpm test:live -- extensions/music-generation-providers.live.test.ts
Repo wrapper:
bashpnpm test:live:media music
This live file loads missing provider env vars from
~/.profilegenerateeditgooglegenerateeditminimaxgeneratecomfyOpt-in live coverage for the bundled ComfyUI music path:
bashOPENCLAW_LIVE_TEST=1 COMFY_LIVE_TEST=1 pnpm test:live -- extensions/comfy/comfy.live.test.ts
The Comfy live file also covers comfy image and video workflows when those sections are configured.
music_generatemusicGenerationModel© 2024 TaskFlow Mirror
Powered by TaskFlow Sync Engine