Python
import requests
url = "https://api.musicgpt.com/api/public/v1/Cover"
headers = {
"Authorization": "<API_KEY>"
}
data = {
"voice_id": "e0bb585f-b798-4bac-ac4e-de7fff38f9d7",
"pitch": 0,
"webhook_url": "https://example.com/my-webhook"
}
# Option 1: audio_url
data["audio_url"] = "<YOUR_AUDIO_URL>"
response = requests.post(url, headers=headers, data=data)
# Option 2: File Upload
# with open("song.mp3", "rb") as f:
# files = {"audio_file": f}
# response = requests.post(url, headers=headers, data=data, files=files)
print(response.json())curl --request POST \
--url https://api.musicgpt.com/api/public/v1/Cover \
--header 'Authorization: <api-key>' \
--header 'Content-Type: multipart/form-data' \
--form audio_url=https://example.com/audio.wav \
--form voice_id=demo-voice-id \
--form 'audio_file=<string>' \
--form pitch=0 \
--form webhook_url=https://example.com/callback \
--form 0.audio_file='@example-file' \
--form 1.audio_file='@example-file'const form = new FormData();
form.append('audio_url', 'https://example.com/audio.wav');
form.append('voice_id', 'demo-voice-id');
form.append('audio_file', '<string>');
form.append('pitch', '0');
form.append('webhook_url', 'https://example.com/callback');
form.append('0.audio_file', '{
"fileName": "example-file"
}');
form.append('1.audio_file', '{
"fileName": "example-file"
}');
const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
options.body = form;
fetch('https://api.musicgpt.com/api/public/v1/Cover', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.musicgpt.com/api/public/v1/Cover",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\nhttps://example.com/audio.wav\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voice_id\"\r\n\r\ndemo-voice-id\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"pitch\"\r\n\r\n0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"webhook_url\"\r\n\r\nhttps://example.com/callback\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"0.audio_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"1.audio_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: multipart/form-data; boundary=---011000010111000001101001"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.musicgpt.com/api/public/v1/Cover"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\nhttps://example.com/audio.wav\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voice_id\"\r\n\r\ndemo-voice-id\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"pitch\"\r\n\r\n0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"webhook_url\"\r\n\r\nhttps://example.com/callback\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"0.audio_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"1.audio_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.musicgpt.com/api/public/v1/Cover")
.header("Authorization", "<api-key>")
.header("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\nhttps://example.com/audio.wav\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voice_id\"\r\n\r\ndemo-voice-id\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"pitch\"\r\n\r\n0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"webhook_url\"\r\n\r\nhttps://example.com/callback\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"0.audio_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"1.audio_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.musicgpt.com/api/public/v1/Cover")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'multipart/form-data; boundary=---011000010111000001101001'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\nhttps://example.com/audio.wav\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voice_id\"\r\n\r\ndemo-voice-id\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"pitch\"\r\n\r\n0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"webhook_url\"\r\n\r\nhttps://example.com/callback\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"0.audio_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"1.audio_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"success": true,
"task_id": "b329c0df-b2eb-4914-b707-4d7dce53577e",
"conversion_id": "16708396-da86-4a9e-9b90-66f774cc2382",
"eta": 33
}{
"success": false,
"error": "The file could not be downloaded from the provided URL"
}{
"success": false,
"error": "Insufficient credit balance"
}{
"success": false,
"error": "Both audio_url and audio_file cannot be None"
}{
"success": false,
"error": "Internal Server Error"
}Features
Cover Song
Convert an audio file or URL into a cover song using a different voice.
POST
/
v1
/
Cover
Python
import requests
url = "https://api.musicgpt.com/api/public/v1/Cover"
headers = {
"Authorization": "<API_KEY>"
}
data = {
"voice_id": "e0bb585f-b798-4bac-ac4e-de7fff38f9d7",
"pitch": 0,
"webhook_url": "https://example.com/my-webhook"
}
# Option 1: audio_url
data["audio_url"] = "<YOUR_AUDIO_URL>"
response = requests.post(url, headers=headers, data=data)
# Option 2: File Upload
# with open("song.mp3", "rb") as f:
# files = {"audio_file": f}
# response = requests.post(url, headers=headers, data=data, files=files)
print(response.json())curl --request POST \
--url https://api.musicgpt.com/api/public/v1/Cover \
--header 'Authorization: <api-key>' \
--header 'Content-Type: multipart/form-data' \
--form audio_url=https://example.com/audio.wav \
--form voice_id=demo-voice-id \
--form 'audio_file=<string>' \
--form pitch=0 \
--form webhook_url=https://example.com/callback \
--form 0.audio_file='@example-file' \
--form 1.audio_file='@example-file'const form = new FormData();
form.append('audio_url', 'https://example.com/audio.wav');
form.append('voice_id', 'demo-voice-id');
form.append('audio_file', '<string>');
form.append('pitch', '0');
form.append('webhook_url', 'https://example.com/callback');
form.append('0.audio_file', '{
"fileName": "example-file"
}');
form.append('1.audio_file', '{
"fileName": "example-file"
}');
const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
options.body = form;
fetch('https://api.musicgpt.com/api/public/v1/Cover', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.musicgpt.com/api/public/v1/Cover",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\nhttps://example.com/audio.wav\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voice_id\"\r\n\r\ndemo-voice-id\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"pitch\"\r\n\r\n0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"webhook_url\"\r\n\r\nhttps://example.com/callback\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"0.audio_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"1.audio_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: multipart/form-data; boundary=---011000010111000001101001"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.musicgpt.com/api/public/v1/Cover"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\nhttps://example.com/audio.wav\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voice_id\"\r\n\r\ndemo-voice-id\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"pitch\"\r\n\r\n0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"webhook_url\"\r\n\r\nhttps://example.com/callback\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"0.audio_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"1.audio_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.musicgpt.com/api/public/v1/Cover")
.header("Authorization", "<api-key>")
.header("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\nhttps://example.com/audio.wav\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voice_id\"\r\n\r\ndemo-voice-id\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"pitch\"\r\n\r\n0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"webhook_url\"\r\n\r\nhttps://example.com/callback\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"0.audio_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"1.audio_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.musicgpt.com/api/public/v1/Cover")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'multipart/form-data; boundary=---011000010111000001101001'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\nhttps://example.com/audio.wav\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voice_id\"\r\n\r\ndemo-voice-id\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"pitch\"\r\n\r\n0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"webhook_url\"\r\n\r\nhttps://example.com/callback\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"0.audio_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"1.audio_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"success": true,
"task_id": "b329c0df-b2eb-4914-b707-4d7dce53577e",
"conversion_id": "16708396-da86-4a9e-9b90-66f774cc2382",
"eta": 33
}{
"success": false,
"error": "The file could not be downloaded from the provided URL"
}{
"success": false,
"error": "Insufficient credit balance"
}{
"success": false,
"error": "Both audio_url and audio_file cannot be None"
}{
"success": false,
"error": "Internal Server Error"
}Convert an audio file or URL into a cover song using a different voice model.
The Cover Song endpoint recreates a vocal track using AI voice models, allowing for pitch manipulation and background audio transformation. Perfect for covers, remixes, or experimenting with different vocal styles.
This is the primary endpoint for initiating cover song conversion tasks.
You can download or stream the result directly from the
Endpoint
POST /v1/Cover
Sample Output
Listen to a real sample output: Output File: Download AudioTry it Yourself
Visit the Cover Endpoint Explorer to test it live. Upload your audio, select a voice model, and hear the transformation.Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
audio_url | String | Optional | URL of the audio file to convert. Either audio_url or audio_file must be provided. |
audio_file | UploadFile | Optional | Upload the audio file directly. Either audio_url or audio_file must be provided. |
voice_id | String | Yes | Voice model to convert the audio into. |
pitch | Integer | Optional | Adjust pitch between -12 and 12 semitones. Default is 0. |
webhook_url | String | Optional | Callback URL for async response. |
💡Note: You must provide eitheraudio_urloraudio_file— not both asNone.
content-type: multipart/form-data
Sample Request
cURL
curl -X POST "https://api.musicgpt.com/api/public/v1/Cover" \
-H "accept: multipart/form-data" \
-H "Authorization: <api_key>" \
-F "audio_url=https://www.youtube.com/watch?v=jGflUbPQfW8" \
-F "voice_id=Drake" \
-F "pitch=0" \
-F "webhook_url=http://webhook.musicgpt.com"
Python
import requests
url = "https://api.musicgpt.com/api/public/v1/Cover"
headers = {
"accept": "multipart/form-data",
"Authorization": "<api_key>"
}
input_audio_file = open("{path_to_your_audio_file}", "rb")
payload = {
"audio_url": "",
"voice_id": "Drake",
"pitch": 0,
"webhook_url": "http://abc.requestcatcher.com/test",
}
response = requests.post(url, headers=headers, data=payload, files={"audio_file": input_audio_file})
print(response.json())
Replace{path_to_your_audio_file},api_key, andwebhook_urlbefore executing.
Sample Response
Success (200 OK)
{
"success": true,
"task_id": "3d137437-4911-4669-b639-9e5701107c25",
"conversion_id": "b764b4f6-a842-42dd-a55b-818eb8251dc7",
"eta": 71,
"credit_estimate": 1.27,
"message": "Message published to queue",
"status": "IN_QUEUE"
}
Common Errors
- 400 Bad Request: The file could not be downloaded from the provided URL.
- 402 Payment Required: Your credit balance is insufficient.
- 422 Unprocessable Entity: No
audio_urloraudio_fileprovided. - 500 Internal Server Error: Something went wrong on our end.
Webhook Response
When the cover conversion completes, the webhook receives:{
"success": true,
"conversion_type": "Cover",
"task_id": "0ec93bdd-6132-40db-a873-676dc314919c",
"conversion_id": "acff300f-1c96-498d-99fe-929b985c5c55",
"audio_url": "https://lalals.s3.amazonaws.com/projects/acff300f-1c96-498d-99fe-929b985c5c55.mp3",
"audio_url_wav": "https://lalals.s3.amazonaws.com/projects/acff300f-1c96-498d-99fe-929b985c5c55.wav",
"conversion_cost": "0.88",
"conversion_duration": 272.44
}
audio_url.
Payload and Request Formation
Authorizations
Body
multipart/form-data
- Option 1
- Option 2
Input audio URL (supported format: YouTube URL).
Example:
"https://example.com/audio.wav"
The ID of the voice model to use for voice transformation.
Example:
"demo-voice-id"
Audio file to upload and process. Either audio_file or audio_url must be provided.
Pitch adjustment for the voice. Range from -12 to 12. Default: 0
Required range:
-12 <= x <= 12A URL where the result will be sent once processing is completed.
Example:
"https://example.com/callback"
⌘I