API Endpoint Reference
/api/v1/audio-converter
Convert audio files to MP3, WAV, or AAC.
Auth
Bearer or X-API-Key
Every request must include a valid user API key.
Estimate first
Preview token cost
Estimate endpoints help validate input and expected usage before processing.
Response
Download URL on success
Successful sync responses return a result URL plus token details.
Tool Usage Notes
Output format can be mp3, wav, or aac.
If one file is converted, you get a single audio file.
If multiple files are converted, you get a ZIP file.
Estimate Before Processing
Use the estimate endpoint to preview token cost and validate your input URLs before starting conversion.
curl -X POST https://your-domain.example/api/v1/audio-converter/estimate \
-H "Authorization: Bearer fm_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"inputs": ["https://example.com/file"],
"response_type": "json"
}'
{
"ok": true,
"tool": "audio-converter",
"mode": "estimate",
"estimated_tokens": 1,
"available_tokens": 10,
"enough_tokens": true,
"shortfall_tokens": 0
}
Example Request
Set target audio output format.
curl -X POST https://your-domain.example/api/v1/audio-converter \
-H "Authorization: Bearer fm_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"inputs": ["https://example.com/input.wav"],
"output_format": "mp3",
"response_type": "json"
}'
Request Parameters Breakdown
| Parameter | Required | Type | Options | Default | Example |
|---|---|---|---|---|---|
| inputs | Yes | array<string> | HTTP/HTTPS URL(s) to audio files | none (required) |
["https://example.com/input.wav"]
|
| Provide one or more audio URLs. | |||||
| output_format | Yes | string |
mp3, wav, aac
|
none (required) |
mp3
|
| Target output audio format. | |||||
| response_type | No | string |
json, xml, text
|
json |
json
|
| Controls API response payload format. | |||||
| promo_code | No | string | Any active promo code | empty |
SPRING25
|
| Optional; applies discount rules when valid. | |||||
Example Response
Converted audio file is provided via download URL.
{
"ok": true,
"tool": "audio-converter",
"mode": "sync",
"status": "completed",
"download_url": "https://your-domain.example/tool/audio-converter/jobs/.../download",
"estimated_tokens": 1,
"final_tokens": 1
}
Response Fields Breakdown
| Field | Type | Always Returned | Example |
|---|---|---|---|
| ok | boolean | Yes |
true
|
| Indicates success/failure. | |||
| tool | string | Yes |
audio-converter
|
| Tool identifier. | |||
| mode | string | Yes |
sync
|
| Current execution mode. | |||
| status | string | Yes |
completed
|
| Processing state. | |||
| download_url | string | Yes |
https://your-domain.example/tool/audio-converter/jobs/.../download
|
| Single file or ZIP download URL. | |||
| estimated_tokens | integer | Yes |
1
|
| Estimated reserved tokens. | |||
| final_tokens | integer | Yes |
1
|
| Final charged tokens. | |||