
Music Generation
- 136 installs
- 79.3k repo stars
- Updated August 5, 2026
- bytedance/deer-flow
music-generation is a Claude skill that produces a song or instrumental MP3 from a style/mood prompt and optional lyrics using the MiniMax music generation API.
About
This skill generates a song or instrumental track from a JSON spec describing style, mood, and optional lyrics, calling the MiniMax music generation API and returning an MP3. A developer uses it when a user asks to create background music, theme songs, jingles, or instrumental tracks. It requires a MINIMAX_API_KEY and writes the output to a file.
- Generates songs (vocal or instrumental) from a style/mood prompt and optional lyrics via the MiniMax music_generation AP
- Takes a JSON spec with title, prompt, lyrics, and is_instrumental fields and returns an MP3
- Requires MINIMAX_API_KEY; defaults to the music-2.6-free model
Music Generation by the numbers
- 136 all-time installs (skills.sh)
- Ranked #751 of 1,335 Generative Media skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
music-generation capabilities & compatibility
requires a MINIMAX_API_KEY; default model music-2.6-free works for all API-key users
- Capabilities
- image generation · video generation
- Use cases
- image generation · orchestration
- Pricing
- Bring your own API key
What music-generation says it does
This skill generates songs (vocal or instrumental) from a structured JSON spec using the
`MINIMAX_API_KEY` (required): your MiniMax interface key.
Music is saved as MP3 (typically in `/mnt/user-data/outputs/`).
npx skills add https://github.com/bytedance/deer-flow --skill music-generationAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 136 |
|---|---|
| repo stars | ★ 79.3k |
| Last updated | August 5, 2026 |
| Repository | bytedance/deer-flow ↗ |
What it does
Generate a song or instrumental MP3 from a style prompt and optional lyrics via the MiniMax music API.
Who is it for?
producing background music, theme songs, jingles, or instrumental tracks from a prompt
Skip if: editing existing audio or running without a MiniMax API key
When should I use this skill?
the user requests to generate, create, compose, or produce music or songs
What you get
The skill returns an MP3 song or instrumental generated from the prompt and optional lyrics.
By the numbers
- 3-step workflow: understand requirements, create spec JSON, execute generation
Files
Music Generation Skill
Overview
This skill generates songs (vocal or instrumental) from a structured JSON spec using the MiniMax music generation API (/v1/music_generation). You describe the style/mood/scene in prompt, optionally provide lyrics, and the script returns an MP3.
Workflow
Step 1: Understand Requirements
Identify the desired style, mood, scene, language, and whether the user wants vocals or a pure instrumental track. Decide whether to supply lyrics or let the model write them.
Step 2: Create the Spec JSON
Write a JSON file in /mnt/user-data/workspace/ named {descriptive-name}.json:
{
"title": "Rainy Night Cafe",
"prompt": "indie folk, melancholic, introspective, walking alone, cafe",
"lyrics": "[verse]\nStreetlights glow the night wind sighs\n[chorus]\nPush the wooden door warm air inside"
}Fields:
title(optional): a human-readable name.prompt(required): style, mood, and scene. Drives the musical character.lyrics(optional): song lyrics. Use\nbetween lines and structure tags such as
[Intro], [Verse], [Pre Chorus], [Chorus], [Bridge], [Outro].
is_instrumental(optional, bool): settruefor a pure instrumental track (no lyrics needed).
Behavior:
lyricsprovided → those lyrics are sung.is_instrumental: true→ instrumental, no vocals.- neither → the model auto-writes lyrics from
prompt(lyrics_optimizer).
Step 3: Execute Generation
python /mnt/skills/public/music-generation/scripts/generate.py \
--prompt-file /mnt/user-data/workspace/rainy-night-cafe.json \
--output-file /mnt/user-data/outputs/rainy-night-cafe.mp3Parameters:
--prompt-file: Absolute path to the JSON spec (required).--output-file: Absolute path for the output MP3 (required).
[!NOTE] Do NOT read the python file, just call it with the parameters.
Environment
MINIMAX_API_KEY(required): your MiniMax interface key.MINIMAX_API_HOST(optional): defaulthttps://api.minimaxi.com.MINIMAX_MUSIC_MODEL(optional): defaultmusic-2.6-free(works for all API-key users);
paid/Token-Plan users can set music-2.6 for higher limits.
Output Handling
- Music is saved as MP3 (typically in
/mnt/user-data/outputs/). - Share the generated file with the user using the present_files tool.
- Offer to iterate on style or lyrics if adjustments are needed.
Notes
- Keep
promptfocused on style/mood/scene; put the actual sung words inlyrics. - For non-English songs, write
lyricsin the target language.
import argparse
import json
import os
import requests
MINIMAX_DEFAULT_HOST = "https://api.minimaxi.com"
def _check_base_resp(payload: dict) -> None:
base = payload.get("base_resp") or {}
if base.get("status_code", 0) != 0:
raise Exception(f"MiniMax error {base.get('status_code')}: {base.get('status_msg')}")
def generate_music(prompt_file: str, output_file: str) -> str:
"""Generate a song from a JSON spec via MiniMax /v1/music_generation.
Spec JSON: {"title": str, "prompt": str, "lyrics"?: str, "is_instrumental"?: bool}
- lyrics given -> use them (supports [Verse]/[Chorus] structure tags, \\n lines)
- is_instrumental true -> pure music, no lyrics needed
- otherwise -> lyrics_optimizer auto-writes lyrics from prompt
"""
with open(prompt_file, "r", encoding="utf-8") as f:
spec = json.load(f)
api_key = os.getenv("MINIMAX_API_KEY")
if not api_key:
return "MINIMAX_API_KEY is not set"
prompt = (spec.get("prompt") or "").strip()
if not prompt:
raise ValueError("`prompt` is required in the music spec")
lyrics = spec.get("lyrics") or None # treat empty string the same as absent
is_instrumental = bool(spec.get("is_instrumental", False))
body = {
"model": os.getenv("MINIMAX_MUSIC_MODEL", "music-2.6-free"),
"prompt": prompt,
"output_format": "hex",
"audio_setting": {"sample_rate": 44100, "bitrate": 256000, "format": "mp3"},
}
if lyrics:
body["lyrics"] = lyrics
elif is_instrumental:
body["is_instrumental"] = True
else:
body["lyrics_optimizer"] = True
host = os.getenv("MINIMAX_API_HOST", MINIMAX_DEFAULT_HOST).rstrip("/")
response = requests.post(
f"{host}/v1/music_generation",
headers={"Authorization": f"Bearer {api_key}", "Content-Type": "application/json"},
json=body,
timeout=300,
)
response.raise_for_status()
payload = response.json()
_check_base_resp(payload)
audio_hex = (payload.get("data") or {}).get("audio")
if not audio_hex:
raise Exception("MiniMax returned no audio data")
output_dir = os.path.dirname(output_file)
if output_dir:
os.makedirs(output_dir, exist_ok=True)
with open(output_file, "wb") as f:
f.write(bytes.fromhex(audio_hex))
return f"Successfully generated music to {output_file}"
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Generate music using MiniMax API")
parser.add_argument("--prompt-file", required=True,
help="Absolute path to JSON spec file {title, prompt, lyrics?, is_instrumental?}")
parser.add_argument("--output-file", required=True, help="Output path for generated MP3")
args = parser.parse_args()
try:
print(generate_music(args.prompt_file, args.output_file))
except Exception as e:
print(f"Error while generating music: {e}")