curl --request POST \
--url https://api.vmeg.ai/openapi/v1/task/media-translation/create-async \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Idempotency-Key: <x-idempotency-key>' \
--data '
{
"source": {
"materialId": "<string>"
},
"language": {
"target": "zh-CN",
"source": "auto"
},
"options": {
"voiceClone": {
"style": "emotional",
"mode": "role"
},
"transcribe": {
"mode": "fast",
"type": "default"
},
"translate": {
"mode": "default",
"prompt": "<string>"
},
"separation": {
"mode": "auto"
},
"dynamicVideoLength": {
"enable": true
},
"lipsync": {
"enable": false
},
"text": {},
"voiceSpeakers": {
"selectedVoicesList": [
{
"provider": "S1",
"voiceId": "<string>"
}
],
"speakerNum": "auto",
"timbreMethod": "clone"
}
},
"extraData": {}
}
'import requests
url = "https://api.vmeg.ai/openapi/v1/task/media-translation/create-async"
payload = {
"source": { "materialId": "<string>" },
"language": {
"target": "zh-CN",
"source": "auto"
},
"options": {
"voiceClone": {
"style": "emotional",
"mode": "role"
},
"transcribe": {
"mode": "fast",
"type": "default"
},
"translate": {
"mode": "default",
"prompt": "<string>"
},
"separation": { "mode": "auto" },
"dynamicVideoLength": { "enable": True },
"lipsync": { "enable": False },
"text": {},
"voiceSpeakers": {
"selectedVoicesList": [
{
"provider": "S1",
"voiceId": "<string>"
}
],
"speakerNum": "auto",
"timbreMethod": "clone"
}
},
"extraData": {}
}
headers = {
"X-Idempotency-Key": "<x-idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Idempotency-Key': '<x-idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
source: {materialId: '<string>'},
language: {target: 'zh-CN', source: 'auto'},
options: {
voiceClone: {style: 'emotional', mode: 'role'},
transcribe: {mode: 'fast', type: 'default'},
translate: {mode: 'default', prompt: '<string>'},
separation: {mode: 'auto'},
dynamicVideoLength: {enable: true},
lipsync: {enable: false},
text: {},
voiceSpeakers: {
selectedVoicesList: [{provider: 'S1', voiceId: '<string>'}],
speakerNum: 'auto',
timbreMethod: 'clone'
}
},
extraData: {}
})
};
fetch('https://api.vmeg.ai/openapi/v1/task/media-translation/create-async', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vmeg.ai/openapi/v1/task/media-translation/create-async",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'source' => [
'materialId' => '<string>'
],
'language' => [
'target' => 'zh-CN',
'source' => 'auto'
],
'options' => [
'voiceClone' => [
'style' => 'emotional',
'mode' => 'role'
],
'transcribe' => [
'mode' => 'fast',
'type' => 'default'
],
'translate' => [
'mode' => 'default',
'prompt' => '<string>'
],
'separation' => [
'mode' => 'auto'
],
'dynamicVideoLength' => [
'enable' => true
],
'lipsync' => [
'enable' => false
],
'text' => [
],
'voiceSpeakers' => [
'selectedVoicesList' => [
[
'provider' => 'S1',
'voiceId' => '<string>'
]
],
'speakerNum' => 'auto',
'timbreMethod' => 'clone'
]
],
'extraData' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Idempotency-Key: <x-idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vmeg.ai/openapi/v1/task/media-translation/create-async"
payload := strings.NewReader("{\n \"source\": {\n \"materialId\": \"<string>\"\n },\n \"language\": {\n \"target\": \"zh-CN\",\n \"source\": \"auto\"\n },\n \"options\": {\n \"voiceClone\": {\n \"style\": \"emotional\",\n \"mode\": \"role\"\n },\n \"transcribe\": {\n \"mode\": \"fast\",\n \"type\": \"default\"\n },\n \"translate\": {\n \"mode\": \"default\",\n \"prompt\": \"<string>\"\n },\n \"separation\": {\n \"mode\": \"auto\"\n },\n \"dynamicVideoLength\": {\n \"enable\": true\n },\n \"lipsync\": {\n \"enable\": false\n },\n \"text\": {},\n \"voiceSpeakers\": {\n \"selectedVoicesList\": [\n {\n \"provider\": \"S1\",\n \"voiceId\": \"<string>\"\n }\n ],\n \"speakerNum\": \"auto\",\n \"timbreMethod\": \"clone\"\n }\n },\n \"extraData\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Idempotency-Key", "<x-idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.vmeg.ai/openapi/v1/task/media-translation/create-async")
.header("X-Idempotency-Key", "<x-idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source\": {\n \"materialId\": \"<string>\"\n },\n \"language\": {\n \"target\": \"zh-CN\",\n \"source\": \"auto\"\n },\n \"options\": {\n \"voiceClone\": {\n \"style\": \"emotional\",\n \"mode\": \"role\"\n },\n \"transcribe\": {\n \"mode\": \"fast\",\n \"type\": \"default\"\n },\n \"translate\": {\n \"mode\": \"default\",\n \"prompt\": \"<string>\"\n },\n \"separation\": {\n \"mode\": \"auto\"\n },\n \"dynamicVideoLength\": {\n \"enable\": true\n },\n \"lipsync\": {\n \"enable\": false\n },\n \"text\": {},\n \"voiceSpeakers\": {\n \"selectedVoicesList\": [\n {\n \"provider\": \"S1\",\n \"voiceId\": \"<string>\"\n }\n ],\n \"speakerNum\": \"auto\",\n \"timbreMethod\": \"clone\"\n }\n },\n \"extraData\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vmeg.ai/openapi/v1/task/media-translation/create-async")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Idempotency-Key"] = '<x-idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source\": {\n \"materialId\": \"<string>\"\n },\n \"language\": {\n \"target\": \"zh-CN\",\n \"source\": \"auto\"\n },\n \"options\": {\n \"voiceClone\": {\n \"style\": \"emotional\",\n \"mode\": \"role\"\n },\n \"transcribe\": {\n \"mode\": \"fast\",\n \"type\": \"default\"\n },\n \"translate\": {\n \"mode\": \"default\",\n \"prompt\": \"<string>\"\n },\n \"separation\": {\n \"mode\": \"auto\"\n },\n \"dynamicVideoLength\": {\n \"enable\": true\n },\n \"lipsync\": {\n \"enable\": false\n },\n \"text\": {},\n \"voiceSpeakers\": {\n \"selectedVoicesList\": [\n {\n \"provider\": \"S1\",\n \"voiceId\": \"<string>\"\n }\n ],\n \"speakerNum\": \"auto\",\n \"timbreMethod\": \"clone\"\n }\n },\n \"extraData\": {}\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"message": "",
"data": {
"taskId": "<string>",
"taskType": "vt",
"status": "running",
"createdAt": "<string>"
}
}创建翻译配音任务
为已上传的视频或音频启动异步 翻译配音 流水线:识别语音 → 翻译文稿 → 生成 AI 配音(克隆或预设音色)→ 渲染输出。可通过 options 配置字幕与口型同步。HTTP 仅返回受理信息(taskId)。配音后视频/音频 URL 通过 Webhook 回调投递(event: openapi-media-translation)。
若请求音频翻译(taskType: at)但素材为视频,服务端可能按视频翻译(vt)执行 — 请以受理响应中的 taskType 为准。
curl --request POST \
--url https://api.vmeg.ai/openapi/v1/task/media-translation/create-async \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Idempotency-Key: <x-idempotency-key>' \
--data '
{
"source": {
"materialId": "<string>"
},
"language": {
"target": "zh-CN",
"source": "auto"
},
"options": {
"voiceClone": {
"style": "emotional",
"mode": "role"
},
"transcribe": {
"mode": "fast",
"type": "default"
},
"translate": {
"mode": "default",
"prompt": "<string>"
},
"separation": {
"mode": "auto"
},
"dynamicVideoLength": {
"enable": true
},
"lipsync": {
"enable": false
},
"text": {},
"voiceSpeakers": {
"selectedVoicesList": [
{
"provider": "S1",
"voiceId": "<string>"
}
],
"speakerNum": "auto",
"timbreMethod": "clone"
}
},
"extraData": {}
}
'import requests
url = "https://api.vmeg.ai/openapi/v1/task/media-translation/create-async"
payload = {
"source": { "materialId": "<string>" },
"language": {
"target": "zh-CN",
"source": "auto"
},
"options": {
"voiceClone": {
"style": "emotional",
"mode": "role"
},
"transcribe": {
"mode": "fast",
"type": "default"
},
"translate": {
"mode": "default",
"prompt": "<string>"
},
"separation": { "mode": "auto" },
"dynamicVideoLength": { "enable": True },
"lipsync": { "enable": False },
"text": {},
"voiceSpeakers": {
"selectedVoicesList": [
{
"provider": "S1",
"voiceId": "<string>"
}
],
"speakerNum": "auto",
"timbreMethod": "clone"
}
},
"extraData": {}
}
headers = {
"X-Idempotency-Key": "<x-idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Idempotency-Key': '<x-idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
source: {materialId: '<string>'},
language: {target: 'zh-CN', source: 'auto'},
options: {
voiceClone: {style: 'emotional', mode: 'role'},
transcribe: {mode: 'fast', type: 'default'},
translate: {mode: 'default', prompt: '<string>'},
separation: {mode: 'auto'},
dynamicVideoLength: {enable: true},
lipsync: {enable: false},
text: {},
voiceSpeakers: {
selectedVoicesList: [{provider: 'S1', voiceId: '<string>'}],
speakerNum: 'auto',
timbreMethod: 'clone'
}
},
extraData: {}
})
};
fetch('https://api.vmeg.ai/openapi/v1/task/media-translation/create-async', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vmeg.ai/openapi/v1/task/media-translation/create-async",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'source' => [
'materialId' => '<string>'
],
'language' => [
'target' => 'zh-CN',
'source' => 'auto'
],
'options' => [
'voiceClone' => [
'style' => 'emotional',
'mode' => 'role'
],
'transcribe' => [
'mode' => 'fast',
'type' => 'default'
],
'translate' => [
'mode' => 'default',
'prompt' => '<string>'
],
'separation' => [
'mode' => 'auto'
],
'dynamicVideoLength' => [
'enable' => true
],
'lipsync' => [
'enable' => false
],
'text' => [
],
'voiceSpeakers' => [
'selectedVoicesList' => [
[
'provider' => 'S1',
'voiceId' => '<string>'
]
],
'speakerNum' => 'auto',
'timbreMethod' => 'clone'
]
],
'extraData' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Idempotency-Key: <x-idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vmeg.ai/openapi/v1/task/media-translation/create-async"
payload := strings.NewReader("{\n \"source\": {\n \"materialId\": \"<string>\"\n },\n \"language\": {\n \"target\": \"zh-CN\",\n \"source\": \"auto\"\n },\n \"options\": {\n \"voiceClone\": {\n \"style\": \"emotional\",\n \"mode\": \"role\"\n },\n \"transcribe\": {\n \"mode\": \"fast\",\n \"type\": \"default\"\n },\n \"translate\": {\n \"mode\": \"default\",\n \"prompt\": \"<string>\"\n },\n \"separation\": {\n \"mode\": \"auto\"\n },\n \"dynamicVideoLength\": {\n \"enable\": true\n },\n \"lipsync\": {\n \"enable\": false\n },\n \"text\": {},\n \"voiceSpeakers\": {\n \"selectedVoicesList\": [\n {\n \"provider\": \"S1\",\n \"voiceId\": \"<string>\"\n }\n ],\n \"speakerNum\": \"auto\",\n \"timbreMethod\": \"clone\"\n }\n },\n \"extraData\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Idempotency-Key", "<x-idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.vmeg.ai/openapi/v1/task/media-translation/create-async")
.header("X-Idempotency-Key", "<x-idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source\": {\n \"materialId\": \"<string>\"\n },\n \"language\": {\n \"target\": \"zh-CN\",\n \"source\": \"auto\"\n },\n \"options\": {\n \"voiceClone\": {\n \"style\": \"emotional\",\n \"mode\": \"role\"\n },\n \"transcribe\": {\n \"mode\": \"fast\",\n \"type\": \"default\"\n },\n \"translate\": {\n \"mode\": \"default\",\n \"prompt\": \"<string>\"\n },\n \"separation\": {\n \"mode\": \"auto\"\n },\n \"dynamicVideoLength\": {\n \"enable\": true\n },\n \"lipsync\": {\n \"enable\": false\n },\n \"text\": {},\n \"voiceSpeakers\": {\n \"selectedVoicesList\": [\n {\n \"provider\": \"S1\",\n \"voiceId\": \"<string>\"\n }\n ],\n \"speakerNum\": \"auto\",\n \"timbreMethod\": \"clone\"\n }\n },\n \"extraData\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vmeg.ai/openapi/v1/task/media-translation/create-async")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Idempotency-Key"] = '<x-idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source\": {\n \"materialId\": \"<string>\"\n },\n \"language\": {\n \"target\": \"zh-CN\",\n \"source\": \"auto\"\n },\n \"options\": {\n \"voiceClone\": {\n \"style\": \"emotional\",\n \"mode\": \"role\"\n },\n \"transcribe\": {\n \"mode\": \"fast\",\n \"type\": \"default\"\n },\n \"translate\": {\n \"mode\": \"default\",\n \"prompt\": \"<string>\"\n },\n \"separation\": {\n \"mode\": \"auto\"\n },\n \"dynamicVideoLength\": {\n \"enable\": true\n },\n \"lipsync\": {\n \"enable\": false\n },\n \"text\": {},\n \"voiceSpeakers\": {\n \"selectedVoicesList\": [\n {\n \"provider\": \"S1\",\n \"voiceId\": \"<string>\"\n }\n ],\n \"speakerNum\": \"auto\",\n \"timbreMethod\": \"clone\"\n }\n },\n \"extraData\": {}\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"message": "",
"data": {
"taskId": "<string>",
"taskType": "vt",
"status": "running",
"createdAt": "<string>"
}
}请求体
回调
POSThttps://{yourWebhookUrl}taskCompleted
请求体
event 为 openapi-media-translation 时的媒体翻译 Webhook 请求体;data.result 为 CDN 交付物。
Webhook 中 event 为 openapi-media-translation 时,data 内的任务载荷(data.result 含 CDN 交付物)。
Show child attributes
Show child attributes
本次投递的业务结果码
200
任务的 API 版本号(如 v1、v2),与请求路径中的版本一致(如 /openapi/v1/...)。
"v1"
已完成的产品类型。请按此值路由:openapi-tts(TTS)、openapi-translate(文本翻译)、openapi-clone-voice(声音克隆)、openapi-media-translation(音视频翻译)。详见 Webhook 请求体。
openapi-tts, openapi-translate, openapi-clone-voice, openapi-media-translation "openapi-tts"
该次异步完成的稳定标识。请用此字段对接收端去重 — 见 Webhook 请求体。
"a1b2c3d4e5f6789012345678901234ab"
当 code 非成功时的说明
与异步提交请求中的 extraData 一致
响应
请尽快返回 2xx 以停止重试

