# Gemini Omni Flash — /videos/generations

Gemini Omni Flash 视频生成（异步任务）：Google 新一代视频模型。一个接口按参数切换玩法——不带图为文生视频，image 传 1 张作首帧，images 传 2 张作首尾帧，image_role=reference 时 1–3 张作主体 / 风格参考。duration=6 / 8 / 10 秒，resolution=720P / 1080P，size=16:9 / 9:16，自带原生音轨，擅长按提示词分镜、多镜头叙事。提交后返回任务号（HTTP 202），轮询 GET /v1/videos/jobs/{id} 直到 status=succeeded，结果在 data[0].url（重托管 mp4 直链，保留 60 天）。按秒计费 $0.05/秒（$0.30 / $0.40 / $0.50），两档分辨率同价，失败全额退。

**端点:** `POST https://nezhagate.com/v1/videos/generations`

## 认证
```
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
```

## 请求参数
| 参数 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `model` | string | 是 | 模型 ID，此处为 gemini-omni-flash。 |
| `prompt` | string | 是 | 视频内容、镜头与运动的描述，最长 20000 个字符（中英文都按字符计）。带参考图时，可以在提示词里用 @Image1 / @Image2 指明第几张图。 |
| `duration` | integer | 否 | 时长：6 / 8 / 10 秒三选一（默认 6），也可写作 seconds。按秒计费 $0.05/秒，即 $0.30 / $0.40 / $0.50。 |
| `resolution` | string | 否 | 分辨率：720P / 1080P（默认 720P），两档同价。 |
| `size` | string | 否 | 画幅：16:9（默认）/ 9:16，也可写作 aspect_ratio。其他比例会被拒绝。 |
| `audio` | boolean | 否 | 该模型固定生成原生音轨，此参数可省略（传 false 会被拒绝）。 |
| `image` | string | 否 | 一张参考图（公网 URL、data: URI 或 base64）：作为首帧做图生视频。不带任何图即为文生视频。 |
| `images` | array | 否 | 最多 3 张图（每张不超过 16MB，jpg / png / webp / gif）。image_role=first_frame（1–2 张时的默认）：第 1 张作首帧、第 2 张作尾帧。image_role=reference：1–3 张作主体 / 风格参考，不当首帧用；传 3 张时默认就是 reference。也可写作 reference_images（等同 reference）。超过上限直接报错，不会截断。 |
| `image_role` | string | 否 | 参考图用法：first_frame（首帧，传 2 张时第 2 张作尾帧）或 reference（主体 / 风格参考）。不传时 1–2 张按 first_frame、3 张按 reference。 |

## 请求示例
```bash
# 1) submit -> 202 {"id":"img_...","status":"queued"}
curl https://nezhagate.com/v1/videos/generations -H 'Authorization: Bearer YOUR_API_KEY' -H 'Content-Type: application/json' -d '{"model": "gemini-omni-flash", "prompt": "a paper crane unfolding over a misty lake", "duration": 8, "resolution": "720P", "size": "16:9"}'
# first frame: also pass  "image": "https://example.com/first-frame.png"
# first + last frame: "images": ["https://example.com/first.png", "https://example.com/last.png"]
# 1-3 references: "images": [...], "image_role": "reference"
# 2) poll every ~5s until status=succeeded, then read data[0].url
curl https://nezhagate.com/v1/videos/jobs/img_3f9a...c2 -H 'Authorization: Bearer YOUR_API_KEY'
```

## 响应示例
```json
{
  "id": "img_3f9a...c2",
  "object": "video.generation.job",
  "status": "queued",
  "model": "gemini-omni-flash"
}
```