RealmDramaAPI 开发者文档
使用指南火山兼容APIOpenAI 兼容API在线调试帮助支持

创建视频生成任务 API

火山文档原文

POST /api/v3/contents/generations/tasks

POST
/api/v3/contents/generations/tasks

Authorization

BearerAuth

AuthorizationBearer <token>

输入 API Token。请求将使用 Authorization: Bearer

In: header

Request Body

application/json

model*string

Model ID 或 Endpoint ID

content*

视频生成输入;可组合文本、图片、视频、音频和样片任务 ID

Items1 <= items
callback_url?string

任务状态变化时接收 POST 回调;回调体与查询任务响应一致

Formaturi
return_last_frame?boolean

是否返回无水印尾帧图片

Defaultfalse
service_tier?string

default 为在线推理,flex 为离线推理;Seedance 2.0 仅支持在线推理

Default"default"
Value in"default" | "flex"
execution_expires_after?integer

任务过期秒数;到期后排队中或运行中的任务变为 expired

Default172800
Range3600 <= value <= 259200
generate_audio?boolean

Seedance 2.0/1.5 Pro 是否生成同步单声道音频

Defaulttrue
draft?boolean

仅 Seedance 1.5 Pro;开启后生成 480p 样片

Defaultfalse
tools?

仅 Seedance 2.0;当前可配置 web_search

safety_identifier?string

固定且唯一的终端用户标识,建议传入哈希值

Lengthlength <= 64
priority?integer

仅 Seedance 2.0;数值越大,同一 Endpoint 内排队越靠前

Range0 <= value <= 9
resolution?string

Seedance 2.0 支持 4k

Value in"480p" | "720p" | "1080p" | "4k"
ratio?string
Value in"16:9" | "4:3" | "1:1" | "3:4" | "9:16" | "21:9" | "adaptive"
duration?integer

视频时长(秒);与 frames 二选一

Default5
frames?integer

生成帧数,优先级高于 duration;Seedance 2.0/1.5 Pro 暂不支持

seed?integer

随机种子;Seedance 2.0 暂不支持

Default-1
Range-1 <= value <= 4294967295
camera_fixed?boolean

是否固定镜头;参考图场景和 Seedance 2.0 暂不支持

Defaultfalse
watermark?boolean

是否在右下角展示“AI 生成”水印

Defaultfalse
[key: string]?never

Response Body

application/json

application/json

application/json

curl -X POST "https://jieyun.cc/api/v3/contents/generations/tasks" \  -H "Content-Type: application/json" \  -d '{    "model": "doubao-seedance-2-0-260128",    "content": [      {        "type": "text",        "text": "清晨的海边,一架纸飞机迎着风飞行"      }    ],    "duration": 5,    "resolution": "720p",    "ratio": "16:9",    "generate_audio": true  }'
{
  "id": "cgt-2026-example"
}
{
  "error": {
    "message": "string",
    "type": "string",
    "param": "string",
    "code": "string"
  }
}
{
  "error": {
    "message": "string",
    "type": "string",
    "param": "string",
    "code": "string"
  }
}

接口说明

根据文本、图片、视频、音频或样片任务创建异步视频生成任务。本文档已按火山引擎官方接口说明校对。

POST https://jieyun.cc/api/v3/contents/generations/tasks
Authorization: Bearer <API_KEY>
Content-Type: application/json

真人素材限制

Seedance 2.0 不支持直接上传含真人人脸的参考图片或视频。请使用平台支持的含人脸原始产物、预置虚拟人像,或通过素材库完成授权的真人素材。

请求参数

字段类型必选说明
modelstring已开通的 Model ID 或 Endpoint ID。
contentobject[]视频生成输入,支持文本、图片、视频、音频和样片任务 ID。
content.typestringtextimage_urlvideo_urlaudio_urldraft_task
content.textstring条件必选文本提示词,建议中文不超过 500 字、英文不超过 1000 词。
content.image_url.urlstring条件必选公网图片 URL、Base64 Data URL 或 asset://<ASSET_ID>
content.video_url.urlstring条件必选公网视频 URL 或 asset://<ASSET_ID>
content.audio_url.urlstring条件必选参考音频 URL;仅 Seedance 2.0,且不能单独输入音频。
content.rolestring条件必选first_framelast_framereference_imagereference_videoreference_audio
content.draft_task.idstring条件必选Seedance 1.5 Pro 样片任务 ID。
callback_urlstring任务状态变化时接收 POST 回调;回调体与查询任务响应一致。
return_last_frameboolean默认 false;是否返回无水印尾帧图片。
service_tierstring默认 defaultdefault 为在线推理,flex 为离线推理。Seedance 2.0 仅支持在线推理。
execution_expires_afterinteger任务过期秒数,默认 172800,范围为 3600–259200。
generate_audioboolean默认 true;Seedance 2.0/1.5 Pro 是否生成同步单声道音频。
draftboolean默认 false;仅 Seedance 1.5 Pro,开启后生成 480p 样片。
toolsobject[]仅 Seedance 2.0;当前可配置 web_search
safety_identifierstring固定且唯一的终端用户标识,最长 64 个英文字符,建议传入哈希值。
priorityinteger仅 Seedance 2.0,范围 0–9;数值越大,同一 Endpoint 内排队越靠前。
resolutionstring480p720p1080p;Seedance 2.0 还支持 4k
ratiostring16:94:31:13:49:1621:9adaptive
durationinteger视频时长(秒),默认 5;与 frames 二选一。
framesinteger生成帧数,优先级高于 duration;Seedance 2.0/1.5 Pro 暂不支持。
seedinteger默认 -1,范围 [-1, 2^32-1];Seedance 2.0 暂不支持。
camera_fixedboolean默认 false;参考图场景和 Seedance 2.0 暂不支持。
watermarkboolean默认 false;设为 true 时在右下角展示“AI 生成”水印。

输入组合

  • 纯文本。
  • 文本(可选)+ 图片。
  • 文本(可选)+ 视频。
  • 文本(可选)+ 图片或视频 + 音频。
  • Seedance 1.5 Pro 样片任务 ID。

首帧、首尾帧和多模态参考是三种互斥场景,不可混用。图片支持公网 URL、Base64 Data URL 和素材 ID;视频支持公网 URL 和素材 ID。

素材限制

  • 单张图片小于 30 MB,请求体不超过 64 MB;宽高比范围为 [0.4, 2.5],边长范围为 300–6000 px。
  • 单个视频不超过 200 MB,时长为 2–15 秒;最多传入 3 个参考视频,且总时长不超过 15 秒。
  • execution_expires_after 到期后,仍在排队或运行中的任务会变为 expired
  • 回调状态包括 queuedrunningsucceededfailedexpired;成功或失败回调发送失败时最多重试 3 次。

请求示例:

curl -X POST "https://jieyun.cc/api/v3/contents/generations/tasks" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedance-2-0-260128",
    "content": [
      {"type": "text", "text": "一艘木船穿过晨雾中的湖面,写实电影镜头"}
    ],
    "resolution": "720p",
    "ratio": "16:9",
    "duration": 5,
    "generate_audio": true
  }'

响应内容

任务创建成功后返回异步任务标识。任务记录保存 7 天,请保存 id,用于查询、列举或取消任务。

字段类型说明
idstring视频生成任务 ID。
safety_identifierstring请求中传入的终端用户标识;未传入时不返回。
{
  "id": "cgt-2026-example"
}