Gemini Omni 系列
- 文生视频、图生视频、视频编辑与延长
- 不需要传时长,由模型自行决定,通常 3 到 10 秒
- 可以用上一次的任务 ID 做多轮对话式修改
认证
All endpoints authenticate with a Bearer token.
Get an API key: open the console and create one.
Add it to the request header:
Authorization: Bearer YOUR_OAIRoute_KEY请求参数
提交成功只返回任务 ID,不含视频本身。拿成片用 task_id 轮询获取任务状态,成片地址在 result.videos[0].url,该地址约 24 小时后过期,请及时转存。
取值 gemini-omni-flash-preview 或 gemini-omni-1.1-flash。
文生视频时是场景描述;图生视频、视频编辑时是要执行的动作或风格指令。
prompt 与媒体字段至少要有一个。
输出分辨率,取值 360p、720p、1080p、4k,默认 720p,大小写不敏感。
2160p 按 4k 处理。gemini-omni-flash-preview 目前只支持 720p。
输出画幅,取值 16:9、9:16,默认 16:9。
传其他值会静默回落为 16:9。带视频输入时该字段失效,比例跟随源视频。
1 张按首帧处理;多张按多主体或风格参考处理,需要在 prompt 里说明各自角色。
gemini-omni-flash-preview 最多 16 张,gemini-omni-1.1-flash 与帧图合计不超过 10 张。
首帧。单独传是首帧;与 last_frame_image 同传是首尾帧过渡。
尾帧,只能与 first_frame_image 一起使用。
单独传返回 invalid_frame_images;建议与首帧同比例并匹配 aspect_ratio。
带角色的图片数组,每项含 url 与 role。
role 取值 first_frame、last_frame、reference。last_frame 必须已有首帧。
要编辑或延长的视频。
gemini-omni-flash-preview 最多 1 段,gemini-omni-1.1-flash 最多 1 段且不超过 10 秒,只接受直链,不支持 YouTube 链接。与 extend_from_task_id 互斥。
显式指定任务类型,取值 text_to_video、image_to_video、reference_to_video、edit、extend。
省略时由平台按输入推断。
上一次的任务 ID。必须是本人所有、已完成、且属于 Gemini Omni 的任务。与 video_urls 互斥。
为 true 时先做内容审查,默认 false。
A successful submission returns only the task ID, not the video itself. Poll Get task status with the task_id; the video URL is at result.videos[0].url, expires after about 24 hours, so copy it promptly.
gemini-omni-flash-preview or gemini-omni-1.1-flash.
For text to video, a scene description; for image to video and video editing, the action or style instruction to carry out.
At least one of prompt and a media field is required.
Output resolution: 360p, 720p, 1080p, or 4k; default 720p, case-insensitive.
2160p is treated as 4k. gemini-omni-flash-preview supports only 720p at present.
Output framing: 16:9 or 9:16, default 16:9.
Any other value silently falls back to 16:9. With video input this field has no effect and the ratio follows the source video.
One image is treated as the first frame; several are treated as multi-subject or style references and must be explained in prompt.
gemini-omni-flash-preview accepts up to 16; gemini-omni-1.1-flash allows no more than 10 including frame images.
The first frame. Alone it's the opening frame; together with last_frame_image it's a first-and-last-frame transition.
The last frame; usable only together with first_frame_image.
Passing it alone returns invalid_frame_images; keep it the same ratio as the first frame and matching aspect_ratio.
An array of images with roles, each with url and role.
role is first_frame, last_frame, or reference. A last_frame requires an existing first frame.
The video to edit or extend.
gemini-omni-flash-preview accepts at most 1; gemini-omni-1.1-flash at most 1 and no longer than 10 seconds, direct links only — YouTube links aren't supported. Mutually exclusive with extend_from_task_id.
Explicitly set the task type: text_to_video, image_to_video, reference_to_video, edit, or extend.
When omitted, the platform infers it from the input.
A previous task ID. Must belong to you, be completed, and be a Gemini Omni task. Mutually exclusive with video_urls.
When true, runs a content check first. Defaults to false.
模式判定
可以显式传 metadata.task 指定任务类型,也可以交给平台按输入推断。
只有提示词是文生视频;带 image_urls 是图生视频;带 video_urls 是视频编辑或延长;带 extend_from_task_id 是接续上一次的生成。
首尾帧两种写法二选一:用 first_frame_image / last_frame_image,或用 image_with_roles 里 role 为 first_frame / last_frame 的条目,不要同时用。
image_urls 与 image_with_roles 都带参考图时,以 image_urls 为准,两者不会合并。
You can pass metadata.task to set the task type explicitly, or let the platform infer it from the input.
Only a prompt means text to video; with image_urls it's image to video; with video_urls it's video editing or extension; with extend_from_task_id it continues a previous generation.
For first-and-last frames, choose one of the two forms: first_frame_image / last_frame_image, or image_with_roles entries whose role is first_frame / last_frame. Don't use both.
When both image_urls and image_with_roles carry reference images, image_urls wins; the two aren't merged.
支持的模型列表
| 模型 ID | 定位 |
|---|---|
gemini-omni-1.1-flash | 当前主力,最高 4K,支持视频编辑与多轮接续 |
gemini-omni-flash-preview | 预览版,最多 16 张参考图,目前固定 720p |
omni-flash-ext | 预览版的延长专用入口 |
| Model ID | Positioning |
|---|---|
gemini-omni-1.1-flash | Current main model, up to 4K, supports video editing and multi-round continuation |
gemini-omni-flash-preview | Preview, up to 16 reference images, fixed at 720p for now |
omni-flash-ext | A dedicated extension entry for the preview model |
使用限制
- 没有
duration参数,长度由模型决定 - 带视频输入时
aspect_ratio不生效 last_frame_image不能单独使用video_urls与extend_from_task_id不能同时传- 成片链接在
result.videos[].url里以数组形式返回,并按expires_at过期
- There's no
durationparameter; length is up to the model - With video input,
aspect_ratiohas no effect last_frame_imagecan't be used on its ownvideo_urlsandextend_from_task_idcan't be passed together- The finished video link comes back as an array in
result.videos[].urland expires perexpires_at
响应
提交成功返回统一的受理结构:
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01K8SGYNNNVBQTXNR4MM964S7K"
}
]
}状态码,200 表示任务已受理。
本次提交的任务列表,逐项提交时按顺序排列。
受理状态,提交成功时为 submitted。
任务 ID,用它轮询结果。
A successful submission returns the standard accepted structure:
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01K8SGYNNNVBQTXNR4MM964S7K"
}
]
}The status code; 200 means the task was accepted.
The list of tasks submitted this time, in order when submitting item by item.
The acceptance status; submitted on success.
The task ID; use it to poll for the result.
错误
| HTTP | type | 说明 |
|---|---|---|
| 400 | invalid_request_error | 请求参数无效,或参数组合冲突 |
| 401 | authentication_error | 身份验证失败,需检查 API Key |
| 402 | payment_required | 账户余额不足,需先充值 |
| 429 | rate_limit_error | 调用频率过高,稍后重试 |
参数错误在提交阶段同步返回,不创建任务、不扣费。
| HTTP | type | Notes |
|---|---|---|
| 400 | invalid_request_error | Invalid parameters, or a conflicting combination |
| 401 | authentication_error | Authentication failed; check the API key |
| 402 | payment_required | Insufficient account balance; top up first |
| 429 | rate_limit_error | Too many calls; retry later |
Parameter errors are returned synchronously at submission, creating no task and charging nothing.
For more status codes and retry guidance see Error codes and rate limits; for troubleshooting steps on common errors see the FAQ.
查询任务
GET /v1/tasks/{task_id} 返回任务进度与结果,status 为 completed 时成片地址在 result.videos[0].url,元素带 expires_at 过期时间戳。
建议每 5 到 10 秒轮询一次,客户端总超时设为 10 到 15 分钟。status 取值 pending、processing、completed、failed、cancelled,以状态判定完成,不要依赖 progress。
失败任务自动退回费用,error.message 给出原因。
GET /v1/tasks/{task_id} returns task progress and results; once status is completed, the video URL is at result.videos[0].url, with an expires_at timestamp on the element.
Poll every 5 to 10 seconds, with a 10 to 15 minute client timeout. status is one of pending, processing, completed, failed, cancelled; judge completion by status, not by progress.
Failed tasks are refunded automatically, with the reason in error.message.