audio-compress
Re-encodes an uploaded recording to shrink it, with the settings each format really has — the server lane of the site's /audio-compressor: MP3 constant bitrate or VBR quality, Ogg Vorbis quality or bitrate, FLAC compression level, WAV bit depth or ADPCM, AAC/M4A bitrate; for every format a lower sample rate and mono. A setting that does not belong to the chosen format is ignored; one that does but is out of its range is refused (MP3 and Ogg bitrates 32–320, AAC/M4A 32–256). Stage the input with POST /v1/uploads first. ASYNCHRONOUS: the call returns 202 with a run id — poll GET /v1/runs/{id}, or register a webhook.
v1 beta server · 10 tokens
Price (server): 2 tokens per MB of input, at least 10 per call; paid plans: −5%, rounded up. The exact figure for your file: POST /v1/tools/audio-compress/estimate.
Call it
POST https://tembrica.com/v1/tools/audio-compress/runs
Authorization: Bearer $TIMBRICA_KEY
Idempotency-Key: <your retry-safe key>
Content-Type: application/json
Input
| Field | Type | Required | Notes |
|---|---|---|---|
audio | object | yes | Staged input file, up to 50 MB — any audio, or a video whose sound track is taken. Upload it with POST /v1/uploads (multipart `file`, or JSON {"url":"…"}). |
format | string | no |
Output format.
one of: mp3, m4a, aac, ogg, opus, wma, flac, wav, aiff default: mp3 |
mode | string | no |
Rate control. mp3: `cbr` (default) or `vbr` with `vbr_quality`. ogg: `bitrate` (default) or `quality` with `quality`.
one of: cbr, vbr, bitrate, quality |
bitrate | integer | no | kbit/s for mp3 (CBR), ogg (bitrate mode), m4a, aac, opus and wma. Default 128 for mp3, ogg, m4a and aac. |
vbr_quality | integer | no |
mp3 VBR quality, LAME -V: 0 is the best and largest, 9 the smallest. Required with mode `vbr`.
one of: 0, 2, 4, 6, 8, 9 |
quality | integer | no | Ogg Vorbis quality, 0 (smallest) to 10 (best). Required with mode `quality`. |
preserve_metadata | boolean | no |
mp3: keep the tags of the input (title, artist, cover).
default: 1 |
compression_level | integer | no | flac: 0 (fastest) to 8 (smallest). Default 5. |
encoding | string | no |
wav: `pcm` (default) or `adpcm` (Microsoft ADPCM, about a quarter of 16-bit PCM).
one of: pcm, adpcm |
bit_depth | integer | no |
wav PCM: 8, 16 (default), 24 or 32 (float). flac: 16 or 24; omitted keeps the source's.
one of: 8, 16, 24, 32 |
sample_rate | integer | no |
Output sample rate, Hz; 0 keeps the source's. opus is always 48000.
one of: 0, 8000, 16000, 22050, 44100, 48000, 96000 default: 0 |
channels | string | no |
`mono` mixes down to one channel; `stereo` keeps the source's channels.
one of: stereo, mono default: stereo |
Input file
Stage it with POST /v1/uploads (multipart `file`, or JSON {"url": "…"}), then pass {"file_id": "<id>"} in each listed input field.
file fields: audio
Errors it can return
validation_failed
input_too_large
insufficient_tokens
concurrency_limited
internal_error
History
- v1 — 2026-11-19 — Initial release (server lane, async, per-MB pricing).
This contract cannot change without a new version and a line above: a test compares the published schema, pricing and limits against a committed lockfile and fails the build otherwise. Subscribe to /v1/changelog to be told when something moves.