The resources (image, video, voice) generated by our API are valid for 7 days. Please save the relevant resources as soon as possible to prevent expiration.

Get Language List Result

GET https://openapi.akool.com/api/open/v3/language/list

Request Headers

ParameterValueDescription
AuthorizationBearer tokenYour API Key used for request authorization. You can get from https://openapi.akool.com/api/open/v3/getToken api.

Response Attributes

ParameterTypeValueDescription
codeint1000Interface returns business status code(1000:success)
msgStringOKInterface returns status information
dataArray{ lang_list:[ {"lang_code":"en", "lang_name": "English" } ]}lang_code: Lang code supported by video translation

Example

Request

Response

{
    "code": 1000,
    "msg": "OK",
    "data": {
        "lang_list": [
            {
                "lang_code": "en",
                "lang_name": "English",
                "url": "https://d11fbe263bhqij.cloudfront.net/agicontent/video/icons/En.png"
            },
            {
                "lang_code": "fr",
                "lang_name": "French",
                "url": "https://d11fbe263bhqij.cloudfront.net/agicontent/video/icons/Fr.png"
            },
            {
                "lang_code": "zh",
                "lang_name": "Chinese (Simplified)",
                "url": "https://d11fbe263bhqij.cloudfront.net/agicontent/video/icons/Zh.png"
            }
    ]
}

Create video translation

POST https://openapi.akool.com/api/open/v3/content/video/createbytranslate

Request Headers

ParameterValueDescription
AuthorizationBearer tokenYour API Key used for request authorization. You can get from https://openapi.akool.com/api/open/v3/getToken api.

Body Attributes

ParameterTypeValueDescription
urlStringThe video url address you want to translate.
source_languageStringThe original language of the video.
languageStringThe language you want to translate into.
lipsyncBooleantrue/falseGet synchronized mouth movements with the audio track in a translated video.
merge_intervalNumber1The segmentation interval of video translation, the default is 1 second.
face_enhanceBooleantrue/falseWhether to facial process the translated video, this parameter only works when lipsync is true.
webhookUrlStringCallback url address based on HTTP request.

Response Attributes

ParameterTypeValueDescription
codeint1000Interface returns business status code(1000:success)
msgStringInterface returns status information
dataObject{ "_id": "", "video_status": 1, "video": "" }id: Interface returns data, video_status: the status of video: [1:queueing, 2:processing, 3:completed, 4:failed], video: the url of Generated video

Example

Body

{
  "url": "https://drz0f01yeq1cx.cloudfront.net/1710470596011-facebook.mp4", //  The video address you want to translate
  "language": "hi", // The language you want to translate into
  "source_language": "zh", // The original language of the video.
  "lipsync": true, //  Get synchronized mouth movements with the audio track in a translated video.
  "merge_interval": 1,
  "face_enhance": true, //  Whether to facial process the translated video, this parameter only works when lipsync is true.
  "webhookUrl": "http://localhost:3007/api/open/v3/test/webhook" //  Callback url address based on HTTP request
}

Request

Response

{
  "code": 1000,
  "msg": "OK",
  "data": {
    "create_time": 1710757900382,
    "uid": 101690,
    "type": 8,
    "sub_type": 801,
    "from": 2,
    "target_video": "https://drz0f01yeq1cx.cloudfront.net/1710470596011-facebook.mp4",
    "source_language": "zh",
    "language": "hi",
    "faceswap_quality": 2,
    "video_id": "16db4826-e090-4169-861a-1de5de809a33",
    "video_status": 1, // current status of video: 【1:queueing(The requested operation is being processed),2:processing(The requested operation is being processing),3:completed(The request operation has been processed successfully),4:failed(The request operation processing failed, the reason for the failure can be viewed in the video translation details.)】
    "video_lock_duration": 11.7,
    "deduction_lock_duration": 20,
    "external_video": "",
    "video": "https://drz0f01yeq1cx.cloudfront.net/1710487405274-252239be-3411-4084-9e84-bf92eb78fbba-2031.mp4", // the url of Generated video
    "storage_loc": 1,
    "webhookUrl": "http://localhost:3007/api/open/v3/test/webhook",
    "task_id": "65f8180c4116596c1592edfb",
    "target_video_md5": "64fd4b47695945e94f0181b2a2fe5bb1",
    "pre_video_id": "",
    "lipsync": true,
    "lipSyncType": true,
    "_id": "65f8180c24d9989e93dde3b6",
    "__v": 0
  }
}

Get Video Info Result

GET https://openapi.akool.com/api/open/v3/content/video/infobymodelid?video_model_id=64dd838cf0b6684651e90217

Request Headers

ParameterValueDescription
AuthorizationBearer tokenYour API Key used for request authorization. You can get from https://openapi.akool.com/api/open/v3/getToken api.

Query Attributes

ParameterTypeValueDescription
video_model_idStringNULLvideo db id: You can get it based on the _id field returned by https://openapi.akool.com/api/open/v3/content/video/createbytranslate .

Response Attributes

ParameterTypeValueDescription
codeint1000Interface returns business status code(1000:success)
msgStringOKInterface returns status information
dataObject{ video_status:1, _id:"", video:"" }video_status: the status of video:【1:queueing, 2:processing, 3:completed, 4:failed】 video: Generated video resource url _id: Interface returns data

Example

Request

Response

{
  "code": 1000,
  "msg": "OK",
  "data": {
    "faceswap_quality": 2,
    "storage_loc": 1,
    "_id": "64dd92c1f0b6684651e90e09",
    "create_time": 1692242625334,
    "uid": 378337,
    "type": 2,
    "from": 1,
    "video_id": "0acfed62e24f4cfd8801c9e846347b1d",
    "video_lock_duration": 7.91,
    "deduction_lock_duration": 10,
    "video_status": 2, // current status of video: 【1:queueing(The requested operation is being processed),2:processing(The requested operation is being processing),3:completed(The request operation has been processed successfully),4:failed(The request operation processing failed, the reason for the failure can be viewed in the video translation details.)】
    "external_video": "",
    "lipsync_video_url": "", //if you set lipsync = true, you can use lipsync_video_url
    "video": "" //  Generated video resource url
  }
}

Response Code Description

Please note that if the value of the response code is not equal to 1000, the request is failed or wrong

ParameterValueDescription
code1000Success
code1003Parameter error or Parameter can not be empty
code1008The content you get does not exist
code1009You do not have permission to operate
code1101Invalid authorization or The request token has expired
code1102Authorization cannot be empty
code1200The account has been banned
code1201create audio error, please try again later
code1202The same video cannot be translated lipSync in the same language more than 1 times
code1203video should be with audio
code1204Your video duration is exceed 60s!
code1205Create video error, please try again later
code1207The video you are using exceeds the size limit allowed by the system by 300M
code1209Please upload a video in another encoding format
code1210The video you are using exceeds the value allowed by the system by 30fp