🎉 MiniMax-M2.7: Peak Performance. Ultimate Value. Master the Complex. ➔ Try Now.





curl --request POST \
--url https://api.minimax.io/v1/music_generation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"model": "music-2.6",
"prompt": "Indie folk, melancholic, introspective, longing, solitary walk, coffee shop",
"lyrics": "[verse]\nStreetlights flicker, the night breeze sighs\nShadows stretch as I walk alone\nAn old coat wraps my silent sorrow\nWandering, longing, where should I go\n[chorus]\nPushing the wooden door, the aroma spreads\nIn a familiar corner, a stranger gazes",
"audio_setting": {
"sample_rate": 44100,
"bitrate": 256000,
"format": "mp3"
}
}
'{
"data": {
"audio": "hex-encoded audio data",
"status": 2
},
"trace_id": "04ede0ab069fb1ba8be5156a24b1e081",
"extra_info": {
"music_duration": 25364,
"music_sample_rate": 44100,
"music_channel": 2,
"bitrate": 256000,
"music_size": 813651
},
"analysis_info": null,
"base_resp": {
"status_code": 0,
"status_msg": "success"
}
}Use this API to generate a song from lyrics and a prompt.
curl --request POST \
--url https://api.minimax.io/v1/music_generation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"model": "music-2.6",
"prompt": "Indie folk, melancholic, introspective, longing, solitary walk, coffee shop",
"lyrics": "[verse]\nStreetlights flicker, the night breeze sighs\nShadows stretch as I walk alone\nAn old coat wraps my silent sorrow\nWandering, longing, where should I go\n[chorus]\nPushing the wooden door, the aroma spreads\nIn a familiar corner, a stranger gazes",
"audio_setting": {
"sample_rate": 44100,
"bitrate": 256000,
"format": "mp3"
}
}
'{
"data": {
"audio": "hex-encoded audio data",
"status": 2
},
"trace_id": "04ede0ab069fb1ba8be5156a24b1e081",
"extra_info": {
"music_duration": 25364,
"music_sample_rate": 44100,
"music_channel": 2,
"bitrate": 256000,
"music_size": 813651
},
"analysis_info": null,
"base_resp": {
"status_code": 0,
"status_msg": "success"
}
}Documentation Index
Fetch the complete documentation index at: https://platform.minimax.io/docs/llms.txt
Use this file to discover all available pages before exploring further.
HTTP: Bearer Auth
Bearer API_key, can be found in Account Management>API Keys.The media type of the request body. Must be set to application/json to ensure the data is sent in JSON format.
application/json The model name. Options:
music-2.6 (recommended): Text-to-music generation. Available to Token Plan and paid users only, with higher RPM.music-cover: Cover generation from a reference audio. Available to Token Plan and paid users only, with higher RPM.music-2.6-free: Free-tier version of music-2.6. Available to all users via API Key, with lower RPM.music-cover-free: Free-tier version of music-cover. Available to all users via API Key, with lower RPM.music-2.6, music-cover, music-2.6-free, music-cover-free A description of the music, specifying style, mood, and scenario.
For example: "Pop, melancholic, perfect for a rainy night".
Note:
music-2.6 / music-2.6-free with is_instrumental: true: Required. Length: 1–2000 characters.music-2.6 / music-2.6-free (non-instrumental): Optional. Length: 0–2000 characters.music-cover / music-cover-free: Required. Describes the target cover style. Length: 10–300 characters.2000Song lyrics, using \n to separate lines. Supports structure tags: [Intro], [Verse], [Pre Chorus], [Chorus], [Interlude], [Bridge], [Outro], [Post Chorus], [Transition], [Break], [Hook], [Build Up], [Inst], [Solo].
Note:
music-2.6 / music-2.6-free with is_instrumental: true: Not required.music-2.6 / music-2.6-free (non-instrumental): Required. Length: 1–3500 characters.music-cover / music-cover-free: Optional. If omitted, lyrics are automatically extracted from the reference audio via ASR. Length: 10–1000 characters.lyrics_optimizer: true and lyrics is empty, the system will auto-generate lyrics from prompt.1 - 3500Whether to use streaming output.
The output format of the audio. Options: url or hex.
When stream is true, only hex is supported.
⚠️ Note: url links expire after 24 hours, so download promptly.
url, hex Audio output configuration
Show child attributes
Whether to automatically generate lyrics based on the prompt description. Only supported on music-2.6 / music-2.6-free.
When set to true and lyrics is empty, the system will automatically generate lyrics from the prompt. Default: false.
Whether to generate instrumental music (no vocals). Only supported on music-2.6 / music-2.6-free.
When set to true, the lyrics field is not required. Default: false.
URL of the reference audio. Only used with music-cover / music-cover-free model. Exactly one of audio_url or audio_base64 must be provided. Mutually exclusive with cover_feature_id.
Reference audio constraints:
Base64-encoded reference audio. Only used with music-cover / music-cover-free model. Exactly one of audio_url or audio_base64 must be provided. Mutually exclusive with cover_feature_id.
Reference audio constraints:
Feature ID returned by the Music Cover Preprocess API. Used in the two-step cover workflow to generate a cover with modified lyrics.
Only used with music-cover / music-cover-free model. Mutually exclusive with audio_url and audio_base64.
lyrics is required (length: 10–1000 characters)cover_feature_id is valid for 24 hourscover_feature_id