Pular para o conteúdo

API

Este conteúdo não está disponível em sua língua ainda.

Introduction

  1. Get API Key
    Head over to your Dublab account page, On the bottom of the page, you will see the component below. Click on Create Api Key button to obtain an API key.

  2. API Keys
  3. Initialize a project
    Make a POST request to our /init-dub endpoint with your API key in the ApiKey header. The endpoint will return id and uploadUrl which are required parameters in the next step. You can check the details for /init-dub here

  4. Upload your video to Dublab S3 Bucket
    Make a PUT request to uploadUrl with your video. Click here for more details.

  5. Start the dubbing process
    Make a POST request to /start-dub endpoint along with the id you received in the 3rd step. Click here for more details.

  6. 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

HeaderValueRequired
ApiKeyDUBLAB_API_KEY
Content-Typeapplication/json

📥 Request Body

FieldTypeDescriptionRequired
dest_langstringTarget language code (e.g., en)
fileTypestringMIME type of the input video file
namestringOriginal file name
source_langstringSource language code or "auto"
durationnumberDuration of the video in seconds

📑 Example Request

Terminal window
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"
}'

📦 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

HeaderValueRequired
Content-Typevideo/mp4

📥 Request Body

FieldTypeDescriptionRequired
FileFile you want to upload

📑 Example Request

Terminal window
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'

📦 Example Response

null



POST /start-dub

Starts the dubbing process for a previously initialized job.


🔐 Headers

HeaderValueRequired
ApiKeyDUBLAB_API_KEY
Content-Typeapplication/json

📥 Request Body

FieldTypeDescriptionRequired
idstringThe job ID returned from /init-dub

📑 Example Request

Terminal window
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"
}'

📦 Example Response

{ "status": "success" }



GET /dubs

Fetches the list of dubbing jobs.


🔐 Headers

HeaderValueRequired
ApiKeyDUBLAB_API_KEY

📑 Example requests

Terminal window
curl --location 'https://api.dublab.app/v1/dubs' \
--header 'ApiKey: $DUBLAB_API_KEY' \

📦 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:

CodeLanguage
enEnglish
esSpanish
frFrench
deGerman
ptPortuguese
trTurkish
ruRussian
itItalian
nlDutch
plPolish
arArabic

OpenAPI Spec

openapi: 3.0.0
info:
title: Dublab API
version: 1.0.0
paths:
/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>
}
}
}
}