Generate AI subtitles (TRANSCRIPTION from audio or TRANSLATION of an existing subtitle) for a video.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
POST /aiworkflow
Generate AI subtitles for a video using artificial intelligence. This endpoint drives two subtitle operations, selected by the type field:
TRANSCRIPTION— generates a brand-new subtitle from the video audio (use when the video has no subtitle in the source language yet). Supports generating several languages at once viaadditional_langs.TRANSLATION— translates an existing subtitle into one or more target languages (use when the video already has a subtitle infrom_lang).
Both consume AI credits.
AuthorizationSend your API token in the
Authorizationheader. For sub-accounts, use the parent account's API token.
Parameters go in the JSON request body — not the query stringAll fields below are sent in the request body (
Content-Type: application/json). The body may be a single object or an array of objects (batch — used to translate into several languages in one call).
HTTP Method & Path
POST /aiworkflow
Base URL: https://api-v2.pandavideo.com.br
Authentication Requirements
| Security Scheme | Header | Note |
|---|---|---|
| apiKey | Authorization | Your API token (no "Bearer" prefix) |
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Your API token |
Request Body
Content-Type: application/json
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | Operation type. For subtitles: TRANSCRIPTION (from audio) or TRANSLATION (translate an existing subtitle). |
| video_id | string (uuid) | Yes | The video ID that will receive the subtitles. |
| from_lang | string | Yes* | Source language of the video/subtitle (e.g. pt-BR, en, es). Use auto to auto-detect (transcription). *Required for TRANSCRIPTION and TRANSLATION. |
| to_lang | string | Cond. | Target language. Required for TRANSLATION. Not used by TRANSCRIPTION (use additional_langs instead). |
| tier | string | Yes* | AI processing level: essential, pro or advanced. *Required for TRANSCRIPTION and TRANSLATION. |
| additional_langs | array<object> | No | (TRANSCRIPTION) Extra target languages generated in the same request. Array of objects, e.g. [{ "lang": "en" }, { "lang": "es" }] — not plain strings. |
Required fields depend ontype
typeandvideo_idare always required.from_langis required for both operations.to_langis required only forTRANSLATION.tieris required for both.
Operation modes
TRANSCRIPTION — create a subtitle from the audio
Send a single object with type: "TRANSCRIPTION", from_lang, tier, and (optionally) additional_langs for extra languages.
{
"type": "TRANSCRIPTION",
"video_id": "b5f1a2c3-....-uuid",
"from_lang": "pt-BR",
"tier": "essential",
"additional_langs": [{ "lang": "en" }, { "lang": "es" }]
}TRANSLATION — translate an existing subtitle
The body is an array, one object per target language. Each object needs to_lang.
[
{ "type": "TRANSLATION", "video_id": "b5f1a2c3-....-uuid", "from_lang": "pt-BR", "to_lang": "en", "tier": "essential" },
{ "type": "TRANSLATION", "video_id": "b5f1a2c3-....-uuid", "from_lang": "pt-BR", "to_lang": "es", "tier": "essential" }
]
Language codesBoth
from_lang/to_langaccept BCP-47-style codes:pt-BR,en,en-US,es,it,fr,de,ja,zh,hi,ko,nl,tr,pl,sv,ru,ar, and more.from_langalso acceptsauto(transcription only).
Response
Success Response (200)
Returns the created workflow item(s). Processing is asynchronous — the item starts in QUEUE/RUNNING and finishes later. Poll GET /aiworkflow?video_id={video_id} to track status.
{
"id": "work-uuid",
"video_id": "b5f1a2c3-....-uuid",
"type": "TRANSCRIPTION",
"status": "QUEUE",
"from_lang": "pt-BR",
"to_lang": null,
"metadata": {},
"created_at": "2026-07-03T12:00:00.000Z"
}Error Responses
- 400 Bad Request — missing/invalid field (e.g.
from_lang is required,to_lang is required for TRANSLATION,tier is required, invalid language code). - 401 Unauthorized — missing or invalid API token.
- 404 Not Found — video not found.
- 500 Internal Server Error — unexpected server error.
Example Usage
cURL — TRANSCRIPTION
curl --request POST \
--url https://api-v2.pandavideo.com.br/aiworkflow \
--header 'Authorization: <your_api_key>' \
--header 'Content-Type: application/json' \
--data '{"type":"TRANSCRIPTION","video_id":"<video_id>","from_lang":"pt-BR","tier":"essential","additional_langs":[{"lang":"en"}]}'cURL — TRANSLATION
curl --request POST \
--url https://api-v2.pandavideo.com.br/aiworkflow \
--header 'Authorization: <your_api_key>' \
--header 'Content-Type: application/json' \
--data '[{"type":"TRANSLATION","video_id":"<video_id>","from_lang":"pt-BR","to_lang":"en","tier":"essential"}]'