Prerequisites
- A DeepL API key with Voice Translate Job API access
- An audio file in a supported source format
curlandjq(for the shell examples below)
The four-step workflow
Every translation follows the same pattern: create a job, upload the file, poll for status, then download results.Step 1: Create the job
Send a POST request with your file metadata and translation targets. The response gives you anupload_url to put your file and a job_id to track progress.
If you are using a DeepL API Free account, replace
https://api.deepl.com with https://api-free.deepl.com in all requests.job_id and upload_url — you need both in the next step. You have 5 minutes to upload the file after creating the job; if you miss the window, the job expires and you must create a new one.
The content_length in the request must match the actual file size in bytes. A mismatch causes the upload to fail.
The curl snippets in Steps 1–4 are illustrative. They show each API call in isolation and do not automatically pass values (such as
job_id or upload_url) between steps. For a fully runnable end-to-end example that captures and threads these values automatically, see the complete shell script below.Step 2: Upload the source file
PUT your audio file directly to theupload_url from step 1. Set Content-Type to match the content_type you declared when creating the job.
pending to uploaded, and processing begins automatically.
The upload URL is pre-signed and single-use. Do not add the Authorization header to this request — it goes directly to object storage.
Step 3: Poll for job status
Check the job status by sending a GET request with yourjob_id. Each target in the results array has its own status field.
pending, uploaded, and processing. Terminal statuses are complete, failed, and downloaded.
When a target completes, its result includes a download_url:
Step 4: Download the results
Fetch each completed target using itsdownload_url. Save the output with an appropriate file extension for the content type.
Capture the poll response and extract each URL, then download each file separately:
Authorization header.
Once you download a result, the target transitions to downloaded. Results are deleted after download, or after 1 hour from when they became available — whichever comes first. After all targets are terminal, the job is deleted and returns 404 on subsequent status checks.
Verify the output
After the script completes, confirm the following:transcript-de.txtcontains readable German text — open the file and check that the transcript reflects the spoken content of your source audio.audio-es.pcmis a valid audio file — play it with a tool that accepts raw PCM (for example,ffplay -f s16le -ar 16000 -ac 1 audio-es.pcm) and confirm you hear Spanish speech.
Handling failures
A target’serror.message describes what went wrong, but won’t always be specific enough to act on directly. Common causes:
- Audio quality: very low bitrate or heavily distorted audio can cause processing to fail for a specific target
- Format mismatch: the declared
content_typedoesn’t match the actual file encoding - Quota: check your concurrent job limits if failures correlate with high submission volume
Complete shell script
This script ties all four steps together and polls until every target reaches a terminal state.translate_audio.sh
Next steps
- Check supported source audio formats, output formats, and limits before integrating into production
- See supported Voice languages for transcription and translation availability per language
- For live audio with low latency, see the Real-Time Voice Quickstart