> ## 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](../../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"
```
