Getting Started with the DubLab API
Overview
The DubLab API lets you programmatically dub videos into 90+ languages without touching the web interface. Perfect for automating workflows, integrating into your CMS, or building custom dubbing pipelines.
The workflow is simple: create → upload → dub → poll.
Authentication
All requests require an API key in the apikey header:
curl -H "apikey: YOUR_API_KEY" https://dublab.app/api/v1/me
Generate your API key from the Account page under the API Keys section.
The 3-Step Dubbing Flow
Step 1: Initialize the Dub
Create a file record and get a presigned S3 upload URL:
curl -X POST https://dublab.app/api/v1/init-dub \
-H "apikey: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"fileType": "video/mp4",
"name": "my-video.mp4",
"source_lang": "en",
"dest_lang": "tr",
"duration": 67
}'
Response:
{
"file": {
"id": "ce14fea7-9c5b-4a57-...",
"name": "my-video.mp4",
"source": "api",
"externalStatusId": 1
},
"uploadUrl": "https://s3.eu-central-1.amazonaws.com/dublab-app-1/...signed-url..."
}
Step 2: Upload to S3
Upload your file directly to the presigned URL:
curl -X PUT \
-H "Content-Type: video/mp4" \
--data-binary @my-video.mp4 \
"PRESIGNED_URL_FROM_STEP_1"
This uploads directly to S3 — no size limits imposed by DubLab's servers.
Step 3: Start Dubbing
Trigger the AI pipeline:
curl -X POST https://dublab.app/api/v1/start-dub \
-H "apikey: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"fileId": "ce14fea7-9c5b-4a57-..."}'
Response:
{"success": true, "fileId": "ce14fea7-9c5b-4a57-..."}
That's it! The AI pipeline takes over: audio extraction → vocal separation → transcription → translation → voice cloning → final merge.
Checking Status
Poll your dubs to check progress:
curl -H "apikey: YOUR_API_KEY" https://dublab.app/api/v1/dubs
Look for externalStatusId:
- 1 — Created (waiting for upload)
- 2 — In Queue
- 3 — Processing
- 5 — Completed (ready to download)
- 6 — Failed
Python Example
import requests
import time
API_KEY = "your-api-key"
BASE = "https://dublab.app/api/v1"
HEADERS = {"apikey": API_KEY, "Content-Type": "application/json"}
# Step 1: Init
resp = requests.post(f"{BASE}/init-dub", headers=HEADERS, json={
"fileType": "video/mp4",
"name": "demo.mp4",
"source_lang": "en",
"dest_lang": "es",
"duration": 90
})
data = resp.json()
file_id = data["file"]["id"]
upload_url = data["uploadUrl"]
# Step 2: Upload
with open("demo.mp4", "rb") as f:
requests.put(upload_url, data=f, headers={"Content-Type": "video/mp4"})
# Step 3: Start
requests.post(f"{BASE}/start-dub", headers=HEADERS, json={"fileId": file_id})
# Step 4: Poll
while True:
dubs = requests.get(f"{BASE}/dubs", headers={"apikey": API_KEY}).json()
dub = next(d for d in dubs if d["id"] == file_id)
print(f"Progress: {dub['progressPercentage']}%")
if dub["externalStatusId"] == 5:
print("Done!")
break
if dub["externalStatusId"] == 6:
print(f"Failed: {dub.get('errorMessage')}")
break
time.sleep(10)
Node.js Example
const API_KEY = "your-api-key";
const BASE = "https://dublab.app/api/v1";
async function dubVideo(filePath, destLang) {
// Step 1: Init
const initRes = await fetch(`${BASE}/init-dub`, {
method: "POST",
headers: { apikey: API_KEY, "Content-Type": "application/json" },
body: JSON.stringify({
fileType: "video/mp4",
name: filePath.split("/").pop(),
source_lang: "auto",
dest_lang: destLang,
}),
});
const { file, uploadUrl } = await initRes.json();
// Step 2: Upload
const fs = await import("fs");
const videoData = fs.readFileSync(filePath);
await fetch(uploadUrl, {
method: "PUT",
headers: { "Content-Type": "video/mp4" },
body: videoData,
});
// Step 3: Start
await fetch(`${BASE}/start-dub`, {
method: "POST",
headers: { apikey: API_KEY, "Content-Type": "application/json" },
body: JSON.stringify({ fileId: file.id }),
});
console.log(`Dubbing started: ${file.id}`);
return file.id;
}
dubVideo("./my-video.mp4", "tr");
Credit Cost
- Standard quality: 1 credit per second of video (default)
- Studio quality: 2 credits per second (set
isStudioQuality: truein init-dub)
A 60-second video costs 60 credits (standard) or 120 credits (studio).
Next Steps
- Full API Reference — All endpoints, parameters, and error codes
- Studio vs Standard Quality — Choose the right quality mode
- Plans & Pricing — Get more credits