Skip to content

视频生成 ​

支持文本、图片等多种输入方式生成视频。

一、创建视频生成任务 ​

  • 请求方式:POST
  • 接口地址: @@API_ORIGIN@@/v1/video/generations

请求参数 ​

视频生成API请求参数 ​

参数名数据类型详细描述示例值
modelstring模型ID,必填字段"happyhorse-1.1-t2v"
promptstring文本描述提示词,必填参数"海边落日,电影级运镜"
durationnumber视频时长(秒)8
resolutionstring分辨率720p
response_formatstring响应格式"json"
metadataobject模型厂商透传参数`

请求示例1:文生视频 ​

curl -X POST "@@API_ORIGIN@@/v1/video/generations" \
  -H "Authorization: Bearer sk-xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "happyhorse-1.1-t2v",
    "prompt": "一只猫在草地上奔跑",
    "duration": 5,
    "resolution": "480p"
  }'

请求示例2:多模态参考生视频,字节豆包模型调用 ​

将大模型厂商的参数放在metadata结构体中

curl -X POST "@@API_ORIGIN@@/v1/video/generations" \
  -H "Authorization: Bearer sk-xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "seedance2.0",
    "prompt": "明亮多彩的广告片风格,果味饼干为主角,包含草莓、苹果、葡萄、橙子四种口味,草莓味参考@图像1。随后不同口味饼干整齐排列,切特写,参考@视频2的动态和运镜。",
    "metadata": {
      "content": [
        {
          "type": "text",
          "text": "明亮多彩的广告片风格,果味饼干为主角,包含草莓、苹果、葡萄、橙子四种口味,草莓味参考@图像1。随后不同口味饼干整齐排列,切特写,参考@视频2的动态和运镜。"
        },
        {
          "type": "image_url",
          "role": "reference_image",
          "image_url": {
            "url": "https://arkdocs.tos-cn-beijing.volces.com/images/video-generation/seedance2.5_reference1.png"
          }
        },
        {
          "type": "video_url",
          "role": "reference_video",
          "video_url": {
            "url": "https://arkdocs.tos-cn-beijing.volces.com/videos/video-generation/seedance2.5_reference2.mp4"
          }
        }
      ],
      "generate_audio": true,
      "ratio": "16:9",
      "duration": 5
    }
  }'

返回内容 ​

创建成功 ​

请求调用成功后,返回takID,可以调用下方的查询任务详情接口,获取视频生成进度。

markdown
{
  "id": "task_5IvyNupbbfzt2Cr3Xky6EAauj6pXLicm",
  "task_id": "task_5IvyNupbbfzt2Cr3Xky6EAauj6pXLicm",
  "object": "video",
  "model": "happyhorse-1.1-t2v",
  "status": "queued",
  "progress": 0,
  "created_at": 1787055365
}
创建失败 ​
markdown
{
  "error": {
    "message": "string",
    "type": "string",
    "param": "string",
    "code": "string"
  }
}

二、查询视频任务状态 ​

  • 请求方式:GET
  • 接口地址: @@API_ORIGIN@@/v1/video/generations/

将 {id} 替换为实际任务ID

请求示例 ​

curl --location '@@API_ORIGIN@@/v1/video/generations/task_xxx' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer sk-xxx'

响应内容 ​

成功示例 ​

根据响应报文中data.status状态判断执行结果,【"status": "SUCCESS",】代表视频任务正常结束。 其他状态示例:NOT_START,SUBMITTED,QUEUED,IN_PROGRESS,FAILURE,SUCCESS,UNKNOWN a.任务执行中

{
  "code": "success",
  "message": "",
  "data": {
    "id": 172,
    "created_at": 1788175795,
    "updated_at": 1788175795,
    "task_id": "task_y0B0kocdnqi1bxGkvCnXoDK5r4pYW96n",
    "platform": "58",
    "user_id": 2,
    "group": "default",
    "channel_id": 24,
    "quota": 46875000,
    "action": "textGenerate",
    "status": "NOT_START",
    "fail_reason": "",
    "submit_time": 1788175795,
    "start_time": 0,
    "finish_time": 0,
    "progress": "0%",
    "properties": {
      "input": "",
      "upstream_model_name": "doubao-seedance-2-0-mini-260615",
      "origin_model_name": "doubao-seedance-2-0-mini-260615"
    },
    "data": {
      "id": "BPj1Mpzwgwr0ZU0GQA5EZz77RSKPnjJZ5l7ap6tn9K521c3DdVIxCeNIXPwQHigkNPLrNB0wBWc8TMSDX5Q70eE0JYlOeMWP7xKQQx1J2xclrMICHpOdKceP7TInWo31xJgnEgXFD7HPndYEvme",
      "model": "doubao-seedance-2-0-mini-260615",
      "output": {
        "task_id": "BPj1Mpzwgwr0ZU0GQA5EZz77RSKPnjJZ5l7ap6tn9K521c3DdVIxCeNIXPwQHigkNPLrNB0wBWc8TMSDX5Q70eE0JYlOeMWP7xKQQx1J2xclrMICHpOdKceP7TInWo31xJgnEgXFD7HPndYEvme",
        "task_status": "PENDING"
      },
      "request_id": "b85da5a7-5e85-9d1f-bc2b-f066b5a02fc1"
    }
  }
}

b. 任务结束,执行成功

{
  "code": "success",
  "message": "",
  "data": {
    "id": 26,
    "created_at": 1787025622,
    "updated_at": 1787025710,
    "task_id": "task_qPpCS7tmC8gPGZ2mtyeUVAihAto3PzmD",
    "platform": "17",
    "user_id": 2,
    "group": "default",
    "channel_id": 18,
    "quota": 250000,
    "action": "textGenerate",
    "status": "SUCCESS",
    "fail_reason": "",
    "result_url": "https://xxx",
    "submit_time": 1787025622,
    "start_time": 1787025629,
    "finish_time": 1787025710,
    "progress": "100%",
    "properties": {
      "input": "",
      "upstream_model_name": "happyhorse-1.1-t2v",
      "origin_model_name": "happyhorse-1.1-t2v"
    },
    "data": {
      "usage": {
        "SR": 480,
        "ratio": "16:9",
        "duration": 5,
        "video_count": 1,
        "input_video_duration": 0,
        "output_video_duration": 5
      },
      "output": {
        "task_id": "27dee7b8-95c9-40fc-bd84-12613372b5ed",
        "end_time": "2026-08-18 12:01:39.693",
        "video_url": "https://xxx",
        "orig_prompt": "一只猫在草地上奔跑",
        "submit_time": "2026-08-18 12:00:22.232",
        "task_status": "SUCCEEDED",
        "scheduled_time": "2026-08-18 12:00:22.842"
      },
      "request_id": "f7d8a101-d4e2-9123-9815-74d0428fcb9d"
    }
  }
}

失败示例 ​

{
  "error": {
    "message": "string",
    "type": "string",
    "param": "string",
    "code": "string"
  }
}