Music Models
Overview
Our API features the capability to generate audio. With this API, you can create your own music, speech, and any audio experience from your prompt and imagination.
We support multiple music models. You can find the complete list along with API reference links at the end of the page.
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 from MiniMax.
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:
All Available Music Models
Model ID
Developer
Context
Model Card
Stability AI
Minimax AI
-
Minimax AI
Last updated