Noise Reduction API
The Noise Reduction API reduces continuous background noise mixed with one speaker's voice and returns an MP3 or WAV file.
API overview
| Item | Value |
|---|---|
| Base URL | https://api.kitschlabs.com |
| Authentication | xi-api-key: <API_KEY> |
| Request | multipart/form-data |
| Endpoint | POST /v1/audio-isolation |
| Required field | audio |
| Default output | mp3_44100_128 (audio/mpeg) |
| Additional output | wav_48000 (audio/wav) |
| Maximum input | 50 MiB, 60 seconds |
How do I authenticate?
Send your issued API key in the xi-api-key header. Store the real key in a
server environment variable or secret management service, and do not include
it in browsers, app bundles, or logs.
xi-api-key: <API_KEY>
How do I reduce background noise?
Send a regular audio file with file_format=other. Save the response body to
a file with the matching extension.
- cURL
- Python
- JavaScript
curl --request POST \
"https://api.kitschlabs.com/v1/audio-isolation" \
--header "xi-api-key: <API_KEY>" \
--form "audio=@sample.wav" \
--form "file_format=other" \
--output enhanced.mp3
import os
import requests
with open("sample.wav", "rb") as audio:
response = requests.post(
"https://api.kitschlabs.com/v1/audio-isolation",
headers={"xi-api-key": os.environ["KITSCH_API_KEY"]},
data={"file_format": "other"},
files={"audio": audio},
timeout=120,
)
response.raise_for_status()
with open("enhanced.mp3", "wb") as output:
output.write(response.content)
import { readFile, writeFile } from "node:fs/promises";
const form = new FormData();
form.append("audio", new Blob([await readFile("sample.wav")]), "sample.wav");
form.append("file_format", "other");
const response = await fetch("https://api.kitschlabs.com/v1/audio-isolation", {
method: "POST",
headers: { "xi-api-key": process.env.KITSCH_API_KEY },
body: form,
});
if (!response.ok) {
throw new Error(`${response.status}: ${await response.text()}`);
}
await writeFile("enhanced.mp3", Buffer.from(await response.arrayBuffer()));
For WAV output, set output_format=wav_48000 in the query.
curl --request POST \
"https://api.kitschlabs.com/v1/audio-isolation?output_format=wav_48000" \
--header "xi-api-key: <API_KEY>" \
--form "audio=@sample.wav" \
--output enhanced.wav
Which fields do I send?
| Field | Location | Type | Required | Description |
|---|---|---|---|---|
audio | form | file | Yes | Voice audio to process. Up to 50 MiB and 60 seconds |
file_format | form | string | No | other for regular files or pcm_s16le_16 for raw PCM |
output_format | query | string | No | mp3_44100_128 or wav_48000 |
pcm_s16le_16 is 16 kHz, mono, little-endian 16-bit raw PCM. Use other for
encoded audio such as WAV, MP3, FLAC, and OGG.
Uploaded input files are not stored after processing is complete. Do not log API keys or complete file contents in your application.
Responses and errors
A successful request returns audio binary in the selected format. Use the
response's x-kitsch-request-id when contacting support.
| Header | Description |
|---|---|
x-kitsch-request-id | Request tracking ID |
| Status | Meaning | Recommended action |
|---|---|---|
401 | API key is missing or invalid | Check the key and xi-api-key header |
402 | Not enough available credits | Check the Billing status |
403 | Noise Reduction is not enabled | Check the service access for the account |
413 | File size or input duration exceeded | Reduce it to 50 MiB and 60 seconds or less |
422 | Corrupted audio, invalid PCM, or unsupported format | Check the file and file_format |
429 | API key request limit exceeded | Follow Retry-After and apply backoff |
503 | Temporarily unable to process the request | Record the request ID and retry a limited number of times |
Successful requests are billed by rounding the input audio duration up to the next started second. Failed requests and requests rejected during input validation are not charged.