Skip to content

Authentication

To authenticate with the API, you will need to provide your API key in the Authorization header of each request.

It should look like this:

Authorization: Bearer panjaya-{YOUR_API_KEY}

Languages support

Below is a list of supported languages and their corresponding locale codes that are used in Panjaya Dubbing Studio API. Please note that some languages are marked as source languages only, meaning they can only be used as the source language of the uploaded videos, while some are marked as target languages only - meaning they can only be translated into.

LanguageLocale codeSource supportedTarget supported
Arabicar-AE
Bulgarianbg-BG
Chinesezh-CN
Croatianhr-HR
Czechcs-CZ
Danishda-DK
Dutchnl-NL
Englishen-US
Filipinofil-PH
Finnishfi-FI
Frenchfr-FR
Germande-DE
Greekel-GR
Hebrewhe-IL🚫
Hindihi-IN
Hungarianhu-HU
Indonesianid-ID
Italianit-IT
Japaneseja-JP
Koreanko-KR
Lithuanianlt-LT
Malayms-MY
Norwegiannb-NO
Polishpl-PL
Portuguesept-BR
Portuguesept-PT
Romanianro-RO
Russianru-RU
Slovaksk-SK
Spanishes-ES
Spanishes-MX
Swedishsv-SE
Tamilta-IN
Turkishtr-TR
Ukrainianuk-UA
Vietnamesevi-VN

Error codes

Panjaya Dubbing Studio API uses standard HTTP status codes to indicate the success or failure of an API request. In case of an error, the response body will include a detailed error message to help you identify and resolve the issue.

Here is a list of erroneous HTTP status codes and their general meanings:

  • 401 Unauthorized: The API key could not be validated
  • 400 Bad Request: The request could not be processed due to invalid input
  • 403 Forbidden: The request could not be completed due to account limitations
  • 404 Not Found: The requested resource was not found
  • 500 Internal Server Error: An internal server error occurred
Overview
Languages
Servers

https://api.panjaya.ai/

Assets

Assets are the core resource in Panjaya Dubbing Studio. An asset represents a source video you want to dub into different languages. Each asset can be dubbed into multiple languages, and every language is assigned a unique dubbing ID. You can optionally add SRT files for better accuracy.

Operations

Request

Creating an asset is the first step to dubbing your video with Panjaya Dubbing Studio. This endpoint allows you to:

  • Upload a source video
  • Configure the necessary parameters to initiate the dubbing process

Uploading the Source Video

  • Use the media_url parameter to specify the publicly accessible URL of the source video you want to dub.
  • Set the locale field to indicate the original language of the source video.
  • It is recommended to set the speakers_count field to the number of distinct speakers in the video, to improve accuracy and quality of the final video.

Adding Target Languages

Define the languages into which you want to dub the video:

Panjaya's locale codes adhere to the IETF Language Tag standard, combining ISO 639-1 language codes and ISO 3166-1 country codes. Examples: en-US (English - United States), es-ES (Spanish - Spain), zh-CN (Chinese - China).

For each target language, you may optionally provide a valid SRT file, where applicable, in the designated srt field.

Trimming the Video

You can optionally use the start_time and end_time parameters to trim your video, allowing you to dub a specific section of your video.

Both parameters accept a number of seconds from the beginning of the video. For example, if you want to dub only the first 2 minutes of your video, set end_time to 120.

If not specified, start_time defaults to 0 (beginning of the video), and end_time defaults to the end of the video.

Status Updates via Callbacks

Optionally, you can configure a callback_url to receive real-time status updates about the dubbing process.

When a callback_url is specified, Panjaya will send updates whenever the status of an asset or any of its dubbing versions changes.

For detailed information on implementing callbacks, refer to the Callbacks section of this documentation.

Models

The lips_model field specifies which lips model to use when generating versions under this asset. This parameter is only applicable when lip correction is enabled. You can use it to fine-tune the balance between quality and performance.

  • real_face (Default): Our highest-quality lips model, suitable for most use cases.
  • real_face_turbo: Optimized for speed - up to 4× faster than real_face, while maintaining high quality.

Background Audio

Panjaya uses our SceneAware audio separation model to separate speech from background audio in the source video. This preserves the original background audio in the dubbed result, creating a more natural and immersive experience.

If you already have a clean background audio track (e.g., music and sound effects without speech), you can provide a publicly accessible URL to it via the background_url field. Panjaya will then use this track directly instead of separating background audio from the source video.

Security
api_key
Bodyapplication/jsonrequired
namestring[ 1 .. 255 ] charactersrequired

Display name of the dubbing project. Must not be empty. Names exceeding 255 characters will be automatically truncated.

localestring[ 5 .. 6 ] characters^[a-z]{2,3}-[A-Z]{2}$required

A locale code of a supported locale. If the locale is not supported, an error response of status 400 will be returned.

languagesArray of objectsrequired

List of languages to translate and dub the asset to

languages[].​localestring[ 5 .. 6 ] characters^[a-z]{2,3}-[A-Z]{2}$required

A locale code of a supported locale. If the locale is not supported, an error response of status 400 will be returned.

languages[].​srtstring or null

Optional reference SRT file contents. Must be in a valid SRT file format, otherwise, an error response of status 400 will be returned.

Any of:

Optional reference SRT file contents. Must be in a valid SRT file format, otherwise, an error response of status 400 will be returned.

string

Optional reference SRT file contents. Must be in a valid SRT file format, otherwise, an error response of status 400 will be returned.

callback_urlstring or null
Any of:

If specified, Panjaya will POST this url on dubbing status updates. Must be a valid, publicly accessible HTTPS URL.

[ 1 .. 2083 ] characters
string(uri)[ 1 .. 2083 ] characters

If specified, Panjaya will POST this url on dubbing status updates. Must be a valid, publicly accessible HTTPS URL.

speakers_countinteger or null

Number of speakers in the source video. If not specified, Panjaya will attempt to automatically detect the number of speakers in the video.

Any of:

Number of speakers in the source video. If not specified, Panjaya will attempt to automatically detect the number of speakers in the video.

[ 1 .. 35 ]
integer[ 1 .. 35 ]

Number of speakers in the source video. If not specified, Panjaya will attempt to automatically detect the number of speakers in the video.

start_timenumber or null

Trim the source video from this time (in seconds). Must be within the video's total duration, otherwise, the asset will fail with an error code of invalid_input. Defaults to the start of the video.

Any of:

Trim the source video from this time (in seconds). Must be within the video's total duration, otherwise, the asset will fail with an error code of invalid_input. Defaults to the start of the video.

>= 0
number>= 0

Trim the source video from this time (in seconds). Must be within the video's total duration, otherwise, the asset will fail with an error code of invalid_input. Defaults to the start of the video.

end_timenumber or null

Trim the source video to this time (in seconds). Must be greater than start_time, if provided, and within the video's total duration, otherwise, the asset will fail with an error code of invalid_input. Defaults to the end of the video.

Any of:

Trim the source video to this time (in seconds). Must be greater than start_time, if provided, and within the video's total duration, otherwise, the asset will fail with an error code of invalid_input. Defaults to the end of the video.

>= 0
number>= 0

Trim the source video to this time (in seconds). Must be greater than start_time, if provided, and within the video's total duration, otherwise, the asset will fail with an error code of invalid_input. Defaults to the end of the video.

auto_generatestring

If specified, Panjaya will generate the result video automatically, with or without synthesized lips according to the parameter's value. If not specified, Panjaya will not generate the result video automatically.

Default "off"
Enum"off""with_lips""no_lips"
source_srtstring or null

Optional reference SRT file contents. Recommended to be in a valid SRT file format, but other textual formats are also accepted.

Any of:

Optional reference SRT file contents. Recommended to be in a valid SRT file format, but other textual formats are also accepted.

string

Optional reference SRT file contents. Recommended to be in a valid SRT file format, but other textual formats are also accepted.

lips_modelstring or null
Any of:

The lips model to use. If not specified, Panjaya will use the default RealFace model.

string

The lips model to use. If not specified, Panjaya will use the default RealFace model.

Enum"real_face""real_face_turbo"
media_urlstring(uri)[ 1 .. 2083 ] charactersrequired

Public URL (can be temporary) of the source video

background_urlstring or null
Any of:

Optional public URL (can be temporary) of a background audio file to be used as background music in the result video.

[ 1 .. 2083 ] characters
string(uri)[ 1 .. 2083 ] characters

Optional public URL (can be temporary) of a background audio file to be used as background music in the result video.

application/json

Create a new asset with only required fields. Make sure to replace media URL with your own.

{ "name": "My Asset", "locale": "en-US", "languages": [ {} ], "media_url": "https://my.storage.service.com/my-video.mp4" }

Responses

Asset was created successfully

Bodyapplication/json
asset_idstringrequired
namestringrequired
localestring[ 5 .. 6 ] characters^[a-z]{2,3}-[A-Z]{2}$required

A locale code of a supported locale. If the locale is not supported, an error response of status 400 will be returned.

created_atstring(date-time)required
statusstringrequired
Enum"Dubbing""PendingReview""Ready""Failed"
languagesArray of objectsrequired
languages[].​dubbing_idstring or nullrequired
Any of:

Dubbing ID, if dubbing exists

string

Dubbing ID, if dubbing exists

languages[].​localestring[ 5 .. 6 ] characters^[a-z]{2,3}-[A-Z]{2}$required

A locale code of a supported locale. If the locale is not supported, an error response of status 400 will be returned.

languages[].​versionsArray of objectsrequired
languages[].​versions[].​version_idstringrequired
durationnumber or nullrequired

Duration of the source video in seconds. The field may be null while the asset is processing.

Any of:

Duration of the source video in seconds. The field may be null while the asset is processing.

>= 0
number>= 0

Duration of the source video in seconds. The field may be null while the asset is processing.

errorobject or null
Any of:

In case of an error while processing the asset, the asset status will be Failed, and this field contains helpful information for identifying the issue.

Response
application/json
{ "asset_id": "7b9b9e3c3c7e322aec4c3d9b", "name": "My Asset", "locale": "en-US", "created_at": "2021-08-10T12:00:00Z", "status": "Dubbing", "languages": [ {} ] }

Request

Upload an asset video file directly to Panjaya Dubbing Studio.

This endpoint allows you to upload a video file directly, saving the need to upload to an external storage service. It accepts the same parameters as the Create Asset endpoint, except for the media_url parameter, which is replaced by the video file input.

Note that this endpoint is structured as a multipart/form-data request, where the request form field contains a JSON-serialized object with the asset parameters, and the video form field contains the video file to be uploaded.

You may additionally provide a background file to upload a clean background audio track. Refer to Background Audio section under create asset endpoint.

Security
api_key
Bodymultipart/form-datarequired
requestobjectrequired

A JSON object that accepts the same configuration as creating an asset (except for the media_url field).

request.​namestring[ 1 .. 255 ] charactersrequired

Display name of the dubbing project. Must not be empty. Names exceeding 255 characters will be automatically truncated.

request.​localestring[ 5 .. 6 ] characters^[a-z]{2,3}-[A-Z]{2}$required

A locale code of a supported locale. If the locale is not supported, an error response of status 400 will be returned.

request.​languagesArray of objectsrequired

List of languages to translate and dub the asset to

request.​languages[].​localestring[ 5 .. 6 ] characters^[a-z]{2,3}-[A-Z]{2}$required

A locale code of a supported locale. If the locale is not supported, an error response of status 400 will be returned.

request.​languages[].​srtstring or null

Optional reference SRT file contents. Must be in a valid SRT file format, otherwise, an error response of status 400 will be returned.

Any of:

Optional reference SRT file contents. Must be in a valid SRT file format, otherwise, an error response of status 400 will be returned.

string

Optional reference SRT file contents. Must be in a valid SRT file format, otherwise, an error response of status 400 will be returned.

request.​callback_urlstring or null
Any of:

If specified, Panjaya will POST this url on dubbing status updates. Must be a valid, publicly accessible HTTPS URL.

[ 1 .. 2083 ] characters
string(uri)[ 1 .. 2083 ] characters

If specified, Panjaya will POST this url on dubbing status updates. Must be a valid, publicly accessible HTTPS URL.

request.​speakers_countinteger or null

Number of speakers in the source video. If not specified, Panjaya will attempt to automatically detect the number of speakers in the video.

Any of:

Number of speakers in the source video. If not specified, Panjaya will attempt to automatically detect the number of speakers in the video.

[ 1 .. 35 ]
integer[ 1 .. 35 ]

Number of speakers in the source video. If not specified, Panjaya will attempt to automatically detect the number of speakers in the video.

request.​start_timenumber or null

Trim the source video from this time (in seconds). Must be within the video's total duration, otherwise, the asset will fail with an error code of invalid_input. Defaults to the start of the video.

Any of:

Trim the source video from this time (in seconds). Must be within the video's total duration, otherwise, the asset will fail with an error code of invalid_input. Defaults to the start of the video.

>= 0
number>= 0

Trim the source video from this time (in seconds). Must be within the video's total duration, otherwise, the asset will fail with an error code of invalid_input. Defaults to the start of the video.

request.​end_timenumber or null

Trim the source video to this time (in seconds). Must be greater than start_time, if provided, and within the video's total duration, otherwise, the asset will fail with an error code of invalid_input. Defaults to the end of the video.

Any of:

Trim the source video to this time (in seconds). Must be greater than start_time, if provided, and within the video's total duration, otherwise, the asset will fail with an error code of invalid_input. Defaults to the end of the video.

>= 0
number>= 0

Trim the source video to this time (in seconds). Must be greater than start_time, if provided, and within the video's total duration, otherwise, the asset will fail with an error code of invalid_input. Defaults to the end of the video.

request.​auto_generatestring

If specified, Panjaya will generate the result video automatically, with or without synthesized lips according to the parameter's value. If not specified, Panjaya will not generate the result video automatically.

Default "off"
Enum"off""with_lips""no_lips"
request.​source_srtstring or null

Optional reference SRT file contents. Recommended to be in a valid SRT file format, but other textual formats are also accepted.

Any of:

Optional reference SRT file contents. Recommended to be in a valid SRT file format, but other textual formats are also accepted.

string

Optional reference SRT file contents. Recommended to be in a valid SRT file format, but other textual formats are also accepted.

request.​lips_modelstring or null
Any of:

The lips model to use. If not specified, Panjaya will use the default RealFace model.

string

The lips model to use. If not specified, Panjaya will use the default RealFace model.

Enum"real_face""real_face_turbo"
videostring(binary)required

Video file to upload. Maximum size is 5GB.

backgroundstring or null(binary)

Optional background audio file to upload. Maximum size is 500MB.

Any of:

Optional background audio file to upload. Maximum size is 500MB.

string(binary)

Optional background audio file to upload. Maximum size is 500MB.

multipart/form-data
{
  "request": {
    "languages": [
      {
        "locale": "es-ES"
      }
    ],
    "locale": "en-US",
    "name": "My Asset"
  },
  "video": "string"
}

Responses

Asset was created successfully

Bodyapplication/json
asset_idstringrequired
namestringrequired
localestring[ 5 .. 6 ] characters^[a-z]{2,3}-[A-Z]{2}$required

A locale code of a supported locale. If the locale is not supported, an error response of status 400 will be returned.

created_atstring(date-time)required
statusstringrequired
Enum"Dubbing""PendingReview""Ready""Failed"
languagesArray of objectsrequired
languages[].​dubbing_idstring or nullrequired
Any of:

Dubbing ID, if dubbing exists

string

Dubbing ID, if dubbing exists

languages[].​localestring[ 5 .. 6 ] characters^[a-z]{2,3}-[A-Z]{2}$required

A locale code of a supported locale. If the locale is not supported, an error response of status 400 will be returned.

languages[].​versionsArray of objectsrequired
languages[].​versions[].​version_idstringrequired
durationnumber or nullrequired

Duration of the source video in seconds. The field may be null while the asset is processing.

Any of:

Duration of the source video in seconds. The field may be null while the asset is processing.

>= 0
number>= 0

Duration of the source video in seconds. The field may be null while the asset is processing.

errorobject or null
Any of:

In case of an error while processing the asset, the asset status will be Failed, and this field contains helpful information for identifying the issue.

Response
application/json
{ "asset_id": "7b9b9e3c3c7e322aec4c3d9b", "name": "My Asset", "locale": "en-US", "created_at": "2021-08-10T12:00:00Z", "status": "Dubbing", "languages": [ {} ] }

Request

After creating an asset - either through the Panjaya Dubbing Studio API or by uploading it via the Panjaya Dubbing Studio web interface - you can easily fetch detailed information about the asset by specifying its asset ID.

This endpoint allows you to access key metadata, including the asset's current status, associated dubbings, and available versions.

Asset processing failures

In case of an error while processing the asset, the asset status will be Failed, and the error field in this endpoint's response will contain helpful information for identifying the issue.

It contains an error code and a detailed error message to help you understand and resolve the issue. Here is a list of common error codes for assets:

  • invalid_input: The input provided is invalid. Ensure all provided fields match the asset's properties.
  • unsupported_media: We didnt find a valid video stream in the media file.
  • empty_transcript: No spoken content was identified in the uploaded video.
  • missing_audio_track: No audio tracks were found in the source video.
  • video_duration_limit_reached: The video duration limit for your account has been reached.
  • video_size_limit_reached: The file size of the requested video has exceeded the allowed size limit.
  • time_out_of_range: The provided start_time or end_time is out of video range. Ensure that the timestamps are within the video duration.
Security
api_key
Path
asset_idstringrequired
No request payload

Responses

Asset found successfully

Bodyapplication/json
asset_idstringrequired
namestringrequired
localestring[ 5 .. 6 ] characters^[a-z]{2,3}-[A-Z]{2}$required

A locale code of a supported locale. If the locale is not supported, an error response of status 400 will be returned.

created_atstring(date-time)required
statusstringrequired
Enum"Dubbing""PendingReview""Ready""Failed"
languagesArray of objectsrequired
languages[].​dubbing_idstring or nullrequired
Any of:

Dubbing ID, if dubbing exists

string

Dubbing ID, if dubbing exists

languages[].​localestring[ 5 .. 6 ] characters^[a-z]{2,3}-[A-Z]{2}$required

A locale code of a supported locale. If the locale is not supported, an error response of status 400 will be returned.

languages[].​versionsArray of objectsrequired
languages[].​versions[].​version_idstringrequired
durationnumber or nullrequired

Duration of the source video in seconds. The field may be null while the asset is processing.

Any of:

Duration of the source video in seconds. The field may be null while the asset is processing.

>= 0
number>= 0

Duration of the source video in seconds. The field may be null while the asset is processing.

errorobject or null
Any of:

In case of an error while processing the asset, the asset status will be Failed, and this field contains helpful information for identifying the issue.

Response
application/json
{ "asset_id": "7b9b9e3c3c7e322aec4c3d9b", "name": "My Asset", "locale": "en-US", "created_at": "2021-08-10T12:00:00Z", "status": "Ready", "languages": [ {} ], "duration": 123.45 }

Add languages to an existing asset

Request

With this endpoint, you can add new languages to an existing asset. Once you make the request, Panjaya will initiate a new dubbing process for each added language.

Once the process is complete, you will be notified via email and the callback URL, if configured.

Security
api_key
Path
asset_idstringrequired
Bodyapplication/jsonrequired
languagesArray of objectsrequired

List of languages to translate and dub the asset to

languages[].​localestring[ 5 .. 6 ] characters^[a-z]{2,3}-[A-Z]{2}$required

A locale code of a supported locale. If the locale is not supported, an error response of status 400 will be returned.

languages[].​srtstring or null

Optional reference SRT file contents. Must be in a valid SRT file format, otherwise, an error response of status 400 will be returned.

Any of:

Optional reference SRT file contents. Must be in a valid SRT file format, otherwise, an error response of status 400 will be returned.

string

Optional reference SRT file contents. Must be in a valid SRT file format, otherwise, an error response of status 400 will be returned.

auto_generatestring

If specified, Panjaya will generate the result video automatically, with or without synthesized lips according to the parameter's value. If not specified, Panjaya will not generate the result video automatically.

Default "off"
Enum"off""with_lips""no_lips"
application/json
{ "languages": [ {} ], "auto_generate": "off" }

Responses

Languages added successfully

Bodyapplication/json
asset_idstringrequired
namestringrequired
localestring[ 5 .. 6 ] characters^[a-z]{2,3}-[A-Z]{2}$required

A locale code of a supported locale. If the locale is not supported, an error response of status 400 will be returned.

created_atstring(date-time)required
statusstringrequired
Enum"Dubbing""PendingReview""Ready""Failed"
languagesArray of objectsrequired
languages[].​dubbing_idstring or nullrequired
Any of:

Dubbing ID, if dubbing exists

string

Dubbing ID, if dubbing exists

languages[].​localestring[ 5 .. 6 ] characters^[a-z]{2,3}-[A-Z]{2}$required

A locale code of a supported locale. If the locale is not supported, an error response of status 400 will be returned.

languages[].​versionsArray of objectsrequired
languages[].​versions[].​version_idstringrequired
durationnumber or nullrequired

Duration of the source video in seconds. The field may be null while the asset is processing.

Any of:

Duration of the source video in seconds. The field may be null while the asset is processing.

>= 0
number>= 0

Duration of the source video in seconds. The field may be null while the asset is processing.

errorobject or null
Any of:

In case of an error while processing the asset, the asset status will be Failed, and this field contains helpful information for identifying the issue.

Response
application/json
{ "asset_id": "7b9b9e3c3c7e322aec4c3d9b", "name": "My Asset", "locale": "en-US", "created_at": "2021-08-10T12:00:00Z", "status": "Dubbing", "languages": [ {}, {} ], "duration": 123.45 }

Versions

After upload, an initial version of the dub is automatically created for each language. You can create additional versions for each language to act as snapshots in time as you edit or to edit independently, with each version identified by a unique version ID.

Operations

Callbacks

Learn how to use a callback URL to receive real-time status updates about the dubbing process.

Webhooks