Skip to Content
Audio

Audio

Endpoints for converting and compressing audio files using FFmpeg.


Convert

$0.0003per MB$0.01 min

POST /audio/convert

Convert audio files between 15 formats with control over codec, bitrate, sample rate, channels, volume, normalization, trimming, and metadata.

Supported formats: AAC, AC3, AIFF, AMR, AU, CAF, FLAC, M4A, M4B, MP3, OGA, VOC, WAV, WEBA, WMA.

Parameters

NameTypeDefaultDescription
inputFormataac | ac3 | aiff | amr | au | caf | dss | flac | m4a | m4b | mp3 | oga | voc | wav | weba | wmaOverride MIME type detection for formats browsers may not recognize.
targetFormataac | ac3 | aiff | amr | au | caf | flac | m4a | m4b | mp3 | oga | voc | wav | weba | wmamp3Output format.
codecauto | aac | mp3 | opus | vorbis | flac | alac | pcm_s16le | pcm_s24le | pcm_s32le | pcm_s16be | ac3 | wmav2 | amr_nb | copyautoAudio codec. auto picks best for format, copy remuxes without re-encoding.
bitratestringTarget bitrate (e.g. 128k, 320k).
vbrQualitynumberMP3 VBR quality 0-9 (0 = best). Requires mp3Mode=vbr.
sampleRatenumberSample rate in Hz (e.g. 44100, 48000). Omit to preserve source.
channelsnumber1 (mono) or 2 (stereo). Omit to preserve source.
bitDepth8 | 16 | 24 | 32PCM bit depth. Ignored for compressed codecs.
startTimestringTrim start (e.g. 00:01:30 or 90).
endTimestringTrim end position.
durationstringMax duration from startTime.
volumestringVolume adjustment (e.g. 1.5, -3dB).
normalizetrue | falsefalseApply EBU R128 loudness normalization.
stripMetadatatrue | falsefalseRemove all metadata tags.
titlestringSet title tag.
artiststringSet artist tag.
albumstringSet album tag.
genrestringSet genre tag.
yearstringSet year tag.
trackNumberstringSet track number tag.
aacProfileaac_low | aac_he | aac_he_v2AAC profile. Only applies to AAC output.
flacCompressionnumberFLAC compression level 0-12.
mp3Modecbr | vbrcbrMP3 encoding mode. CBR uses bitrate, VBR uses vbrQuality.

Example

tempo request -X POST https://api.fylor.com/audio/convert \ -F "file=@input.wav" \ -F "targetFormat=mp3" \ -F "bitrate=320k" \ -o output.mp3

Example: Convert to FLAC (lossless)

tempo request -X POST https://api.fylor.com/audio/convert \ -F "file=@input.mp3" \ -F "targetFormat=flac" \ -F "flacCompression=8" \ -o output.flac

Limits

  • Max file size: 500 MB

Compress

$0.0003per MB$0.01 min

POST /audio/compress

Reduce audio file sizes while keeping the same format. Lossy formats (MP3, AAC, etc.) get lower bitrate encoding. Lossless formats (WAV, FLAC, AIFF, etc.) get reduced bit depth and/or sample rate. If compression doesn’t reduce the file size, the original is returned unchanged.

Supported formats: AAC, AC3, AIF, AIFC, AIFF, AMR, AU, CAF, FLAC, M4A, M4B, MP3, OGA, VOC, WAV, WEBA, WMA.

Parameters

NameTypeDefaultDescription
qualitylight | medium | heavy | extrememediumCompression preset. Light: 192kbps/16-bit. Medium: 128kbps/16-bit/44.1kHz cap. Heavy: 96kbps/16-bit/22kHz cap. Extreme: 64kbps/8-bit/22kHz cap.
bitratestringOverride bitrate for lossy formats (e.g. 128k, 256k).
sampleRatenumberOverride output sample rate in Hz.
channels1 | 2Force mono or stereo. Omit to preserve source.
bitDepth8 | 16 | 24 | 32Override bit depth for lossless/PCM formats.
normalizetrue | falsefalseApply EBU R128 loudness normalization before encoding.
stripMetadatatrue | falsetrueRemove ID3, Vorbis comments, and other metadata tags.
stripArtworktrue | falsetrueRemove embedded cover art (can save 500KB+).

Example

tempo request -X POST https://api.fylor.com/audio/compress \ -F "file=@podcast.mp3" \ -F "quality=heavy" \ -o compressed.mp3

Example: Compress WAV with normalization

tempo request -X POST https://api.fylor.com/audio/compress \ -F "file=@recording.wav" \ -F "quality=medium" \ -F "normalize=true" \ -o compressed.wav

Limits

  • Max file size: 500 MB

Response Headers

Every response includes:

HeaderDescription
X-Request-IdUnique request identifier (UUID). Use this for support issues or when submitting feedback.

Two-Step Upload (for AI Agents)

If your client can only send JSON (e.g., AgentCash), use the two-step flow instead of direct multipart upload.

Step 1: Pay and create a job

Audio endpoints use per-MB pricing, so you must include fileSizeBytes in the JSON body.

curl -X POST https://api.fylor.app/audio/convert \ -H "Content-Type: application/json" \ -H "Authorization: Payment <token>" \ -d '{"targetFormat": "mp3", "bitrate": "320k", "fileSizeBytes": 10485760}'

Response:

{ "jobId": "550e8400-e29b-41d4-a716-446655440000", "uploadUrl": "/jobs/550e8400-e29b-41d4-a716-446655440000/upload", "expiresIn": 300 }

Step 2: Upload the file

curl -X POST https://api.fylor.app/jobs/550e8400-e29b-41d4-a716-446655440000/upload \ -F "file=@song.flac" \ -o song.mp3

Notes

  • Jobs expire after 5 minutes and are single-use.
  • fileSizeBytes must be within 10% of the actual file size.
  • Both audio endpoints support this flow: /audio/convert, /audio/compress.
Last updated on