跳转到主要内容
POST
/
v1
/
videos
curl https://api.cometapi.com/v1/videos \ -H "Authorization: Bearer <COMETAPI_KEY>" \ -F 'prompt="A slow cinematic camera push across a coastal landscape at sunrise"' \ -F 'model="doubao-seedance-2-0-fast"' \ -F 'seconds="5"' \ -F 'size="16:9"' \ -F 'resolution="720p"'
{ "id": "task_abc123", "task_id": "task_abc123", "object": "video", "model": "doubao-seedance-2-0-fast", "status": "SUBMITTED", "progress": 0, "created_at": 1776681149 }
使用此端点来启动一个 ByteDance Seedance 视频任务。所有 Seedance 模型层级共享相同的请求结构;你只需通过设置 model 字段来选择模型。调用会立即返回一个任务 id,而渲染会在后台继续进行。

选择模型

Model id层级说明
doubao-seedance-2-02.02.0 系列中质量最高的输出。
doubao-seedance-2-0-fast2.02.0 的更快变体,适合快速迭代和预览。
doubao-seedance-1-5-pro1.5 Pro支持 1080p。仅支持文生视频。
doubao-seedance-1-0-pro1.0 Pro支持 1080p,并支持最短从 2 秒开始的短视频。仅支持文生视频。
实时可用性请参见模型页面

参数范围

FieldTypeRequiredDefaultAllowed values
promptstring任意文本
modelstringdoubao-seedance-2-0, doubao-seedance-2-0-fast, doubao-seedance-1-5-pro, doubao-seedance-1-0-pro
secondsinteger5取决于模型(见下文)
sizestring16:921:9, 16:9, 4:3, 1:1, 3:4, 9:16
resolutionstring720p2.0 模型支持 480p720p;1.5 Pro 和 1.0 Pro 支持 480p720p1080p
input_referencefileJPEG、PNG 或 WebP。仅 2.0 模型接受。

按模型划分的时长范围

Modelseconds range
doubao-seedance-2-0, doubao-seedance-2-0-fast4 到 15
doubao-seedance-1-5-pro4 到 12
doubao-seedance-1-0-pro2 到 10
如果发送的值超出模型范围,将返回 HTTP 400,并带有 code: "InvalidParameter" 以及一条关于 duration 的消息。

图生视频支持

只有 2.0 模型接受 input_reference 文件。若向 doubao-seedance-1-5-prodoubao-seedance-1-0-pro 发送 input_reference,将返回 HTTP 400,并带有类似 the specified task_type r2v does not support model seedance-1-5-pro 的消息。此类模型仅用于文生视频。

上传参考图片

请求体为 multipart/form-data。要在 2.0 模型上运行图生视频,请在同一个请求中将图片作为 input_reference 部分附加:
curl https://api.cometapi.com/v1/videos \
  -H "Authorization: Bearer <COMETAPI_KEY>" \
  -F 'prompt="A slow cinematic camera push across a coastal landscape at sunrise."' \
  -F 'model="doubao-seedance-2-0"' \
  -F 'seconds="5"' \
  -F 'size="16:9"' \
  -F 'resolution="720p"' \
  -F 'input_reference=@/path/to/reference.jpg'
/path/to/reference.jpg 替换为你希望用作首帧锚点的图片的绝对或相对路径。支持的格式包括 JPEG、PNG 和 WebP。

任务流程

1

提交任务

发送一个至少包含 promptmodel 的 POST 请求。保存返回的 id 以供下一步使用。
2

轮询任务

每隔 10 到 20 秒调用一次 检索一个 Seedance 视频
3

下载输出

status 变为 SUCCESS 时,下载 video_url 中的文件;如果你需要长期访问,请重新托管该文件。此 URL 带有签名,并会在有限时间窗口后过期。

错误响应

当缺少必填字段、某个值超出接受范围,或者将 input_reference 发送给不支持图生视频的模型时,该端点会返回 HTTP 400。当 bearer token 缺失或无效时,会返回 HTTP 401。错误响应体会使用两种结构中的一种;确切字段请参见 playground 中的 400 和 401 示例。

授权

Authorization
string
header
必填

Bearer token authentication. Use your CometAPI key.

请求体

multipart/form-data
prompt
string
必填

Text prompt that describes the video. Required.

示例:

"A slow cinematic camera push across a coastal landscape at sunrise."

model
enum<string>
必填

Seedance model id. Choose doubao-seedance-2-0 for the highest quality 2.0 output, doubao-seedance-2-0-fast for quick iteration on 2.0, doubao-seedance-1-5-pro for the 1.5 Pro tier, or doubao-seedance-1-0-pro for the 1.0 Pro tier. Only the two 2.0 models accept input_reference.

可用选项:
doubao-seedance-2-0,
doubao-seedance-2-0-fast,
doubao-seedance-1-5-pro,
doubao-seedance-1-0-pro
示例:

"doubao-seedance-2-0-fast"

seconds
integer
默认值:5

Video duration in seconds. The accepted range depends on the model: doubao-seedance-2-0 and doubao-seedance-2-0-fast accept 4 to 15, doubao-seedance-1-5-pro accepts 4 to 12, and doubao-seedance-1-0-pro accepts 2 to 10. The default is 5 for every model.

必填范围: 2 <= x <= 15
示例:

5

size
enum<string>
默认值:16:9

Output aspect ratio. All Seedance models accept the same set of values.

可用选项:
21:9,
16:9,
4:3,
1:1,
3:4,
9:16
示例:

"16:9"

resolution
enum<string>
默认值:720p

Output resolution. 480p and 720p are accepted by every model; 1080p is supported only by doubao-seedance-1-5-pro and doubao-seedance-1-0-pro.

可用选项:
480p,
720p,
1080p
示例:

"720p"

input_reference
file

Optional reference image. When included, the job runs in image-to-video mode and uses the image as the visual anchor. Only doubao-seedance-2-0 and doubao-seedance-2-0-fast accept this field; sending it with a 1.0 Pro or 1.5 Pro model returns HTTP 400.

响应

Task created. Save the returned id and poll GET /v1/videos/{id}.

id
string
必填

Task id. Use it as the path parameter for GET /v1/videos/{id}.

object
string
必填

Object type, always video.

model
string
必填

Echo of the requested model id.

status
enum<string>
必填

Initial task status. A newly created task is returned as SUBMITTED.

可用选项:
SUBMITTED,
IN_PROGRESS,
SUCCESS,
FAILED,
ERROR
progress
integer
必填

Completion percentage. 0 at creation.

必填范围: 0 <= x <= 100
created_at
integer
必填

Task creation time as a Unix timestamp in seconds.

task_id
string

Alias of id returned for compatibility. The value matches id.