API
Bu içerik henüz dilinizde mevcut değil.
Introduction
-
Get API Key
Head over to your Dublab account page, On the bottom of the page, you will see the component below. Click onCreate Api Key
button to obtain an API key. -
API Keys
-
Initialize a project
Make a POST request to our/init-dub
endpoint with your API key in theApiKey
header. The endpoint will returnid
anduploadUrl
which are required parameters in the next step. You can check the details for/init-dub
here -
Upload your video to Dublab S3 Bucket
Make a PUT request touploadUrl
with your video. Click here for more details. -
Start the dubbing process
Make a POST request to/start-dub
endpoint along with theid
you received in the 3rd step. Click here for more details. -
Check statuses
Check the statuses of your uploaded videos by making a GET request to/dubs
. Click here for more details.
API Details
POST /init-dub
Initiate a dubbing job for a video file.
🔐 Headers
Header | Value | Required |
---|---|---|
ApiKey | DUBLAB_API_KEY | ✅ |
Content-Type | application/json | ✅ |
📥 Request Body
Field | Type | Description | Required |
---|---|---|---|
dest_lang | string | Target language code (e.g., en ) | ✅ |
fileType | string | MIME type of the input video file | ✅ |
name | string | Original file name | ✅ |
source_lang | string | Source language code or "auto" | |
duration | number | Duration of the video in seconds |
📑 Example Request
curl --location 'https://api.dublab.app/v1/init-dub' \--header 'ApiKey: [YOUR-DUBLAB-API-KEY]' \--header 'Content-Type: application/json' \--data '{ "dest_lang": "en", "duration": 30, "fileType": "video/mp4", "name": "video4.mp4", "source_lang": "auto"}'
fetch('https://api.dublab.app/v1/init-dub', { method: 'POST', headers: { ApiKey: DUBLAB_API_KEY, 'Content-Type': 'application/json' }, body: JSON.stringify({ dest_lang: 'en', duration: 30, fileType: 'video/mp4', name: 'video4.mp4', source_lang: 'auto' })});
import requestsimport json
url = 'https://api.dublab.app/v1/init-dub'headers = { 'ApiKey': DUBLAB_API_KEY, 'Content-Type': 'application/json'}data = { 'dest_lang': 'en', 'duration': 30, 'fileType': 'video/mp4', 'name': 'video4.mp4', 'source_lang': 'auto'}
response = requests.post(url, headers=headers, json=data)
📦 Example Response
{ "id": "cmaf4v8oq0000p78tv92ztw2s", "createdAt": "2025-05-08T08:56:42.170Z", "userId": "123e4567-e89b-12d3-a456-426614174000", "name": "video.mp4", "type": "video/mp4", "key": "123e4567-e89b-12d3-a456-426614174000/00000000-0000-4000-8000-000000000000.mp4", "uploadUrl": "https://dubbing-app.s3.us-east-1.amazonaws.com/123e4567-e89b-12d3-a456-426614174000/00000000-0000-4000-8000-000000000000.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAEXAMPLEX2DM4SNUK%2F20250508%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250508T085642Z&X-Amz-Expires=3600&X-Amz-Signature=261635670bc08569944725bdcb60ff1e7d12c807de8f21129ef9ceaf5c15f4f5&X-Amz-SignedHeaders=host&x-id=PutObject", "source_lang": "auto", "dest_lang": "es", "internalStatusId": 1, "externalStatusId": 1, "progressPercentage": 0, "duration": 30, "errorMessage": null, "externalErrorMessage": null, "isWatermark": true, "source": "api"}
PUT Upload video
Upload video to Dublab S3 Bucket.
🔐 Headers
Header | Value | Required |
---|---|---|
Content-Type | video/mp4 | ✅ |
📥 Request Body
Field | Type | Description | Required |
---|---|---|---|
File | File you want to upload | ✅ |
📑 Example Request
curl --location --request PUT 'https://dubbing-app.s3.us-east-1.amazonaws.com/<user-id>/<file-id>.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAZFKTFPGX2DM4SNUK%2F20250504%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250504T221013Z&X-Amz-Expires=3600&X-Amz-Signature=<signature>&X-Amz-SignedHeaders=host&x-id=PutObject' --header 'Content-Type: video/mp4' \ --data-binary '@path/to/your/video.mp4'
fetch('https://dubbing-app.s3.us-east-1.amazonaws.com/<user-id>/<file-id>.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAZFKTFPGX2DM4SNUK%2F20250504%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250504T221013Z&X-Amz-Expires=3600&X-Amz-Signature=<signature>&X-Amz-SignedHeaders=host&x-id=PutObject', { method: 'PUT', headers: { 'Content-Type': 'video/mp4', }, body: fileStream,});
import requests
with open("path/to/your/video.mp4", "rb") as f:response = requests.put("https://dubbing-app.s3.us-east-1.amazonaws.com/<user-id>/<file-id>.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAZFKTFPGX2DM4SNUK%2F20250504%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250504T221013Z&X-Amz-Expires=3600&X-Amz-Signature=<signature>&X-Amz-SignedHeaders=host&x-id=PutObject",headers={"Content-Type": "video/mp4"},data=f)
📦 Example Response
null
POST /start-dub
Starts the dubbing process for a previously initialized job.
🔐 Headers
Header | Value | Required |
---|---|---|
ApiKey | DUBLAB_API_KEY | ✅ |
Content-Type | application/json | ✅ |
📥 Request Body
Field | Type | Description | Required |
---|---|---|---|
id | string | The job ID returned from /init-dub | ✅ |
📑 Example Request
curl --location 'https://api.dublab.app/v1/start-dub' \--header 'ApiKey: $DUBLAB_API_KEY' \--header 'Content-Type: application/json' \--data '{ "id": "retrieved-id-from-dublab"}'
fetch('https://api.dublab.app/v1/start-dub', { method: 'POST', headers: { 'ApiKey': DUBLAB_API_KEY, 'Content-Type': 'application/json' }, body: JSON.stringify({ id: 'retrieved-id-from-dublab' })})
import requestsimport json
url = 'https://api.dublab.app/v1/start-dub'headers = { 'ApiKey': DUBLAB_API_KEY, 'Content-Type': 'application/json'}data = { 'id': 'retrieved-id-from-dublab'}
response = requests.post(url, headers=headers, data=json.dumps(data))
📦 Example Response
{ "status": "success" }
GET /dubs
Fetches the list of dubbing jobs.
🔐 Headers
Header | Value | Required |
---|---|---|
ApiKey | DUBLAB_API_KEY | ✅ |
📑 Example requests
curl --location 'https://api.dublab.app/v1/dubs' \--header 'ApiKey: $DUBLAB_API_KEY' \
fetch('https://api.dublab.app/v1/dubs', { method: 'GET', headers: { 'ApiKey': DUBLAB_API_KEY }})
import requests
url = 'https://api.dublab.app/v1/dubs'headers = { 'ApiKey': DUBLAB_API_KEY}
response = requests.get(url, headers=headers)
📦 Example Response
[ { "id": "cjdgh0v9f0000pt7qf6d6sm9d", "createdAt": "2025-05-08T08:56:42.170Z", "userId": "user-1111aaaa-2222-bbbb-3333-cccc4444dddd", "name": "video4.mp4", "type": "video/mp4", "key": "user-1111aaaa-2222-bbbb-3333-cccc4444dddd/vid-aaaabbbb-cccc-dddd-eeee-ffff00001111.mp4", "uploadUrl": "https://example-bucket.s3.us-east-1.amazonaws.com/user-1111aaaa-2222-bbbb-3333-cccc4444dddd/vid-aaaabbbb-cccc-dddd-eeee-ffff00001111.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAEXAMPLE%2F20250508%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250508T085642Z&X-Amz-Expires=3600&X-Amz-Signature=EXAMPLESIGNATURE123&X-Amz-SignedHeaders=host&x-id=PutObject", "source_lang": "auto", "dest_lang": "es", "internalStatusId": 5, "externalStatusId": 3, "progressPercentage": 50, "duration": 30, "errorMessage": null, "externalErrorMessage": null, "isWatermark": true, "source": "api", "internalStatus": { "id": 5, "name": "Process - Translation", "alias": "process_translation" }, "externalStatus": { "id": 3, "name": "Processing", "alias": "processing" } }, { "id": "cjdgh0v9f0000pt7qf6d6sm9e", "createdAt": "2025-05-07T16:02:20.294Z", "userId": "user-1111aaaa-2222-bbbb-3333-cccc4444dddd", "name": "video4.mp4", "type": "video/mp4", "key": "user-1111aaaa-2222-bbbb-3333-cccc4444dddd/vid-1111ffff-2222-eeee-3333-dddd00009999.mp4", "uploadUrl": "https://example-bucket.s3.us-east-1.amazonaws.com/user-1111aaaa-2222-bbbb-3333-cccc4444dddd/vid-1111ffff-2222-eeee-3333-dddd00009999.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAEXAMPLE%2F20250507%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250507T160220Z&X-Amz-Expires=3600&X-Amz-Signature=EXAMPLESIGNATURE456&X-Amz-SignedHeaders=host&x-id=PutObject", "source_lang": "auto", "dest_lang": "es", "internalStatusId": 10, "externalStatusId": 5, "progressPercentage": 0, "duration": 30, "errorMessage": null, "externalErrorMessage": null, "isWatermark": true, "source": "api", "internalStatus": { "id": 10, "name": "Completed", "alias": "completed" }, "externalStatus": { "id": 5, "name": "Completed", "alias": "completed" } }]
Supported Languages
The following language codes are supported:
Code | Language |
---|---|
en | English |
es | Spanish |
fr | French |
de | German |
pt | Portuguese |
tr | Turkish |
ru | Russian |
it | Italian |
nl | Dutch |
pl | Polish |
ar | Arabic |
OpenAPI Spec
openapi: 3.0.0info: title: Dublab API version: 1.0.0paths: /init-dub: post: summary: Initialize a new dub task requestBody: required: true content: application/json: schema: type: object properties: dest_lang: type: string enum: [en, es, fr, de, pt, tr, ru, it, nl, pl, ar] duration: type: integer description: Duration of the video in seconds fileType: type: string enum: [video/mp4] name: type: string source_lang: type: string enum: [auto, en, es, fr, de, pt, tr, ru, it, nl, pl, ar] required: - dest_lang - duration - fileType - name - source_lang responses: '200': description: Dub initialized successfully content: application/json: schema: type: object properties: id: type: string createdAt: type: string format: date-time userId: type: string name: type: string type: type: string enum: [video/mp4] key: type: string uploadUrl: type: string source_lang: type: string enum: [auto, en, es, fr, de, pt, tr, ru, it, nl, pl, ar] dest_lang: type: string enum: [en, es, fr, de, pt, tr, ru, it, nl, pl, ar] internalStatusId: type: integer enum: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] externalStatusId: type: integer enum: [1, 2, 3, 4, 5] progressPercentage: type: number format: float duration: type: integer errorMessage: type: object externalErrorMessage: type: object isWatermark: type: boolean source: type: string enum: [api] /start-dub: post: summary: Start processing a dub task requestBody: required: true content: application/json: schema: type: object properties: id: type: string required: - id responses: '200': description: Dub started successfully content: application/json: schema: type: object properties: status: type: string enum: [success] /dubs: get: summary: List all dubs responses: '200': description: A list of dubs content: application/json: schema: type: array items: type: object properties: id: type: string createdAt: type: string format: date-time userId: type: string name: type: string type: type: string enum: [video/mp4] key: type: string uploadUrl: type: string source_lang: type: string enum: [auto, en, es, fr, de, pt, tr, ru, it, nl, pl, ar] dest_lang: type: string enum: [en, es, fr, de, pt, tr, ru, it, nl, pl, ar] internalStatusId: type: integer enum: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] externalStatusId: type: integer enum: [1, 2, 3, 4, 5] progressPercentage: type: number format: float duration: type: integer errorMessage: type: object externalErrorMessage: type: object isWatermark: type: boolean source: type: string enum: [web]
TypeScript Types
namespace Dublab { export type Language = 'en' | 'es' | 'fr' | 'de' | 'pt' | 'tr' | 'ru' | 'it' | 'nl' | 'pl' | 'ar'; export type SupportedMimeTypes = 'video/mp4';
/* STATUSES */ export type InternalStatusId = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; export type ExternalStatusId = 1 | 2 | 3 | 4 | 5; export type ExternalStatuses = { 1: { name: 'Uploading'; alias: 'uploading' }; 2: { name: 'In Queue'; alias: 'in_queue' }; 3: { name: 'Processing'; alias: 'processing' }; 4: { name: 'Failed'; alias: 'failed' }; 5: { name: 'Completed'; alias: 'completed' }; };
export type InternalStatuses = { 1: { name: 'Uploading S3'; alias: 'uploading_s3' }; 2: { name: 'Process - Audio Extraction'; alias: 'process_audio_extraction' }; 3: { name: 'Process - Speech Isolation'; alias: 'process_speech_isolation' }; 4: { name: 'Process - Audio Transcription'; alias: 'process_transcription' }; 5: { name: 'Process - Translation'; alias: 'process_translation' }; 6: { name: 'Process - Voice Cloning'; alias: 'process_voice_cloning' }; 7: { name: 'Process - Audio Video Merge'; alias: 'process_audio_video_merge' }; 8: { name: 'Upload Result Files'; alias: 'uploading_result_files' }; 9: { name: 'Failed'; alias: 'failed' }; 10: { name: 'Completed'; alias: 'completed' }; };
export type InternalStatusObject<ID extends InternalStatusId> = { id: ID; name: InternalStatuses[ID]['name']; alias: InternalStatuses[ID]['alias']; }; export type ExternalStatusObject<ID extends ExternalStatusId> = { id: ID; name: ExternalStatuses[ID]['name']; alias: ExternalStatuses[ID]['alias']; }; /* STATUSES */
export type Project = { id: string; createdAt: string; userId: string; name: SupportedMimeTypes; type: SupportedMimeTypes; key: string; uploadUrl: string; source_lang: 'auto' | Language; dest_lang: Language; internalStatusId: InternalStatusId; externalStatusId: ExternalStatusId; progressPercentage: number; duration: number; errorMessage: null; externalErrorMessage: null; isWatermark: boolean; source: 'web'; internalStatus: InternalStatusObject<InternalStatusId>; externalStatus: ExternalStatusObject<ExternalStatusId>; };
export interface Upload = { req: { body: File }, res: null }
export interface API = { post: { '/init-dub': { req: { dest_lang: Language; duration: number; // seconds fileType: 'video/mp4'; name: string; source_lang: 'auto' | Language; }, res: { id: string; createdAt: string; userId: string; name: SupportedMimeTypes; type: SupportedMimeTypes; key: string; uploadUrl: string; source_lang: 'auto' | Language; dest_lang: Language; internalStatusId: InternalStatusId; externalStatusId: ExternalStatusId; progressPercentage: number; duration: number; errorMessage: object; externalErrorMessage: object; isWatermark: boolean; source: 'api'; } }, '/start-dub': { req: { id: string }, res: { status: 'success' } } }, get: { '/dubs': { req: null, res: Array<Project> } } }}