POST
/
Extraction
import requests
import json

url = "https://api.musicgpt.com/api/public/v1/Extraction"
headers = {
    "Authorization": "<API_KEY>",
    "accept": "application/json"
}

files = {
    "audio_file": open("path_to_audio.mp3", "rb")
}
data = {
    "audio_url": "",
    "stems": json.dumps(["vocals", "drums"]),
    "preprocessing_options": json.dumps(["Denoise"]),
    "webhook_url": "http://webhook.musicgpt.com"
}

response = requests.post(url, headers=headers, data=data, files=files)
print(response.json())
{
  "success": true,
  "task_id": "62725d68-01e8-4c87-8fb0-298aa81c529c",
  "conversion_id": "46b358c9-b22f-49d1-a68d-17901a6a549b",
  "eta": 11,
  "credit_estimate": 2.5
}

Authorizations

Authorization
string
header
required

Body

multipart/form-data

Response

200
application/json

Successfully initiated audio extraction

The response is of type object.