API调用通用域名
1.创建文生视频任务请求示例
cURL 请求示例
curl -X POST 'https://open-api.wondershare.cc/v1/open/capacity/application/tob_text2video_b' \
--header 'X-App-Key: {app-key}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic {access_token}' \
--data '{
"prompt":"跳舞",
"duration": 5,
"resolution": "1080p",
"aspect_ratio": "16:9"
}'
响应数据
|
字段 |
是否必须 |
类型 |
默认值 |
备注 |
|
code |
YES |
number |
|
状态码 |
|
msg |
YES |
string |
|
请求信息 |
|
data |
YES |
string |
|
响应数据 |
|
├─ task_id |
非必须 |
string |
任务id |
{
"code": 0,
"msg": "",
"data": {
"task_id": "tm_text2video_customize-0-2025080109295bd73652d4"
}
}
2.获取文生视频结果请求示例
cURL 请求示例
curl -X POST 'https://open-api.wondershare.cc/v1/open/pub/task' \
--header 'Content-Type: application/json' \
--header 'X-App-Key: {app-key}' \
--header 'Authorization: Basic {access_token}' \
--data '{
"task_id": "tm_text2video_customize-0-2025080109295bd73652d4"
}'
返回结果数据
|
名称 |
类型 |
是否必须 |
默认值 |
备注 |
|
code |
number |
必须 |
|
即Task结构体中的ErrCode字段,0-成功,非0-失败,非0错误统一以68开头,6位数字,例如680001 |
|
msg |
string |
必须 |
|
信息 |
|
data |
object |
必须 |
|
数据 |
|
├─ task_id |
string |
必须 |
|
任务id |
|
├─ wsid |
number |
非必须 |
|
|
|
├─priority |
number |
非必须 |
|
|
|
├─ status |
number |
必须 |
|
状态: 1-排队中(待处理/未处理) 2-处理中 3-处理成功 4-处理失败 5-已关闭(已取消) 6-已超时 |
|
├─reason |
string |
非必须 |
|
status对应的原因 |
|
├─process |
number |
非必须 |
|
进度 |
|
├─ position |
number |
非必须 |
|
|
|
├─wait_time |
number |
非必须 |
|
|
|
├─params |
string |
非必须 |
|
|
|
├─ result |
string |
必须 |
|
任务执行结果,JSON字符串 |
获取结果示例
{
"code": 0,
"msg": "success",
"data": {
"task_id": "tm_text2video_customize-0-2025080109295bd73652d4",
"wsid": 123,
"priority": 0,
"status": 3,
"reason": "success",
"progress": 100,
"position": -1,
"wait_time": 96,
"delay": false,
"params": "",
"result": "{\"model_version\":\"L0-15899\",\"translate_prompt\":\"跳舞\",\"video_path\":[\"http://tic-ai-storage.wondershare.com/aicloudtmp%2F433223946%2F3%2F202508%2F1%2Ftm_vsr-20250808150129-2614613-44094-dwt.mp4?Expires=1754809290\&OSSAccessKeyId=LTAI5tFi5sAjeq28CgJWweCQ\&Signature=keG7bxVrOAYw19lfgWrO7JxpTBI%3F\"]}"
}
}