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
Copy
import requests
url = "https://api.example.com/api/public/v1/file_convert"
headers = {"Authorization": "<API_KEY>", "accept": "application/json"}
# Option 1: URL
response = requests.post(
url,
headers=headers,
data={
"audio_url": "https://example.com/audio.mp3",
"target_format": "wav",
"target_sr": 44100,
"webhook_url": "http://your-webhook-url.com/callback"
}
)
# Option 2: File Upload
with open("audio.mp3", "rb") as f:
files = {"audio_file": f}
data = {
"target_format": "wav",
"target_bit_depth": 24
}
response = requests.post(url, headers=headers, files=files, data=data)
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
.
Copy
import requests
url = "https://api.example.com/api/public/v1/file_convert"
headers = {"Authorization": "<API_KEY>", "accept": "application/json"}
# Option 1: URL
response = requests.post(
url,
headers=headers,
data={
"audio_url": "https://example.com/audio.mp3",
"target_format": "wav",
"target_sr": 44100,
"webhook_url": "http://your-webhook-url.com/callback"
}
)
# Option 2: File Upload
with open("audio.mp3", "rb") as f:
files = {"audio_file": f}
data = {
"target_format": "wav",
"target_bit_depth": 24
}
response = requests.post(url, headers=headers, files=files, data=data)
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.