API Documentation
Keep in mind
Features
- POSTMusic AI
- POSTCover Song
- POSTText To Speech
- POSTSound Generator
- POSTExtraction
- POSTVoice Changer
- POSTDenoise
- POSTDeecho
- POSTDereverb
- POSTFile Conversion
- POSTAudio Transcribe
- POSTKey & BPM Extraction
- POSTAudio to MIDI
- POSTAudio Cutter
- POSTAudio Speed Changer
- POSTAudio Mastering
- POSTRemix
- POSTExtend
- POSTInpaint
- POSTSing Over Instrumental
- GETLyrics Generator
Sample Request Endpoints
Conversion Endpoints
- POSTMUSIC AI
- POSTCover
- POSTVoice Changer
- POSTText To Speech
- POSTExtraction
- POSTSound Generator
- POSTDeNoise
- POSTDeEcho
- POSTDeReverb
- POSTFile Conversion
- POSTAudio Transcribe
- POSTExtract Key BPM
- POSTAudio To MIDI
- POSTAudio Cutter
- POSTAudio Speed Changer
- POSTAudio Mastering
- POSTRemix
- POSTExtend
- POSTInpaint
- POSTSing Over Instrumental
- GETLyrics Generator
Conversion Endpoints
File Conversion
Initiate a file conversion task using either an audio URL or file upload with optional format parameters and webhook callback.
POST
/
file_convert
Python
Copy
import requests
url = "https://api.musicgpt.com/api/public/v1/file_convert"
headers = {
"Authorization": "<<<api key>>>"
}
# Option 1: URL
payload = {
"audio_url": "https://example.com/audio.mp3",
"target_format": "wav",
"target_sr": 44100,
"webhook_url": "https://your-webhook-url.com/callback"
}
response = requests.post(url, headers=headers, data=payload)
print(response.json())
# Option 2: File Upload
# payload = {
# "target_format": "flac",
# "target_bit_depth": 24,
# "webhook_url": "https://your-webhook-url.com/callback"
# }
# with open("audio.mp3", "rb") as f:
# files = {"audio_file": f}
# response = requests.post(url, headers=headers, data=payload, files=files)
# print(response.json())
Copy
{
"success": true,
"task_id": "convert789",
"conversion_id": "conv456",
"output_path": "https://storage.example.com/converted/audio.wav",
"credit_estimate": 100.1
}
Authorizations
Body
multipart/form-data
Response
200
application/json
Successfully initiated file conversion
The response is of type object
.
Python
Copy
import requests
url = "https://api.musicgpt.com/api/public/v1/file_convert"
headers = {
"Authorization": "<<<api key>>>"
}
# Option 1: URL
payload = {
"audio_url": "https://example.com/audio.mp3",
"target_format": "wav",
"target_sr": 44100,
"webhook_url": "https://your-webhook-url.com/callback"
}
response = requests.post(url, headers=headers, data=payload)
print(response.json())
# Option 2: File Upload
# payload = {
# "target_format": "flac",
# "target_bit_depth": 24,
# "webhook_url": "https://your-webhook-url.com/callback"
# }
# with open("audio.mp3", "rb") as f:
# files = {"audio_file": f}
# response = requests.post(url, headers=headers, data=payload, files=files)
# print(response.json())
Copy
{
"success": true,
"task_id": "convert789",
"conversion_id": "conv456",
"output_path": "https://storage.example.com/converted/audio.wav",
"credit_estimate": 100.1
}
Assistant
Responses are generated using AI and may contain mistakes.