视频模型接口参考创建视频任务

创建视频任务

创建视频生成任务。提交前先读取视频生成配置并调用视频报价,将报价返回的 quote_id 和 rate_version 分别作为 quote_id 和 quote_version 传入。模式、时长、画幅、清晰度和参考素材数量须符合所选模型的配置。

认证

API Key:X-API-Key: <API Key> 或 Authorization: Bearer <API Key>。

示例中的凭证为占位值,请替换后在服务器端运行。

代码示例

curl -X POST 'https://shixux.com/api/v1/video/generate' \  -H 'X-API-Key: yb_xxx_yyy' \  -H 'Content-Type: application/json' \  -H 'Idempotency-Key: your-unique-business-action-id' \  -d '{"model":"seedance-2.5-flash","mode":"t2va","prompt":"A lighthouse by the sea, a slow camera move, waves and wind.","duration":5,"ratio":"16:9","resolution":"720p","seed":42,"references":[],"quote_id":"quote_xxx","quote_version":1}'
{  "id": "job_xxx",  "type": "tts",  "status": "queued",  "reserved_credits": 1,  "estimate_detail": {}}

请求头参数

Idempotency-Key?|

幂等键,最长 128 个字符。重试同一请求时使用相同的值;同一个键用于不同的请求时返回 409。

请求体

application/json
  1. body
mode*string

生成模式。视频支持 t2va、fl2va、ref2va;图片支持 text-to-image 和 image-to-image。各模型支持的模式以对应配置接口为准。

可选值"t2va""fl2va""ref2va"
prompt*string

视频提示词。可使用标记引用 references 中提供的图片、视频和音频。

长度1 <= length <= 20000
duration*integer

视频时长(秒)。所选模型的最短和最长时长见 GET /v1/video/config 返回的 models[]。

范围1 <= value <= 30
默认5
ratio*string

视频画幅。部分模型的首尾帧请求必须使用 adaptive,以所选模型的配置为准。

可选值"16:9""9:16""1:1""4:3""3:4""21:9""adaptive"
seed?integer

可选的确定性种子,范围 0–2147483647;模型不支持时不要传入。

范围0 <= value <= 2147483647
references*array<>

视频参考素材列表。kind 为 image、video 或 audio,role 为 reference、first 或 last;首尾帧模式最多使用一张首帧图片和一张尾帧图片。

元素items <= 50
resolution*Resolution

视频清晰度。minmax-h3-flash 和 minmax-h3-pro 支持 768p 和 2k(2k 输出会自动增强画质);其他模型的可用清晰度以 GET /v1/video/config 的返回为准。

默认"768p"
可选值"768p""2k""480p""720p""1080p""4k"
model?string

模型 ID。图片和视频模型的可用状态、清晰度和费率以对应配置接口的返回为准;语音合成和音频编排可选 indextts-2(默认)或 indextts-2.5。

可选值"minmax-h3-flash""minmax-h3-pro""wan3.0-video""seedance-2.0""seedance-2.5""seedance-2.5-flash""kling-4.0""seedance-2.0-mini""seedance-2.0-fast"
quote_version?integer

报价响应中的 rate_version。费率变化后提交会被拒绝,需重新报价。

范围1 <= value
style_preset?string

风格预设。仅可传入 GET /v1/video/config 为所选模型返回的 style_presets 中的值。

voice_bindings?array<>

将参考图片中的人物与音频素材绑定,指定该人物的声音。每张人物图片最多绑定一个音频素材;未绑定的人物由提示词描述其声音。

元素items <= 30
generate_audio?boolean

是否同时生成音频,省略时为 true。

quote_id?string

POST /v1/video/quote 返回的报价 ID,绑定报价时的模型、素材、时长等请求参数。请求参数变化后须重新报价。

响应体

请求成功

application/json
  1. response
estimate_detail*
id*Id
reserved_credits*Reserved Credits
status*JobStatus
可选值"queued""processing""succeeded""failed""cancelled"
type*JobType
可选值"tts""avatar""video""video_analysis""image""voice_design""audio_composition"

本页目录