Skip to main content
POST
POST /v1/audio/dubbing translates the speech in a video or audio file into another language and re-voices it. Dubbing runs as an asynchronous task: submit the job, poll GET /v1/tasks/{id}, then download the dubbed file from GET /v1/tasks/{id}/content. Output has no watermark.
string
required
Set to eleven-dubbing-v1.
string
required
Public http or https URL of the video or audio to dub, 50 MB or smaller. SnapGen downloads it once, measures its length for billing, and sends that same file to the provider.
string
required
The language to dub into, as a code from the language list, for example es.
string
default:"auto"
The language spoken in the source, from the same list. auto detects it.
integer
Number of speakers, from 0 to 32. 0 detects it automatically.
boolean
Uses the highest available resolution for video output.
boolean
Drops the background audio from the dub. This can help speeches and monologues that shouldn’t carry a background track.
string
Optional public https URL that receives one signed event when the task reaches a final state. See Task webhooks.
string
Required with webhook: 16 to 256 characters, used to sign the delivery.
Send the body as JSON. Add an Idempotency-Key header (1 to 200 characters) so that a retried submission returns the same task instead of starting a second, billed job.

Source files

SnapGen downloads the source once, measures its length from the media itself (never from a declared duration), and uploads that exact file to the provider. The source must be 50 MB or smaller and in MP4, MOV, WebM, MP3, WAV, M4A, AAC, FLAC, or OGG. If its length can’t be read, the request fails with unsupported_audio_format and nothing is charged.

Languages

target_language takes one of these 32 codes. source_language takes the same codes or auto.

Submit a task

A successful submission returns HTTP 202 with a task object whose status is queued. The Location header holds /v1/tasks/{id}, and x-gateway-task-id holds the task ID. Save the ID with your job record.

Poll the task

Poll GET /v1/tasks/{id} every 10 to 20 seconds until status is succeeded or failed, or pass webhook to be notified instead. When the task succeeds, result describes the dub:
string
The download path, /v1/tasks/{id}/content.
string
The language of the dub.
string | null
The source language the provider used or detected.
string | null
The media type the provider reports, such as video/mp4. Treat it as a hint: it can be missing, and the download’s own Content-Type is authoritative.
boolean | null
Whether the dub is a video, derived from content_type.
number | null
The dub’s length when the provider reports it.
string[]
Always empty for dubbing. Download the file from the content endpoint.

Download the dub

GET /v1/tasks/{id}/content streams the dubbed file with the same API key. The response carries the file’s Content-Type (an audio/ or video/ type) and Content-Disposition: attachment, for example filename="dubbed-es.mp4". Send a Range header to resume a partial download. Before the task succeeds, the endpoint returns HTTP 409 with task_not_ready.

Billing

The job is billed for the measured length of the source at $0.0125 per second, rounded up to whole seconds after a 0.1-second allowance. The gateway reserves that amount at submission and settles it when the task succeeds. A 61.2-second clip bills 62 seconds ($0.775); a 30-minute source costs $22.50. Failed tasks release the reservation and aren’t charged.

Errors

A task that fails at the provider reports status: "failed" with error.code provider_task_failed. See Errors for rate limits and other failures.