创建任务

POST /volc/v1/contents/generations/tasks

MethodPOST
Path/volc/v1/contents/generations/tasks
Typehttp
Status1
Module2102810
Folder66709190

说明

概览

MethodPOST
Path/volc/v1/contents/generations/tasks
Typehttp
Status1
Module2102810
Folder66709190

参数

{
  "header": [
    {
      "required": false,
      "description": "",
      "type": "string",
      "id": "mbXak4UT7M",
      "enable": false,
      "name": "Content-Type",
      "sampleValue": "application/json"
    },
    {
      "required": false,
      "description": "",
      "type": "string",
      "id": "2Is2sicmWA",
      "enable": false,
      "name": "Accept",
      "sampleValue": "application/json"
    },
    {
      "required": false,
      "description": "",
      "type": "string",
      "id": "nDXV3kC5ty",
      "enable": true,
      "name": "Authorization",
      "sampleValue": "Bearer {{YOUR_API_KEY}}"
    }
  ]
}

请求体

{
  "type": "application/json",
  "parameters": [],
  "jsonSchema": {
    "type": "object",
    "properties": {
      "model": {
        "type": "string",
        "description": "doubao-seedance-1-5-pro-251215 支持:文生、首帧、首尾帧\ndoubao-seedance-1-0-pro-250528 支持:文生、首帧、首尾帧\ndoubao-seedance-1-0-pro-fast-251015 支持:文生、首帧\ndoubao-seedance-1-0-lite-t2v-250428 支持:文生\ndoubao-seedance-1-0-lite-i2v-250428 支持:首帧、首尾帧、参考图(1-4)"
      },
      "content": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "description": "输入内容的类型:\n- text 表示文本\n- image_url 表示图片"
            },
            "text": {
              "type": "string",
              "description": "输入给模型的文本内容,描述期望生成的视频,包括:\n文本提示词(必填):支持中英文。建议不超过500字。字数过多信息容易分散,模型可能因此忽略细节,只关注重点,造成视频缺失部分元素。"
            },
            "image_url": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "description": "图片信息,这里为图片url 或 Base64 编码。"
                }
              },
              "x-apifox-orders": [
                "url"
              ],
              "description": "输入给模型的图片对象。"
            },
            "role": {
              "type": "string",
              "description": "图片用途:\n- reference_image 表示参考图\n- first_frame 表示首帧  只为首帧的时候该参数可不填\n- last_frame 表示尾帧"
            }
          },
          "x-apifox-orders": [
            "type",
            "text",
            "image_url",
            "role"
          ],
          "required": [
            "type",
            "text"
          ]
        },
        "description": "输入给模型,生成视频的信息,支持文本信息和图片信息。"
      },
      "-- 参数": {
        "type": "object",
        "properties": {
          "resolution": {
            "type": "string",
            "description": "视频分辨率,枚举值:\n- 480p\n- 720p\n- 1080p:参考图场景不支持\n\nSeedance 1.5 pro、Seedance 1.0 lite 默认值:720p\nSeedance 1.0 pro & pro-fast 默认值:1080p"
          },
          "ratio": {
            "type": "string",
            "description": "生成视频的宽高比例:\n- 16:9 \n- 4:3\n- 1:1\n- 3:4\n- 9:16\n- 21:9\n\n文生视频:默认值 16:9( Seedance 1.5 Pro 默认为 自适应)\n图生视频:默认 自适应(参考图生视频场景默认值为 16:9)"
          },
          "camera_fixed": {
            "type": "string",
            "description": "是否固定摄像头。枚举值:\n- true:固定摄像头。平台会在用户提示词中追加固定摄像头,实际效果不保证。\n- false:不固定摄像头。\n\n注意:参考图场景不支\n默认值 false"
          },
          "watermark": {
            "type": "string",
            "description": "生成视频是否包含水印。枚举值:\n- false:不含水印。\n- true:含有水印。\n\n默认值 false"
          },
          "duration": {
            "type": "integer",
            "description": "生成视频时长,单位:秒。支持 2-12 秒\nSeedance 1.5 pro 只支持 4-12 秒\n默认值 5"
          },
          "seed": {
            "type": "integer",
            "description": "种子整数,用于控制生成内容的随机性。\n取值范围:[-1, 2^32-1]之间的整数。\n注意:\n- 相同的请求下,模型收到不同的seed值,如:不指定seed值或令seed取值为-1(会使用随机数替代)、或手动变更seed值,将生成不同的结果。\n- 相同的请求下,模型收到相同的seed值,会生成类似的结果,但不保证完全一致。\n\n默认值 -1  传入时不能输入 -1"
          }
        },
        "x-apifox-orders": [
          "resolution",
          "ratio",
          "duration",
          "camera_fixed",
          "watermark",
          "seed"
        ],
        "description": "以下参数需要添加到提示词后面  通过 -- 形式追加,参考示例"
      },
      "generate_audio": {
        "type": "boolean",
        "description": "控制生成的视频是否包含与画面同步的声音。\n- true:模型输出的视频包含同步音频。Seedance 1.5 pro 能够基于文本提示词与视觉内容,自动生成与之匹配的人声、音效及背景音乐。建议将对话部分置于双引号内,以优化音频生成效果。例如:男人叫住女人说:“你记住,以后不可以用手指指月亮。”\n- false:模型输出的视频为无声视频。\n\n注意:该参数只支持 Seedance 1.5 pro 模型\n默认值:true"
      }
    },
    "required": [
      "model",
      "content"
    ],
    "x-apifox-orders": [
      "model",
      "content",
      "generate_audio",
      "-- 参数"
    ]
  },
  "required": false,
  "mediaType": "",
  "examples": [
    {
      "value": "{\r\n    \"model\": \"doubao-seedance-1-0-pro-fast-251015\",\r\n    \"content\": [\r\n        {\r\n            \"type\": \"text\",\r\n            \"text\": \"写实风格,晴朗的蓝天之下,一大片白色的雏菊花田,镜头逐渐拉近,最终定格在一朵雏菊花的特写上,花瓣上有几颗晶莹的露珠 --resolution 480p --ratio 16:9 --duration 2 --camera_fixed false --watermark false --seed 1\"\r\n        }\r\n    ]\r\n}",
      "mediaType": "application/json",
      "description": "",
      "name": "文生视频"
    },
    {
      "name": "图生视频-首帧",
      "value": "{\r\n    \"model\": \"doubao-seedance-1-0-lite-i2v-250428\",\r\n    \"content\": [\r\n        {\r\n            \"type\": \"text\",\r\n            \"text\": \"女孩抱着狐狸,女孩睁开眼,温柔地看向镜头,狐狸友善地抱着,镜头缓缓拉出,女孩的头发被风吹动,可以听到风声 --resolution 1080p --ratio 16:9 --duration 12 --camera_fixed false --watermark false --seed 1\"\r\n        },\r\n        {\r\n            \"type\": \"image_url\",\r\n            \"image_url\": {\r\n                \"url\": \"https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png\"\r\n            }\r\n        }\r\n    ]\r\n}",
      "mediaType": "application/json"
    },
    {
      "name": "图生视频-首尾帧",
      "value": "{\r\n    \"model\": \"doubao-seedance-1-0-pro-250528\",\r\n    \"content\": [\r\n        {\r\n            \"type\": \"text\",\r\n            \"text\": \"图中女孩对着镜头说“茄子”,360度环绕运镜 --resolution 1080p --ratio 16:9 --duration 12 --camera_fixed false --watermark false --seed 1\"\r\n        },\r\n        {\r\n            \"type\": \"image_url\",\r\n            \"image_url\": {\r\n                \"url\": \"https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_first_frame.jpeg\"\r\n            },\r\n            \"role\": \"first_frame\"\r\n        },\r\n        {\r\n            \"type\": \"image_url\",\r\n            \"image_url\": {\r\n                \"url\": \"https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_last_frame.jpeg\"\r\n            },\r\n            \"role\": \"last_frame\"\r\n        }\r\n    ]\r\n}",
      "mediaType": "application/json"
    },
    {
      "name": "图生视频-参考图",
      "value": "{\r\n    \"model\": \"doubao-seedance-1-0-lite-i2v-250428\",\r\n    \"content\": [\r\n        {\r\n            \"type\": \"text\",\r\n            \"text\": \"[图1]戴着眼镜穿着蓝色T恤的男生和[图2]的柯基小狗,坐在[图3]的草坪上,3D卡通风格 --resolution 720p --ratio 16:9 --duration 12 --watermark false --seed 1\"\r\n        },\r\n        {\r\n            \"type\": \"image_url\",\r\n            \"image_url\": {\r\n                \"url\": \"https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_1.png\"\r\n            },\r\n            \"role\": \"reference_image\"\r\n        },\r\n        {\r\n            \"type\": \"image_url\",\r\n            \"image_url\": {\r\n                \"url\": \"https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_2.png\"\r\n            },\r\n            \"role\": \"reference_image\"\r\n        },\r\n        {\r\n            \"type\": \"image_url\",\r\n            \"image_url\": {\r\n                \"url\": \"https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_3.png\"\r\n            },\r\n            \"role\": \"reference_image\"\r\n        }\r\n    ]\r\n}",
      "mediaType": "application/json"
    },
    {
      "name": "图生视频-base64编码",
      "value": "{\r\n    \"model\": \"doubao-seedance-1-0-lite-i2v-250428\",\r\n    \"content\": [\r\n        {\r\n            \"type\": \"text\",\r\n            \"text\": \"女孩抱着狐狸,女孩睁开眼,温柔地看向镜头,狐狸友善地抱着,镜头缓缓拉出,女孩的头发被风吹动 --resolution 1080p --ratio 16:9 --duration 12 --camera_fixed false --watermark false --seed 1\"\r\n        },\r\n        {\r\n            \"type\": \"image_url\",\r\n            \"image_url\": {\r\n                \"url\": \"data:image/png;base64,aHR0******cG5n\"\r\n            }\r\n        }\r\n    ]\r\n}",
      "mediaType": "application/json"
    }
  ],
  "oasExtensions": ""
}

响应

[
  {
    "id": 770198553,
    "name": "成功",
    "code": 200,
    "contentType": "json",
    "jsonSchema": {
      "type": "object",
      "properties": {}
    },
    "itemSchema": {},
    "description": "",
    "mediaType": "",
    "headers": []
  }
]

响应示例

[
  {
    "name": "成功示例",
    "responseId": 770198553,
    "data": "{\r\n    \"id\": \"cgt-20250918165243-bfpzb\",\r\n    \"status\": \"submitted\"\r\n}",
    "description": "",
    "oasKey": "",
    "oasExtensions": "",
    "id": 707569251
  }
]