Video Dubbing API¶
Translate the speech in a video and voice it in another language. The result is a new MP4: the video stream is untouched, only the audio is replaced.
Two modes:
voiceover(default) — TV-style voice-over: the original voice is heard for a moment, then stays quietly in the background while the translation is read by our dubbing voices (Bahodir, Sardor, Rustam, Malika, Dilnoza, Nilufar). A voice that matches each speaker's gender and age is picked automatically.dub— full dubbing: every speaker is voiced with a copy of their own voice. The price depends on the number of speakers.
Endpoint¶
Request Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
file |
file | Yes | Video with speech (MP4, MOV, MKV, WEBM) |
target_lang |
string | Yes | Language of the voice-over: uz, ru, en |
mode |
string | No | voiceover or dub. Default: voiceover |
voice_mp3 |
boolean | No | Also return an MP3 with only the translated voice. Default: false |
webhook_url |
string | No | URL for POST request with the result |
Limits¶
| Limit | Value |
|---|---|
| Max video length | 2 hours |
| Max file size | 2 GB |
Max speakers (dub mode) |
10 |
Notes:
- The request is always asynchronous: you get a task ID (
dub_...) right away. Poll Get Status or passwebhook_url. - Processing usually takes about 1–3× the video length.
- The source language is detected automatically. If the video is already in
target_lang, the task fails and nothing is charged.
Pricing¶
| Mode | Price |
|---|---|
voiceover |
50 UZS per second of video |
dub, 1–2 speakers |
120 UZS per second |
dub, 3–4 speakers |
180 UZS per second |
dub, 5–6 speakers |
250 UZS per second |
dub, 7–8 speakers |
300 UZS per second |
dub, 9–10 speakers |
350 UZS per second |
- Before the task is accepted, the balance is checked against the lowest price
for the mode (
estimated_cost). - The exact price is charged once the speakers are counted. If anything fails after that, the money is returned.
Example Request¶
curl -X POST "https://developer.kotib.ai/api/v1/dub" \
-H "Authorization: Bearer <api-key>" \
-F "file=@interview.mp4" \
-F "target_lang=uz" \
-F "mode=voiceover" \
-F "voice_mp3=true" \
-F "webhook_url=https://example.com/webhook"
Example Response (202)¶
{
"status": "processing",
"id": "dub_5f0c8a3e-1b2d-4c5e-9f7a-0a1b2c3d4e5f",
"duration": 95.4,
"price_per_second": 50.0,
"estimated_cost": 4770,
"message": "Dubbing scheduled. Poll /get-status or await webhook (if provided)."
}
Result¶
GET /api/v1/get-status/dub_... (and the webhook body) when the task is done:
{
"status": "completed",
"result": {
"text": "[00:01] Speaker 1: Assalomu alaykum...\n[00:05] Speaker 2: ...",
"video_url": "https://developer.kotib.ai/media/results/dub_..._uz.mp4",
"audio_url": "https://developer.kotib.ai/media/results/dub_..._uz_voice.mp3",
"mode": "voiceover",
"source_lang": "ru",
"speakers": 2,
"duration": 95.4,
"cost": 4770
}
}
| Field | Description |
|---|---|
text |
Translated script with timecodes and speakers |
video_url |
Dubbed MP4 |
audio_url |
Translated voice only (MP3), when voice_mp3=true |
speakers |
Number of speakers found |
cost |
Charged amount, UZS |
The webhook body is {"task_id": "dub_...", "status": "completed", "result": {...}}.
On failure it is sent with "status": "failed" and the reason in result.text.
Errors¶
| Code | When |
|---|---|
invalid_video |
The file is not a readable video or has no audio track |
video_too_long |
The video is longer than 2 hours |
insufficient_balance |
Balance is lower than estimated_cost |
Task-level failures (status failed, reason in result.text): no speech found,
video already in target_lang, too many speakers for dub mode, insufficient
balance for the exact price.