#提交任务(即梦格式)
与即梦官方接口结构一致,提交与查询都请求 POST /jimeng/,靠查询参数 Action 区分:
#端点
POST /jimeng/?Action=CVSync2AsyncSubmitTask&Version=2022-08-31
#请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
req_key | string | 是 | 模型标识(文生 / 图生取值不同,如 jimeng_vgfm_t2v_l20,以模型广场为准) |
prompt | string | 是 | 视频描述 |
binary_data_base64 | string[] | 否 | 图生视频:Base64 图片数组 |
image_urls | string[] | 否 | 图生视频:图片 URL 数组 |
aspect_ratio | string | 否 | 画面比例 |
#请求示例
cURL
Python
Node.js
# 提交文生视频任务
curl -X POST "https://api-model.shuntianchuang.cn/jimeng/?Action=CVSync2AsyncSubmitTask&Version=2022-08-31" \
-H "Authorization: Bearer sk-你的令牌" \
-H "Content-Type: application/json" \
-d '{
"req_key": "jimeng_vgfm_t2v_l20",
"prompt": "一只橘猫在草地上追蝴蝶,电影感镜头"
}'import requests
BASE = "https://api-model.shuntianchuang.cn"
resp = requests.post(
f"{BASE}/jimeng/?Action=CVSync2AsyncSubmitTask&Version=2022-08-31",
headers={
"Authorization": "Bearer sk-你的令牌",
"Content-Type": "application/json",
},
json={
"req_key": "jimeng_vgfm_t2v_l20",
"prompt": "一只橘猫在草地上追蝴蝶,电影感镜头",
},
)
task = resp.json()
print(task["id"], task.get("status")) # 记住任务 ID 用于轮询
# 图生视频:req_key 换成图生模型(以模型广场为准),
# 并在 json 中加 "image_urls": ["https://example.com/first-frame.jpg"]const resp = await fetch(
'https://api-model.shuntianchuang.cn/jimeng/?Action=CVSync2AsyncSubmitTask&Version=2022-08-31',
{
method: 'POST',
headers: {
Authorization: 'Bearer sk-你的令牌',
'Content-Type': 'application/json',
},
body: JSON.stringify({
req_key: 'jimeng_vgfm_t2v_l20',
prompt: '一只橘猫在草地上追蝴蝶,电影感镜头',
}),
},
);
const task = await resp.json();
console.log(task.id, task.status); // 记住任务 ID 用于轮询#响应体
提交成功同样返回任务对象,id / task_id 用于查询。
#响应示例
{
"id": "task_xxxxxxxx",
"object": "video",
"task_id": "task_xxxxxxxx",
"status": "queued",
"progress": 0,
"model": "jimeng_vgfm_t2v_l20",
"created_at": 1769473000
}查询状态与下载见查询与下载。
