Dubbing API

View as Markdown

Sarvam’s Dubbing API seamlessly translates your audio and video content into every language you target. By leveraging state-of-the-art voice cloning technology, it delivers broadcast-ready dubs while preserving the original vocal identity of every speaker.

It is part of Content Agents, and is the programmatic equivalent of the Dubbing workspace in Creator Studio.

Base URL and authentication. See the API Reference for the current base URL and auth header. Generate a key from Key Management in the dashboard.

What one job gives you

A single job dubs into every target language you list, and produces every format in export_options for each of them. You never need one job per language. In the REST body the language fields are src_lang / target_langs; in the Python SDK they are source_language_code / target_language_codes.

How it works

Dubbing is asynchronous by design: you create a job, upload to it, start it, then follow it to completion rather than waiting on a single request. Every integration is the same five steps.

1

Create the job

POST /jobs with your languages and options. Returns a job_id and a short-lived signed upload_url. The job sits at not_started until you start it.

2

Upload the media

PUT the raw file bytes to upload_url. This step is required, because the create call does not accept the file itself.

3

Start the pipeline

POST /jobs/{job_id}/start moves the job to queued, and a worker picks it up as in_progress.

4

Poll progress

GET /jobs/{job_id}/live-status for a progress percentage and the current pipeline step.

5

Fetch downloads

GET /jobs/{job_id}/export-status for one signed download_url per (language, format).

Runnable code for each individual call, in cURL and seven other languages, is on that call’s page in the API Reference.

Quickstart

Install the SDK with pip install sarvamai, set SARVAM_API_KEY, and point media at a local file. The client resolves the dubbing endpoint from its default environment, so your API key is the only configuration it needs.

1import os
2from pathlib import Path
3from sarvamai import SarvamAI
4
5client = SarvamAI(api_subscription_key=os.environ["SARVAM_API_KEY"])
6
7media = Path("sample.mp4")
8
9created = client.dubbing.create(
10 source_language_code="en-IN",
11 target_language_codes=["hi-IN", "ta-IN"],
12 export_options=["video", "srt"],
13 voice_cloning=True,
14 num_speakers=1,
15 job_name=media.name,
16)
17
18client.dubbing.upload(created.data.upload_url, media)
19client.dubbing.start(job_id=created.data.job_id)
20
21print(created.data.job_id)

That job is now running. See Job Lifecycle for the polling loop that carries it to downloadable files.

What you can upload

KindFormats
VideoMP4, MOV, MKV, WebM, AVI, FLV, WMV
AudioWAV, MP3, M4A

The file must be at least one second long and contain audible speech, since there has to be something to transcribe. Maximum size and duration depend on your plan:

PlanMax file sizeMax duration
Starter2 GB1 hour
Pro3 GB1 hour
Business4 GB4 hours

Starter is the default, so those are the limits that apply unless your account is on a higher plan. On an Enterprise plan, check your limits with your account team. See Credits & Rate Limits for the rate limits that apply alongside these.

Pricing

Dubbing is billed per whole second of source media, multiplied by the number of target languages. On Starter, the default API rate is ₹40/min when editor_flow is false (the default).

Setting editor_flow: true doubles the cost to ₹80/min on Starter (₹75/min on Pro, ₹72/min on Enterprise). It also suppresses auto-export and is intended for the interactive editor workflow in Creator Studio — not for standard API integrations. See Pricing for the full rate table.

The format is detected from the file’s contents, not its name. The signed URL always ends in .mp4 — that is a storage detail, and uploading a .wav to it is fine.

Your media is checked after you call start, not while it uploads. Storage accepts whatever you send it, so an unsupported or corrupt file shows up as a failed job with the reason in error_message rather than as an error on the upload itself.

Uploading the media

client.dubbing.upload() handles the upload for you, including the x-ms-blob-type: BlockBlob header that the underlying storage requires. It accepts a path or an open binary file, and guesses the Content-Type from the filename.

The helper requires sarvamai 0.1.31a1 or newer.

upload_url is short-lived and unauthenticated. Check data.expires_in_hours and upload promptly; an expired URL returns 403 and needs a new job. Never send your API subscription key to the storage URL.

A completed job is not always downloadable yet, since exports can still be rendering. Confirm in export-status and pull entries whose own status is completed. Job Lifecycle has the details.

Explore

Need help scoping a dubbing integration? Reach out on Discord.