> ## Documentation Index
> Fetch the complete documentation index at: https://docs.toapis.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Gemini Omni Flash 视频生成

> 使用 Gemini Omni Flash 生成视频，支持文生视频，以及 0 / 1 / 3 张参考图

* 通过 `model` 指定 `gemini_omni_flash`
* 支持文生视频、单图生视频，以及 3 张参考图融合
* 支持 4 / 6 / 10 秒时长
* 默认 720P；`1080p` 为横屏 1080P，仅支持 `16:9`
* 异步任务接口，提交后使用任务 ID 查询结果

<Warning>
  请先通过[图片上传 API](/docs/cn/api-reference/uploads/images) 上传本地图片，再把返回的 URL 放入 `image_urls`。不要直接传 base64 图片。
</Warning>

## Authorizations

<ParamField header="Authorization" type="string" required>
  使用 Bearer Token 认证：

  ```
  Authorization: Bearer YOUR_API_KEY
  ```
</ParamField>

## Body

<ParamField body="model" type="string" default="gemini_omni_flash" required>
  模型名称。使用 `gemini_omni_flash`。
</ParamField>

<ParamField body="prompt" type="string" required>
  视频生成提示词。
</ParamField>

<ParamField body="duration" type="integer" default="6">
  视频时长，支持 `4`、`6`、`10`。
</ParamField>

<ParamField body="aspect_ratio" type="string" default="16:9">
  视频比例，支持：

  * `16:9` 横屏
  * `9:16` 竖屏
</ParamField>

<ParamField body="resolution" type="string" default="720P">
  视频分辨率：

  * `720P` 默认分辨率
  * `1080p` 横屏 1080P，仅支持 `aspect_ratio: "16:9"`
</ParamField>

<ParamField body="image_urls" type="string[]">
  参考图 URL 数组，可选。仅支持以下三种情况：

  * 不传或传空数组：文生视频
  * `1` 张图片：单图生视频
  * `3` 张图片：参考图融合

  不支持传 `2` 张图片。

  后端会将 `image_urls` 规范化为上游参考图参数。
</ParamField>

## Response

<ResponseField name="id" type="string">
  任务 ID，用于查询任务状态。
</ResponseField>

<ResponseField name="object" type="string">
  对象类型，通常为 `generation.task`。
</ResponseField>

<ResponseField name="model" type="string">
  使用的模型名称。
</ResponseField>

<ResponseField name="status" type="string">
  任务状态：`queued`、`in_progress`、`completed`、`failed`。
</ResponseField>

<ResponseField name="created_at" type="integer">
  任务创建时间戳。
</ResponseField>

<ResponseField name="video_url" type="string">
  任务完成后的生成视频 URL。
</ResponseField>

## Examples

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://toapis.com/v1/videos/generations \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "model": "gemini_omni_flash",
      "prompt": "一支蓝色按压瓶在纯白摄影棚中轻微转动，商业产品视频",
      "duration": 6,
      "aspect_ratio": "9:16",
      "resolution": "720P",
      "image_urls": ["https://example.com/reference.jpg"]
    }'
  ```

  ```bash cURL (1080p Landscape) theme={null}
  curl --request POST \
    --url https://toapis.com/v1/videos/generations \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "model": "gemini_omni_flash",
      "prompt": "电影感产品展示，缓慢推镜",
      "duration": 4,
      "aspect_ratio": "16:9",
      "resolution": "1080p"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "video_01JZEXAMPLE",
    "object": "generation.task",
    "model": "gemini_omni_flash",
    "status": "queued",
    "created_at": 1779247407
  }
  ```
</ResponseExample>

## 查询任务

提交接口会返回任务 ID。使用通用视频任务查询接口获取状态和结果：

```bash theme={null}
curl --request GET \
  --url https://toapis.com/v1/videos/generations/{task_id} \
  --header "Authorization: Bearer YOUR_API_KEY"
```
