import requests
url = "https://api.musicgpt.com/api/public/v1/sing_over_instrumental"
headers = {"Authorization": "<API_KEY>"}
data = {
"prompt": "Sing like Adele in a soulful tone",
"lyrics": "Never mind I'll find someone like you...",
"gender": "female",
"webhook_url": "https://yourdomain.com/webhook"
}
# Option 1: Use audio_url
data["audio_url"] = "https://bucket.s3.amazonaws.com/audio.mp3"
response = requests.post(url, headers=headers, data=data)
# Option 2: Upload file
# with open("audio.mp3", "rb") as f:
# files = {"audio_file": f}
# response = requests.post(url, headers=headers, data=data, files=files)
# print(response.json())
{
"success": true,
"message": "Sing Over Instrumental request submitted successfully",
"task_id": "task-abcde12345",
"conversion_id_1": "over-instrumental-1",
"conversion_id_2": "over-instrumental-2",
"eta": 45,
"credit_estimate": 50
}
This endpoint allows users to sing over an instrumental audio track using a text prompt and lyrics. It supports either a file upload or a URL to the input audio and generates a vocal overlay based on the provided lyrics and style.
import requests
url = "https://api.musicgpt.com/api/public/v1/sing_over_instrumental"
headers = {"Authorization": "<API_KEY>"}
data = {
"prompt": "Sing like Adele in a soulful tone",
"lyrics": "Never mind I'll find someone like you...",
"gender": "female",
"webhook_url": "https://yourdomain.com/webhook"
}
# Option 1: Use audio_url
data["audio_url"] = "https://bucket.s3.amazonaws.com/audio.mp3"
response = requests.post(url, headers=headers, data=data)
# Option 2: Upload file
# with open("audio.mp3", "rb") as f:
# files = {"audio_file": f}
# response = requests.post(url, headers=headers, data=data, files=files)
# print(response.json())
{
"success": true,
"message": "Sing Over Instrumental request submitted successfully",
"task_id": "task-abcde12345",
"conversion_id_1": "over-instrumental-1",
"conversion_id_2": "over-instrumental-2",
"eta": 45,
"credit_estimate": 50
}
Successfully initiated sing over instrumental task
The response is of type object
.