Skip to main content
POST
/
v1
/
videos
创建视频任务
curl --request POST \
  --url https://api.chenyu.cn/v1/videos \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "prompt": "<string>",
  "image": "<string>",
  "duration": "<string>",
  "resolution": "<string>"
}
'
{
  "id": "<string>",
  "object": "<string>",
  "model": "<string>",
  "status": "<string>",
  "created_at": 123
}

创建视频任务

创建视频生成任务。视频生成是异步任务,接口会先返回任务 ID,后续通过查询接口获取状态和结果。

请求参数

model
string
required
视频生成模型 ID
prompt
string
required
视频生成提示词
image
string
可选参考图片 URL。具体支持范围以模型为准
duration
string
视频时长,例如 5
resolution
string
输出分辨率,例如 720p1080p

响应参数

id
string
视频任务 ID。后续查询任务状态时使用
object
string
固定为 video
model
string
实际调用的模型 ID
status
string
任务状态,如 queuedrunningsucceededfailed
created_at
integer
创建时间戳

代码示例

import requests

url = "https://api.chenyu.cn/v1/videos"
headers = {
    "Authorization": "Bearer your_api_key",
    "Content-Type": "application/json"
}
payload = {
    "model": "doubao-seedance-2-0-fast-260128",
    "prompt": "一只白色机器人在未来城市街道上行走,电影感镜头"
}

response = requests.post(url, headers=headers, json=payload)
print(response.json()["id"])

响应示例

{
  "id": "cgt-20260602154730-twmv2",
  "object": "video",
  "model": "doubao-seedance-2-0-fast-260128",
  "status": "queued",
  "created_at": 1780000000
}