Conversion Endpoints
Extraction
Process an audio file to extract specified stems (vocals, instrumental, or other components) with optional preprocessing. Supports file upload or URL with webhook callback.
POST
/
Extraction
Copy
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())
Copy
{
"success": true,
"task_id": "62725d68-01e8-4c87-8fb0-298aa81c529c",
"conversion_id": "46b358c9-b22f-49d1-a68d-17901a6a549b",
"eta": 11,
"credit_estimate": 2.5
}
Authorizations
Body
multipart/form-data
Response
200
application/json
Successfully initiated audio extraction
The response is of type object
.
Copy
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())
Copy
{
"success": true,
"task_id": "62725d68-01e8-4c87-8fb0-298aa81c529c",
"conversion_id": "46b358c9-b22f-49d1-a68d-17901a6a549b",
"eta": 11,
"credit_estimate": 2.5
}
Assistant
Responses are generated using AI and may contain mistakes.