Loading...
Loading...
Generate music using Volcengine Imagination API. Supports vocal songs, instrumental BGM, and lyrics generation. Use when the user wants to create songs, background music, soundtracks, write lyrics, or mentions "music generation", "BGM", or "songwriting".
npx skill4agent add bytedance/agentkit-samples byted-music-generateVOLCENGINE_ACCESS_KEYVOLCENGINE_SECRET_KEYsongbgmlyricscdskills/byted-music-generateaudio_urllyrics# With text prompt
python scripts/music_generate.py song --prompt "A song about summer at the beach" --genre Pop --gender Female
# With lyrics
python scripts/music_generate.py song --lyrics "[verse]\nMoonlight on the windowsill\nMemories flowing like water\n[chorus]\nYou are my moonlight" --genre Folk --mood "Sentimental/Melancholic/Lonely"--lyrics--promptlyricssong--textpython scripts/music_generate.py bgm --text "Relaxed coffee shop ambiance music with piano and guitar" --duration 60
# With song structure segments
python scripts/music_generate.py bgm --text "Epic game soundtrack" --segments '[{"Name":"intro","Duration":10},{"Name":"chorus","Duration":30}]'songpython scripts/music_generate.py lyrics --prompt "A song about graduation farewell" --genre Folk --mood "Sentimental/Melancholic/Lonely" --gender Femalepython scripts/music_generate.py query --task-id "202601397834584670076931"User Request
↓
Contains "instrumental/BGM/background music/soundtrack"?
├─ Yes → bgm mode
└─ No → Contains "lyrics/write lyrics" and does NOT request audio?
├─ Yes → lyrics mode
└─ No → song mode
├─ User provided lyrics → --lyrics
└─ User only described a theme → --prompt (or lyrics first, then song)| Parameter | Required | Description |
|---|---|---|
| either | Lyrics with structure tags |
| either | Text prompt (Chinese, 5-700 chars) |
| no | |
| no | Music genre |
| no | Music mood |
| no | |
| no | Vocal timbre |
| no | Duration in seconds [30-240] |
| no | Musical key (v4.3 only) |
| no | |
| no | Tempo (v4.3 only) |
| no | Instruments, comma-separated (v4.3 only) |
| no | Secondary genres, comma-separated, max 2 (v4.3 only) |
| no | Scene tags, comma-separated (v4.3 only) |
| no | Language (v4.3 only) |
| no | |
| no | |
| no | Max wait seconds (default: 300) |
| Parameter | Required | Description |
|---|---|---|
| yes | Natural language description |
| no | Duration in seconds [30-120] |
| no | JSON array of song structure segments |
| no | Model version (default: v5.0) |
| no | Enable prompt rewriting |
| no | |
| no | Max wait seconds (default: 300) |
| Parameter | Required | Description |
|---|---|---|
| yes | Lyrics prompt (Chinese only, <500 chars) |
| no | Music genre |
| no | Music mood |
| no | |
{
"status": "success | timeout | error",
"mode": "song | bgm | lyrics | query",
"task_id": "...",
"audio_url": "https://...",
"duration": 46.0,
"lyrics": "...",
"error": null
}audio_urlPermissionError: VOLCENGINE_ACCESS_KEY ...status: "timeout"task_id