Create an AI dubbing job to translate and dub a video into another language. The request accepts an array of jobs, each defining the source video, source/target languages, dubbing options (voice cloning, lipsync, background sound handling) and quality tier.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
POST /aiworkflow
Create an AI dubbing (voiceover) for a video through the AI workflow endpoint. Dubbing is produced by the same /aiworkflow endpoint used for transcription and translation — the type field and a few flags decide what gets generated.
AuthorizationAll requests require a valid Panda API token in the
Authorizationheader (noBearerprefix).
Dubbing depends on the video's subtitles
TRANSLATIONand standaloneDUBBINGrequire a source subtitle infrom_langto already exist on the video. On a video that has no subtitle yet, both return400 "You need to create a from_lang subtitle first".To dub a video from scratch (audio only, no subtitle yet), use
type: "TRANSCRIPTION"withgenerate_dubbing: true— it transcribes the audio first and then dubs, in a single request.
Choosing the workflow type
| Goal | type | Needs an existing subtitle? | Key fields |
|---|---|---|---|
| Dub a video from scratch (recommended) | TRANSCRIPTION | No — it creates the subtitle | from_lang, generate_dubbing: true, background_sound_mode, additional_langs |
| Translate an existing subtitle and dub it | TRANSLATION | Yes (from_lang subtitle) | from_lang, to_lang, generate_dubbing: true, background_sound_mode |
| Dub an existing subtitle (no translation) | DUBBING | Yes (from_lang subtitle) | from_lang, voice_id, background_sound_mode |
Important: in theTRANSCRIPTIONflow the dubbing/translation targets come fromadditional_langs, not fromto_lang.generate_dubbing: trueis what turns a transcription/translation into a dubbing — without it you only get subtitles. Whenevergenerate_dubbingistrue,background_sound_modeis required.
HTTP Method & Path
POST /aiworkflow
Base URL: https://api-v2.pandavideo.com.br
Authentication Requirements
- Security Scheme:
PandaAuth(apiKey) - Header:
Authorization: <your_api_token>(no Bearer prefix)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Authorization | header | string | Yes | Panda API token (without Bearer prefix) |
Request Body
Content-Type: application/json
The body may be a single job object or an array of job objects (submit several jobs in one request). Unknown fields are rejected (additionalProperties: false).
Body Parameters (per item)
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Workflow type: TRANSCRIPTION, TRANSLATION, DUBBING or ALL_TEXT_ITEMS. |
video_id | string (uuid v4) | Yes | ID of the source video. |
from_lang | string | Conditional | Source language (e.g. pt-BR, en, es). Required for TRANSCRIPTION/TRANSLATION; may be "auto" to auto-detect. For DUBBING it identifies the existing subtitle to dub. |
to_lang | string | Conditional | Target language. Required for TRANSLATION. Not used by DUBBING. |
additional_langs | array | No | Targets for the TRANSCRIPTION flow. Array of objects { "lang": "en", "voice_id": "..." } (voice_id optional). Each item is translated and, when generate_dubbing is true, dubbed. |
generate_dubbing | boolean | No | When true, also generates a dubbing track. Requires background_sound_mode. Without it, the job only produces subtitles. |
background_sound_mode | string | Conditional | How background sound is handled. Only value: "ai". Required when generate_dubbing is true. |
voice_id | string | No | Voice used for the dubbing (e.g. a cloned voice). Omit to let the backend choose. |
clone_original_voice | boolean | No | Clone the original speaker's voice. |
num_speakers | integer | No | Number of speakers, 0–10. 0 auto-detects. |
is_lipsync | boolean | No | Enable lipsync. Not supported for videos longer than 60 minutes. |
enable_dynamic_duration | boolean | No | Allow dynamic duration adjustment. |
enhance_voice_quality | boolean | No | Apply voice quality enhancement. |
remove_background_music | boolean | No | Remove background music from the original audio. |
replace_existing_subtitles | boolean | No | Replace existing subtitles with the newly synced ones. |
tier | string | Conditional | Quality tier: essential, pro or advanced. Required for TRANSCRIPTION/TRANSLATION unless generate_dubbing is true. |
ctx | string | No | Optional context passed to the model. |
Example — dub from scratch (TRANSCRIPTION + dubbing)
Use this for a video that has no subtitle yet. It transcribes pt-BR and dubs into English and Spanish in one request.
[
{
"type": "TRANSCRIPTION",
"video_id": "5a3b5516-b08f-4f94-8143-3e7e84fddd6b",
"from_lang": "pt-BR",
"generate_dubbing": true,
"background_sound_mode": "ai",
"tier": "essential",
"num_speakers": 0,
"clone_original_voice": true,
"additional_langs": [
{ "lang": "en" },
{ "lang": "es" }
]
}
]Example — translate an existing subtitle and dub it (TRANSLATION)
Requires a from_lang subtitle already on the video.
[
{
"type": "TRANSLATION",
"video_id": "5a3b5516-b08f-4f94-8143-3e7e84fddd6b",
"from_lang": "pt-BR",
"to_lang": "en",
"generate_dubbing": true,
"background_sound_mode": "ai",
"tier": "essential",
"clone_original_voice": true
}
]Example — dub an existing subtitle (DUBBING)
Requires a from_lang subtitle already on the video. No translation.
[
{
"type": "DUBBING",
"video_id": "5a3b5516-b08f-4f94-8143-3e7e84fddd6b",
"from_lang": "pt-BR",
"background_sound_mode": "ai",
"voice_id": "your_voice_id",
"num_speakers": 0
}
]Response
Success Response (200)
The endpoint returns the accepted job with a generated id. Processing is asynchronous — track progress with the workflow listing endpoint. When you submit a single object the response is a single object; when you submit an array the response is an array (one item per accepted job).
{
"id": "3048a34f-5d3a-4244-89d9-f9072ccc682a",
"type": "TRANSCRIPTION",
"video_id": "5a3b5516-b08f-4f94-8143-3e7e84fddd6b",
"from_lang": "pt-BR",
"generate_dubbing": true,
"background_sound_mode": "ai",
"tier": "essential",
"additional_langs": [
{ "lang": "en" },
{ "lang": "es" }
]
}Response Schema
| Field | Type | Description |
|---|---|---|
id | string (uuid) | Generated workflow job ID. |
type | string | Workflow type that was accepted. |
video_id | string (uuid) | Source video ID. |
... | — | The remaining fields echo the job you submitted (from_lang, to_lang, generate_dubbing, additional_langs, dubbing options, etc.). |
Important: the dubbing and translation sub-jobs (one peradditional_langsentry) are created and processed asynchronously. Poll the workflow listing endpoint to follow their status.
Error Responses
- 400 Bad Request — validation error. Common cases:
"You need to create a from_lang subtitle first"—TRANSLATION/DUBBINGon a video without the source subtitle."You need to delete the to_lang subtitle first"— the target subtitle already exists."Subtitles already exist for this lang, please delete them first"— transcription for a language that already has a subtitle."background_sound_mode is required when generate_dubbing is true"."tier is required for TRANSCRIPTION"/"... for TRANSLATION"(whengenerate_dubbingis false)."Lipsync is not supported for videos longer than 60 minutes"."There is already a dubbing/translation/transcription in progress for this video"."Not enough credits".
- 404 Not Found — source video not found.
- 500 Internal Server Error — server-side error.
Example Usage
cURL
curl -X POST \
'https://api-v2.pandavideo.com.br/aiworkflow' \
-H 'Authorization: your_api_token_here' \
-H 'Content-Type: application/json' \
-d '[
{
"type": "TRANSCRIPTION",
"video_id": "5a3b5516-b08f-4f94-8143-3e7e84fddd6b",
"from_lang": "pt-BR",
"generate_dubbing": true,
"background_sound_mode": "ai",
"tier": "essential",
"num_speakers": 0,
"clone_original_voice": true,
"additional_langs": [
{ "lang": "en" },
{ "lang": "es" }
]
}
]'