Speech Enhancement
Makes recorded speech clearer and closer: for interviews, calls, lectures and voice-overs. One request in, one MP3 out.
Create a job
POST /v1/audio/enhance with the audio and, optionally, the model and a webhook URL. It answers 202 Accepted with the Job and a Location: /v1/jobs/{id} header. Send an Idempotency-Key so a retry never creates a second job. Scopes: jobs:write, plus files:write with input_url or a multipart file (the input becomes a File; 403 insufficient_scope otherwise).
curl -s https://api.zilapi.com/v1/audio/enhance \
-H "Authorization: Bearer $ZILAPI_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"input_url": "https://example.com/episode-142.wav",
"model": "zilapi/se-1.0",
"webhook_url": "https://your-app.example.com/hooks/zilapi"}' \
> job.json
JOB_ID=$(jq -r .id job.json)| Field | Type | Description |
|---|---|---|
| input_url | string | An https URL we fetch: up to 5 GB and 6 hours of audio. The job waits (waiting_for_file) until the file is fetched and checked. |
| file | string | Instead of input_url: a file_… id from Files. Send exactly one of the two. |
| model | string | Optional. Default zilapi/se-1.0. |
| webhook_url | string | Optional. An https URL that receives this job's job.succeeded, job.failed or job.canceled event, signed. See Webhooks. |
| end_user | string | Optional. Your own id for the user or workspace this job is for: 1 to 128 characters from A-Z a-z 0-9 . _ : @ -. Returned on the job; filter with GET /v1/jobs?end_user=. Send an opaque or hashed id, never a raw email. See Jobs. |
Send a local file
For a file on your machine up to 50 MB (25 MB with a test key), send it in the same request as multipart/form-data: the audio in a field named file, plus model, webhook_url and end_user as fields if you want them. Larger files: upload first, then pass the file id.
curl -s https://api.zilapi.com/v1/audio/enhance \
-H "Authorization: Bearer $ZILAPI_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-F "file=@episode-142.wav" \
-F "webhook_url=https://your-app.example.com/hooks/zilapi" \
> job.json
JOB_ID=$(jq -r .id job.json)Output
A succeeded job lists its file in output.files (and, as before, its size in output.size_bytes). GET /v1/jobs/{id}/output (or ?name=audio) returns a signed download URL, valid for up to 1 hour, and the file's name.
| Name | Ask with | Filename | Contains |
|---|---|---|---|
| audio | ?name=audio | <stem>-enhanced.mp3 | The enhanced speech, MP3, up to 320 kbps |
curl -s "https://api.zilapi.com/v1/jobs/$JOB_ID/output?name=audio" -H "Authorization: Bearer $ZILAPI_KEY" > output.json
curl -o "$(jq -r .filename output.json)" "$(jq -r .url output.json)" # <stem>-enhanced.mp3<stem> is your input's filename without its extension. Outputs are deleted 7 days after the job succeeds.
Price and limits
zilapi/se-1.0costs $0.043 per audio minute (43,000 micro-dollars per minute), billed per second of the input, with a 1-second minimum per job (min_billable_secondsinGET /v1/models).- Nothing is held while the job waits for its file. Once the file is ready we hold the exact cost; if your available credit is too low, the job fails with
insufficient_creditand nothing is charged. - Inputs: common audio formats (WAV, MP3, M4A/AAC, FLAC, OGG/Opus and more, or the audio track of a video), up to 6 hours and 5 GB. Output: MP3, up to 320 kbps.
- A rejected input fails the job with
invalid_audio,audio_too_longorfetch_failed, and nothing is charged. - Use Noise Removal for music or mixed content; use Speech Enhancement when the recording is mostly speech.
Statuses, polling and canceling work as for every job: see Jobs. Model details: zilapi/se-1.0. Compare every model on Pricing.