创建视频任务
创建视频生成任务。提交前先读取视频生成配置并调用视频报价,将报价返回的 quote_id 和 rate_version 分别作为 quote_id 和 quote_version 传入。模式、时长、画幅、清晰度和参考素材数量须符合所选模型的配置。
认证
示例中的凭证为占位值,请替换后在服务器端运行。
代码示例
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- body
mode*string生成模式。视频支持 t2va、fl2va、ref2va;图片支持 text-to-image 和 image-to-image。各模型支持的模式以对应配置接口为准。
"t2va""fl2va""ref2va"prompt*string视频提示词。可使用标记引用 references 中提供的图片、视频和音频。
1 <= length <= 20000duration*integer视频时长(秒)。所选模型的最短和最长时长见 GET /v1/video/config 返回的 models[]。
1 <= value <= 305ratio*string视频画幅。部分模型的首尾帧请求必须使用 adaptive,以所选模型的配置为准。
"16:9""9:16""1:1""4:3""3:4""21:9""adaptive"seed?integer可选的确定性种子,范围 0–2147483647;模型不支持时不要传入。
0 <= value <= 2147483647references*array<>视频参考素材列表。kind 为 image、video 或 audio,role 为 reference、first 或 last;首尾帧模式最多使用一张首帧图片和一张尾帧图片。
items <= 50resolution*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 <= valuestyle_preset?string风格预设。仅可传入 GET /v1/video/config 为所选模型返回的 style_presets 中的值。
voice_bindings?array<>将参考图片中的人物与音频素材绑定,指定该人物的声音。每张人物图片最多绑定一个音频素材;未绑定的人物由提示词描述其声音。
items <= 30generate_audio?boolean是否同时生成音频,省略时为 true。
quote_id?stringPOST /v1/video/quote 返回的报价 ID,绑定报价时的模型、素材、时长等请求参数。请求参数变化后须重新报价。
请求成功
application/json- response
estimate_detail*id*Idreserved_credits*Reserved Creditsstatus*JobStatus"queued""processing""succeeded""failed""cancelled"type*JobType"tts""avatar""video""video_analysis""image""voice_design""audio_composition"