Music 01
An advanced AI model that generates diverse high-quality audio compositions by analyzing and reproducing musical patterns, rhythms, and vocal styles from the reference track. Refine the process using a text prompt.
How to Make a Call
API Schemas
Upload a reference sample
This endpoint uploads a reference music piece to the server, analyzes it, and returns identifiers for the voice and/or instrumental patterns to use later.
Bearer key
Audio file local path, supports WAV and MP3 formats. The audio duration must be longer than 10s and no more than 10 minutes.
- If purpose is song:
- You need to upload a music file containing both acapella (vocals) and accompaniment.
- The acapella must be in singing form; normal speech is not supported.
- Outputs: voice_id and instrumental_id.
- If purpose is voice:
- You need to upload a file containing only acapella in singing form (normal speech audio is not supported).
- Output: voice_id.
- If purpose is instrumental:
- You need to upload a file containing only accompaniment.
- Output: instrumental_id.
The voice_id will only be returned when the purpose is song or voice.
vocal-2025011003141025-d5ZEMxmpThe instrumental_id will only be returned when the purpose is song or instrumental.
instrumental-2025011003141125-Akz9eWnD{
"voice_id": "vocal-2025011003141025-d5ZEMxmp",
"instrumental_id": "instrumental-2025011003141125-Akz9eWnD",
"base_resp": {
"status_code": 1,
"status_msg": "text"
}
}Generate music sample
This endpoint generates a new music piece based on the voice and/or instrumental pattern identifiers obtained from the first endpoint above. The generation can be completed in 50-60 seconds or take a bit more.
Bearer key
Lyrics with optional formatting. You can use a newline to separate each line of lyrics. You can use two newlines to add a pause between lines. You can use double hash marks (##) at the beginning and end of the lyrics to add accompaniment. Maximum 600 characters.
##Swift and Boundless In the realm of innovation, where visions align, AIML API's the name, making tech shine. Intelligent solutions, breaking the mold, Swift inference power, bold and untold. ##voice_id. At least one of refer_voice or refer_instrumental is required. When only refer_voice is provided, the system can still output music data. The generated music will be an a cappella vocal hum that aligns with the provided refer_voice and the generated lyrics, without any instrumental accompaniment.
vocal-2025010100000000-a0AAAaaainstrumental_id. At least one of refer_voice or refer_instrumental is required. When only refer_instrumental is provided, the system can still output music data. The generated music will be a purely instrumental track that aligns with the provided refer_instrumental, without any vocals.
instrumental-2025010100000000-Aaa0aAaAPOST /v2/generate/audio/minimax/generate HTTP/1.1
Host: api.aimlapi.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 420
{
"lyrics": "##Swift and Boundless \n In the realm of innovation, where visions align, \n\nAIML API's the name, making tech shine. \nIntelligent solutions, breaking the mold, \n\nSwift inference power, bold and untold.\n##",
"model": "music-01",
"audio_setting": {
"sample_rate": 16000,
"bitrate": 32000,
"format": "mp3"
},
"refer_voice": "vocal-2025010100000000-a0AAAaaa",
"refer_instrumental": "instrumental-2025010100000000-Aaa0aAaA"
}{
"data": {
"status": 1,
"audio": "text"
},
"extra_info": {
"audio_length": 1,
"audio_size": 1,
"audio_bitrate": 1,
"audio_sample_rate": 1,
"music_duration": 1,
"music_sample_rate": 1,
"music_channel": 1,
"bitrate": 1,
"music_size": 1
},
"analysis_info": null,
"trace_id": "text",
"base_resp": {
"status_code": 1,
"status_msg": "text"
}
}Quick Code Example
Here is an example of generation an audio file based on a sample and a prompt using the music model music-01.
Listen to the track we generated:
Last updated
Was this helpful?