提交生成任务后轮询获取结果。提交时不扣费,任务成功后才按上游实际时长计费,失败不扣费。
https://zerofa.ai/v1/videosmodelstring必填seedance-2-0-fast-lolpromptstring必填一只柴犬在草地上奔跑,电影质感durationinteger可选5resolutionstring可选720Paspect_ratiostring可选16:9enable_audioboolean可选true/v1/videos/{id}返回 submitted、running、succeeded 或 failed 状态。成功时包含 urls 和 duration_sec。终态结果会缓存,重复查询不会再次请求上游。
视频模型见 模型广场 并筛选视频类型。费用按时长(秒)乘以模型单价计算。
用下面的示例确认请求格式与返回结构。需要在线发起请求时,点击页面顶部“调试”拉起在线运行面板。
curl https://zerofa.ai/v1/videos \
-H "Authorization: Bearer sk-zerofa-xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "seedance-2-0-fast-lol",
"prompt": "一只柴犬在草地上奔跑,电影质感",
"duration": 5,
"resolution": "720P",
"aspect_ratio": "16:9",
"enable_audio": true
}'
# → {"id":"<task-id>","status":"submitted"}curl https://zerofa.ai/v1/videos/<task-id> \
-H "Authorization: Bearer sk-zerofa-xxx"
# running → {"id":"...","status":"running","progress":40}
# succeeded → {"id":"...","status":"succeeded",
# "urls":["https://..."],"duration_sec":5}