import requests
url = "https://api.musicgpt.com/api/public/v1/deecho"
headers = {
"Authorization": "<<<api key>>>"
}
# Option 1: URL
payload = {
"audio_url": "https://example.com/audio.m4a",
"webhook_url": ""
}
response = requests.post(url, headers=headers, data=payload)
print(response.json())
# Option 2: File Upload
# payload = {
# "webhook_url": "https://www.test.requestcatcher.com/test"
# }
# with open("audio.m4a", "rb") as f:
# files = {"audio_file": f}
# response = requests.post(url, headers=headers, data=payload, files=files)
# print(response.json())
{
"success": true,
"task_id": "deecho789",
"conversion_id": "conv456",
"eta": -1,
"credit_estimate": 100.1
}
Initiate an echo removal task using either an audio URL or file upload with optional webhook callback.
import requests
url = "https://api.musicgpt.com/api/public/v1/deecho"
headers = {
"Authorization": "<<<api key>>>"
}
# Option 1: URL
payload = {
"audio_url": "https://example.com/audio.m4a",
"webhook_url": ""
}
response = requests.post(url, headers=headers, data=payload)
print(response.json())
# Option 2: File Upload
# payload = {
# "webhook_url": "https://www.test.requestcatcher.com/test"
# }
# with open("audio.m4a", "rb") as f:
# files = {"audio_file": f}
# response = requests.post(url, headers=headers, data=payload, files=files)
# print(response.json())
{
"success": true,
"task_id": "deecho789",
"conversion_id": "conv456",
"eta": -1,
"credit_estimate": 100.1
}
Successfully initiated echo removal
The response is of type object
.