minimax-music [legacy]
Model Overview
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.
Setup your API Key
If you don’t have an API key for the Apilaplas API yet, feel free to use our Quickstart guide.
Submit a request
API Schema
post
Authorizations
Body
modelundefined · enumRequiredPossible values:
promptstringRequired
reference_audio_urlstring · uriRequired
Reference song, should contain music and vocals. Must be a .wav or .mp3 file longer than 15 seconds
Responses
default
application/json
post
POST /v2/generate/audio HTTP/1.1
Host: api.apilaplas.com
Authorization: Bearer <YOUR_LAPLASAPI_KEY>
Content-Type: application/json
Accept: */*
Content-Length: 85
{
"model": "minimax-music",
"prompt": "text",
"reference_audio_url": "https://example.com"
}
default
{
"id": "text",
"status": "queued"
}
get
Authorizations
Query parameters
generation_idstringRequired
Responses
default
application/json
get
GET /v2/generate/audio HTTP/1.1
Host: api.apilaplas.com
Authorization: Bearer <YOUR_LAPLASAPI_KEY>
Accept: */*
default
{
"audio_file": {
"url": "https://example.com"
},
"id": "text",
"status": "queued",
"error": null
}
Quick Code Example
Here is an example of generation an audio file based on a sample and a prompt using the music model minimax-music.
The first code block (sample uploading and music generation):
# 1st code block
import requests
def main():
url = "https://api.apilaplas.com/v2/generate/audio"
payload = {
"model": "minimax-music",
"reference_audio_url": 'https://tand-dev.github.io/audio-hosting/spinning-head-271171.mp3',
"prompt": '''
##Side by side, through thick and thin, \n\nWith a laugh, we always win. \n\n Storms may come, but we stay true, \n\nFriends forever—me and you!##
''',
}
# Insert your LAPLAS API Key instead of <YOUR_LAPLASAPI_KEY>:
headers = {"Authorization": "Bearer <YOUR_LAPLASAPI_KEY>", "Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print("Generation:", response.json())
if __name__ == "__main__":
main()
The second code block (retrieving the generated audio file from the server):
# 2nd code block
import requests
def main():
url = "https://api.apilaplas.com/v2/generate/audio"
params = {
# Insert the id from the output of the 1st code block, instead of <GENERATION_ID>:
"generation_id": "<GENERATION_ID>",
}
# Insert your LAPLAS API Key instead of <YOUR_LAPLASAPI_KEY>:
headers = {"Authorization": "Bearer <YOUR_LAPLASAPI_KEY>", "Content-Type": "application/json"}
response = requests.get(url, params=params, headers=headers)
print("Generation:", response.json())
if __name__ == "__main__":
main()
Listen to the track we generated:
Last updated