Omni Flash 视频 API
Google 将于 2026 年 12 月 5 日下线 Omni Flash 1.1、Veo 3.1 Fast 和 Veo 3.1 Quality。建议迁移到 Omni 1.2;Veo 3.1 Lite 不在本次下线范围。Google 官方公告。
Omni Flash 视频 API
Section titled “Omni Flash 视频 API”Omni 视频模型统一使用异步接口:提交任务、轮询状态、下载成片。支持 OpenAI 兼容协议和 Gemini predictLongRunning 协议。
| 模型 | 用途 | 时长 | 输入素材 |
|---|---|---|---|
omni-t2v | 文生视频 | 4、6、8、10 秒 | 不传图片 |
omni-i2v | 图生视频 | 4、6、8、10 秒 | 1 张首帧,或 2 张首帧+尾帧 |
omni-r2v | 参考图生视频 | 8 秒 | 1–3 张参考图 |
omni-v2v | 视频编辑 | 1–10 秒 | 1 个源视频,可带 0–2 张参考图 |
omni-40s | 长视频 | 40 秒 | 0–9 张参考图;omni_40s 为兼容别名 |
支持的画幅为 16:9 和 9:16。模型广场提供 360p、720p、1080p 等分辨率档位,具体以模型和渠道配置为准。
OpenAI 兼容协议
Section titled “OpenAI 兼容协议”普通视频使用 POST /v1/videos;V2V 使用 POST /v1/videos/edits。
curl https://api.4allapi.com/v1/videos \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "omni-t2v", "prompt": "雨夜霓虹街道,镜头平稳向前推进", "duration": 8, "aspect_ratio": "16:9", "resolution": "720p" }'图生和参考图
Section titled “图生和参考图”omni-i2v 使用 images 数组:传 1 张时作为首帧,传 2 张时按首帧、尾帧使用。omni-r2v 使用 1–3 张参考图。
{ "model": "omni-i2v", "prompt": "人物自然转身,镜头缓慢推进", "duration": 8, "aspect_ratio": "9:16", "resolution": "720p", "images": ["https://cdn.example.com/first.png"]}V2V 的源视频字段是 video,参考图使用 input_reference。源视频和参考图也可以使用 multipart 上传。
{ "model": "omni-v2v", "prompt": "保留人物动作和镜头,只把背景改成雨夜街道", "duration": 8, "video": {"url": "https://cdn.example.com/source.mp4"}, "input_reference": [{"image_url": "https://cdn.example.com/style.png"}]}40 秒模型
Section titled “40 秒模型”{ "model": "omni-40s", "prompt": "一段连续的电影感镜头", "duration": 40, "aspect_ratio": "16:9", "resolution": "720p", "images": ["https://cdn.example.com/reference.png"]}Gemini 协议
Section titled “Gemini 协议”curl "https://api.4allapi.com/v1beta/models/omni-r2v:predictLongRunning?key=$API_KEY" \ -H "Content-Type: application/json" \ -d '{ "instances": [{ "prompt": "参考图中的人物在雨夜街道行走", "image": {"gcsUri": "https://cdn.example.com/ref-1.png", "mimeType": "image/png"}, "referenceImages": [ {"gcsUri": "https://cdn.example.com/ref-2.png", "mimeType": "image/png"} ] }], "parameters": {"durationSeconds": 8, "aspectRatio": "16:9", "resolution": "720p"} }'轮询 GET /v1/videos/{id} 或 GET /v1beta/operations/{name},完成后使用返回的结果地址下载视频。