POST
/
Cover
Python
import requests

url = 'https://api.musicgpt.com/api/public/v1/Cover'

payload = {
    'audio_url': '<AUDIO_URL>',
    'voice_id': '<VOICE_ID>',
    'pitch': '0',
    'webhook_url': '<WEBHOOK_URL>'
}

# For file upload:
# files = {'audio_file': open('file.wav', 'rb')}

headers = {
    'Authorization': '<API_KEY>'
}

response = requests.post(url, data=payload, headers=headers)
# response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)
{
  "success": true,
  "task_id": "b329c0df-b2eb-4914-b707-4d7dce53577e",
  "conversion_id": "16708396-da86-4a9e-9b90-66f774cc2382",
  "eta": 33
}

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.


๐Ÿ“ก Endpoint

POST /Cover

This is the primary endpoint for initiating cover song conversion tasks.


โ–ถ๏ธ Sample Output

Listen to a real sample output:

Output: Download Audio


๐Ÿงช Try it Yourself

Visit the Cover Endpoint Explorer to test it live. Upload your audio, select a voice model, and hear the transformation.


๐Ÿ› ๏ธ Request Parameters

ParameterTypeRequiredDescription
audio_urlStringOptionalURL of the audio file to convert. Either audio_url or audio_file must be provided.
audio_fileUploadFileOptionalUpload the audio file directly. Either audio_url or audio_file must be provided.
voice_idStringโœ… YesVoice model to convert the audio into.
pitchIntegerOptionalAdjust pitch between -12 and 12 semitones. Default is 0.
webhook_urlStringOptionalCallback URL for async response.

๐Ÿ’ก Note: You must provide either audio_url or audio_file โ€” not both as None.


๐Ÿ“ค 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, and webhook_url before 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",
  "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_url or audio_file provided.
  • 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
}

You can download or stream the result directly from the audio_url.

Payload and Request Formation

Authorizations

Authorization
string
header
required

Body

multipart/form-data

Response

200
application/json

Successful response

The response is of type object.