Quickstart
One request in, one webhook out. Send the audio's URL (or the file itself) with a webhook_url; we fetch it, run the model and call you when the result is ready. With a test key this costs nothing; with a live key, a 3-minute file costs about $0.10.
ZILAPI_KEY. Create a key (a test key is fine). The curl examples use jq and bash; Python uses requests; TypeScript uses the built-in fetch and runs on Node 20 or later as an ES module, for example with npx tsx quickstart.ts.Get your webhook signing secret (once)
Every webhook we send to a webhook_url is signed with your account's signing secret for that mode (live or test), so you can check it came from us. Create it once and keep it in a secret store: it is shown only in this response. Calling it again replaces the secret.
curl -s -X POST https://api.zilapi.com/v1/webhook-endpoints/signing-secret/rotate \
-H "Authorization: Bearer $ZILAPI_KEY" \
-H "Idempotency-Key: $(uuidgen)"
# {"secret": "whsec_…", "mode": "live", "rotated_at": "…", "already_displayed": false}
# Store the secret, for example as ZILAPI_WEBHOOK_SECRET in your server's environment.Send one request
Give us the audio's URL and where to send the result. We fetch the file (https, up to 5 GB and 6 hours), check it, run the job and POST the outcome to webhook_url. The answer is immediate: 202 Accepted with the Job, status: waiting_for_file while we fetch. Nothing is held from your credit until the file is ready and its length is known. The key needs the files:write scope as well as jobs:write (new keys have both), because the fetched audio becomes a File.
curl -s https://api.zilapi.com/v1/audio/denoise \
-H "Authorization: Bearer $ZILAPI_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"input_url": "https://example.com/episode-142.wav",
"webhook_url": "https://your-app.example.com/hooks/zilapi"}' \
> job.json
JOB_ID=$(jq -r .id job.json) # job_7Hq2xV9mKp4R, status "waiting_for_file"Receive the webhook
When the job ends we POST a job.succeeded (or job.failed) event to your webhook_url, with the whole Job in data.object. Check the ZilAPI-Signature header with your signing secret, store the event, and answer 2xx within 10 seconds. If your endpoint is down we retry for about two days.
POST /hooks/zilapi HTTP/1.1
Content-Type: application/json
User-Agent: ZilAPI-Webhooks/1
ZilAPI-Event-Id: evt_4Tn8Wq2Lp6Zr
ZilAPI-Event-Type: job.succeeded
ZilAPI-Delivery-Id: dlv_9Bm3Xc5Vn1Qs
ZilAPI-Signature: t=1760097631,v1=5f0c…
{"id":"evt_4Tn8Wq2Lp6Zr","type":"job.succeeded","created_at":"2026-10-10T12:00:31+00:00","mode":"live",
"data":{"object":{"id":"job_7Hq2xV9mKp4R","object":"job","task":"audio.denoise","status":"succeeded",
"output":{"format":"mp3","bitrate_kbps":320,"size_bytes":4608000,"files":[{"name":"audio","size_bytes":4608000}],…},…}}}error.code and error.message; it is never charged.Download the result
When job.succeeded arrives, take the job id from data.object.id and ask for a fresh download URL (valid for 1 hour). Results are kept for 7 days after the job succeeds.
# JOB_ID is data.object.id from the job.succeeded event
curl -s https://api.zilapi.com/v1/jobs/$JOB_ID/output -H "Authorization: Bearer $ZILAPI_KEY" > output.json
curl -o "$(jq -r .filename output.json)" "$(jq -r .url output.json)" # episode-142-denoised.mp3No public endpoint yet? Poll instead
Leave out webhook_url and follow the job with GET /v1/jobs/{id}. It goes waiting_for_file (we fetch and check the input), queued, processing, then succeeded, failed or canceled.
while :; do
STATUS=$(curl -s https://api.zilapi.com/v1/jobs/$JOB_ID -H "Authorization: Bearer $ZILAPI_KEY" | jq -r .status)
case "$STATUS" in waiting_for_file|queued|processing) sleep 5 ;; *) break ;; esac
done
echo "$STATUS" # succeeded, failed or canceledSeparate music or enhance speech
The same request works for every task; only the path and the default model change. Vocal Separation returns two files.
| Task | Endpoint | Default model | Outputs (?name=) |
|---|---|---|---|
| Noise Removal | POST /v1/audio/denoise | zilapi/nr-4.1 | audio |
| Vocal Separation | POST /v1/audio/separate | zilapi/vms-2.5 | vocals, instrumental |
| Speech Enhancement | POST /v1/audio/enhance | zilapi/se-1.0 | audio |
Upload a local file in the same request
For a small file on your machine (up to 50 MB, 25 MB with a test key), send it with the job as multipart/form-data: the audio in a field named file, and model and webhook_url as plain fields. The job starts in waiting_for_file while we check the upload, exactly like a URL input. Above about 5 MB, or far from the US East Coast, upload straight to storage instead (next).
curl -s https://api.zilapi.com/v1/audio/denoise \
-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)Over about 5 MB, or far from the US East Coast: upload straight to storage
For files over about 5 MB, or when your servers are far from the US East Coast (for example in Asia or Australia), upload the file straight to storage first (up to 5 GB), then create the job with its file id. The bytes go straight to storage instead of through our API servers on the US East Coast, so uploads from far away are more reliable, and a failed PUT can simply be sent again to the same URL. Files over 50 MB that are not reachable by URL always go this way. These five steps do it; uploads above 100 MB use parts (see Files).
Start an upload
Tell us the file name, size in bytes and audio type. You get a file id and a signed upload URL, valid for a limited time. Files up to 5 GB and 6 h are accepted; this example covers a single PUT, which is what you get for files up to 100 MB. Test keys accept files up to 25 MB.
curl -s https://api.zilapi.com/v1/files \
-H "Authorization: Bearer $ZILAPI_KEY" \
-H "Content-Type: application/json" \
-d '{"filename": "talk.wav", "size_bytes": '"$(wc -c < talk.wav)"', "content_type": "audio/wav"}' \
> upload.json
FILE_ID=$(jq -r .id upload.json) # file_3Lm8QpZ2rT6wUpload the bytes
PUT the file to upload.url and send every header in upload.headers with it. The bytes go straight to storage, not through the API. If the PUT fails, send it again to the same URL (it stays valid until upload.expires_at, 6 hours after you started the upload).
mapfile -t HEADERS < <(jq -r '.upload.headers | to_entries[] | "-H", "\(.key): \(.value)"' upload.json)
curl -X PUT "$(jq -r .upload.url upload.json)" "${HEADERS[@]}" --data-binary @talk.wavFinish the upload and wait until it is ready
Finishing checks the file: we check the size and measure the audio in the same request, so the answer is usually already ready (with duration_seconds) or rejected (not audio, or longer than 6 h). A large file can be validating for a few seconds first.
curl -s -X POST https://api.zilapi.com/v1/files/$FILE_ID/complete \
-H "Authorization: Bearer $ZILAPI_KEY"
while :; do
FILE_STATUS=$(curl -s https://api.zilapi.com/v1/files/$FILE_ID -H "Authorization: Bearer $ZILAPI_KEY" | jq -r .status)
[ "$FILE_STATUS" != "validating" ] && break
sleep 2
done
echo "$FILE_STATUS" # readyCreate a denoise job
Name the file and the model. The job is queued and runs on our GPUs. With a live key we hold the exact cost from your credit; if your available credit is too low you get 402 insufficient_credit and nothing starts.
curl -s https://api.zilapi.com/v1/audio/denoise \
-H "Authorization: Bearer $ZILAPI_KEY" \
-H "Content-Type: application/json" \
-d '{"file": "'"$FILE_ID"'", "model": "zilapi/nr-4.1"}' \
> job.json
JOB_ID=$(jq -r .id job.json) # job_7Hq2xV9mKp4RWait for the job, then download the MP3
Poll every few seconds while the job is queued or processing. When it has succeeded, ask for a fresh download URL (valid for 1 hour). Results are kept for 7 days after the job succeeds.
while :; do
STATUS=$(curl -s https://api.zilapi.com/v1/jobs/$JOB_ID -H "Authorization: Bearer $ZILAPI_KEY" | jq -r .status)
case "$STATUS" in queued|processing) sleep 5 ;; *) break ;; esac
done
echo "$STATUS" # succeeded
curl -s https://api.zilapi.com/v1/jobs/$JOB_ID/output -H "Authorization: Bearer $ZILAPI_KEY" > output.json
curl -o "$(jq -r .filename output.json)" "$(jq -r .url output.json)"The big-file flow in one file
The same five calls as one script you can copy and run. There is nothing to install beyond requests for Python; the TypeScript version uses the fetch built into Node.
curl -s https://api.zilapi.com/v1/files \
-H "Authorization: Bearer $ZILAPI_KEY" \
-H "Content-Type: application/json" \
-d '{"filename": "talk.wav", "size_bytes": '"$(wc -c < talk.wav)"', "content_type": "audio/wav"}' \
> upload.json
FILE_ID=$(jq -r .id upload.json) # file_3Lm8QpZ2rT6w
mapfile -t HEADERS < <(jq -r '.upload.headers | to_entries[] | "-H", "\(.key): \(.value)"' upload.json)
curl -X PUT "$(jq -r .upload.url upload.json)" "${HEADERS[@]}" --data-binary @talk.wav
curl -s -X POST https://api.zilapi.com/v1/files/$FILE_ID/complete \
-H "Authorization: Bearer $ZILAPI_KEY"
while :; do
FILE_STATUS=$(curl -s https://api.zilapi.com/v1/files/$FILE_ID -H "Authorization: Bearer $ZILAPI_KEY" | jq -r .status)
[ "$FILE_STATUS" != "validating" ] && break
sleep 2
done
echo "$FILE_STATUS" # ready
curl -s https://api.zilapi.com/v1/audio/denoise \
-H "Authorization: Bearer $ZILAPI_KEY" \
-H "Content-Type: application/json" \
-d '{"file": "'"$FILE_ID"'", "model": "zilapi/nr-4.1"}' \
> job.json
JOB_ID=$(jq -r .id job.json) # job_7Hq2xV9mKp4R
while :; do
STATUS=$(curl -s https://api.zilapi.com/v1/jobs/$JOB_ID -H "Authorization: Bearer $ZILAPI_KEY" | jq -r .status)
case "$STATUS" in queued|processing) sleep 5 ;; *) break ;; esac
done
echo "$STATUS" # succeeded
curl -s https://api.zilapi.com/v1/jobs/$JOB_ID/output -H "Authorization: Bearer $ZILAPI_KEY" > output.json
curl -o "$(jq -r .filename output.json)" "$(jq -r .url output.json)"Next steps
- Webhooks: endpoints for every event, signatures, retries and test pings.
- Vocal Separation and Speech Enhancement: the other two audio tasks.
- Files: URL inputs, direct uploads, uploads over 100 MB in parts, limits and retention.
- Jobs: the lifecycle, polling guidance, canceling and outputs.
- Errors: every error code, what it means and what to do.
- Pricing & billing: billing by the millisecond, each model's minimum and receipts.
- API reference: every endpoint and field, from the OpenAPI spec.