API 手册
Omni 视频生成
Omni 文生视频、图生视频和视频修改接口
Omni API 使用统一 /v1/videos 视频任务接口,支持文生视频、图生视频和视频修改。提交任务后通过轮询获取结果。
| 能力 | 方法 | 路径 |
|---|
| 提交任务 | POST | /v1/videos |
| 查询任务 | GET | /v1/videos/{task_id} |
所有接口都使用:
Authorization: Bearer $API_KEY
| 模型 | 时长 | 分辨率 |
|---|
omni_flash-10s | 10 秒 | 720p |
| 模式 | 传参方式 |
|---|
| 文生视频 | 只传 prompt,不传参考素材 |
| 图生视频 | 传 1 到 7 个图片 URL |
| 视频修改 | 在参考素材中传视频 URL,并可搭配图片 URL |
| 参数 | 类型 | 必填 | 说明 |
|---|
model | string | 是 | 固定使用 omni_flash-10s |
prompt | string | 是 | 视频提示词 |
size | string | 否 | 例如 1280x720、720x1280 |
images | string[] | 否 | JSON 方式传图片或视频 URL,最多 7 项 |
input_reference[] | repeatable | 否 | 表单方式传图片或视频 URL,最多 7 项 |
curl https://cdn.12ai.org/v1/videos \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "omni_flash-10s",
"prompt": "一段现代办公室产品展示视频,镜头平稳,光线明亮",
"size": "1280x720"
}'
curl https://cdn.12ai.org/v1/videos \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "omni_flash-10s",
"prompt": "根据参考图生成自然运动的视频",
"size": "1280x720",
"images": [
"https://example.com/img1.jpg",
"https://example.com/img2.jpg"
]
}'
curl https://cdn.12ai.org/v1/videos \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "omni_flash-10s",
"prompt": "保持原视频运动节奏,把场景改成夜晚城市街道",
"size": "1280x720",
"images": [
"https://example.com/source-video.mp4",
"https://example.com/style-reference.jpg"
]
}'
{
"id": "task_xxx",
"status": "queued",
"model": "omni_flash-10s",
"created_at": 1760000000
}
curl https://cdn.12ai.org/v1/videos/task_xxx \
-H "Authorization: Bearer $API_KEY"
| 字段 | 类型 | 说明 |
|---|
id | string | 任务 ID |
status | string | queued、processing、completed、failed |
progress | number | 进度 |
video_url | string | 完成后的视频 URL |
error | object | 失败原因 |
{
"id": "task_xxx",
"status": "completed",
"progress": 100,
"video_url": "https://img.12ai.org/videos/task_xxx.mp4"
}
| 项目 | 说明 |
|---|
| 参考素材数量 | 最多 7 项 |
| 文生视频 | 不传 images 或 input_reference[] |
| 图生视频 | 参考素材传图片 URL |
| 视频修改 | 参考素材可包含视频 URL 和图片 URL |