视频接口(待开放)
创建文生视频、图生视频和视频转视频任务。
视频接口(待开放)
使用 POST /v1/videos/generations 创建视频任务。接口会返回任务 id,最终视频地址需要到 任务查询 里获取。
该接口文档仅供预览,暂未开放。
接口地址
POST /v1/videos/generations请求参数
| 字段 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
provider | string | 必填 | 视频服务,例如 kie 或 fal。 |
model | string | 必填 | 视频模型,例如 sora-2-pro-text-to-video。 |
scene | string | 必填 | 可选 text-to-video、image-to-video、video-to-video。 |
prompt | string | 文生视频必填 | 视频内容描述。 |
image_input | string 或 string[] | 图生视频必填 | 一张或多张参考图片 URL。 |
video_input | string 或 string[] | 视频转视频必填 | 作为输入的源视频 URL。 |
options | object | 可选 | 模型支持的额外参数,例如 duration 或 aspect_ratio。 |
场景和积分
| 场景 | 必填输入 | 积分 |
|---|---|---|
text-to-video | prompt | 6 |
image-to-video | image_input | 8 |
video-to-video | video_input | 10 |
示例:文生视频
curl https://sseedance.com/v1/videos/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "kie",
"model": "sora-2-pro-text-to-video",
"scene": "text-to-video",
"prompt": "日出时玻璃城市的电影感镜头"
}'示例:图生视频
curl https://sseedance.com/v1/videos/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "kie",
"model": "sora-2-pro-image-to-video",
"scene": "image-to-video",
"image_input": ["https://cdn.example.com/reference.png"],
"options": {
"duration": "10"
}
}'示例:视频转视频
curl https://sseedance.com/v1/videos/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "fal",
"model": "fal-ai/kling-video/o1/video-to-video/edit",
"scene": "video-to-video",
"video_input": ["https://cdn.example.com/source.mp4"]
}'返回结果
{
"id": "task_id",
"object": "video.generation.task",
"status": "pending",
"data": {
"id": "task_id",
"mediaType": "video",
"status": "pending",
"videoUrls": []
}
}用 GET /v1/tasks/{id} 查询最终的 videoUrls。