> ## 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 渠道生成視頻，支持文字和最多 3 張參考圖

> [!NOTE]
>
> **中國大陸用戶請注意：** 中國大陸用戶請使用 `https://toapis.cn` 作為接口地址（Base URL）。文檔示例中的 `https://toapis.com` 請替換為 `https://toapis.cn`。

* 通過 `model` 指定 `gemini-omni-flash`（部分渠道配置使用 `gemini_omni_flash` 別名）
* 支持文生視頻和參考圖生視頻
* 支持 4 / 6 / 10 秒時長
* 支持 `720p` 和 `1080p`；`1080p` 僅支持橫屏
* 異步任務接口，提交後使用任務 ID 查詢結果

> [!NOTE]
>
> 本文檔適用於非官方的舊版 `gemini-omni-flash`. 它不使用 Vertex AI Interactions API. 不同舊版接入的限制可能不同; 官方 Vertex AI 接入版本請參閱獨立的 `gemini-omni-flash-preview-official` 頁面.

> [!WARNING]
>
> 請先通過[圖片上傳 API](https://docs.toapis.com/docs/zh-Hant/api-reference/uploads/images.md) 上傳本地圖片，再把返回的 URL 放入 `image_urls`。不要直接傳 base64 圖片。

## Authorizations

**Authorization** `string` *required*

使用 Bearer Token 認證：

```
Authorization: Bearer YOUR_API_KEY
```

## Body

**model** `string` *required* (default: gemini-omni-flash)

模型名稱。舊版渠道使用 `gemini-omni-flash`；部分渠道配置使用等價的 `gemini_omni_flash` 別名。

**prompt** `string` *required*

視頻生成提示詞。

**duration** `integer` (default: 6)

視頻時長，支持 `4`、`6`、`10` 秒。

**aspect\_ratio** `string` (default: 16:9)

視頻比例，支持：

* `16:9` 橫屏
* `9:16` 豎屏

**resolution** `string` (default: 720p)

視頻分辨率，支持 `720p` 或 `1080p`；舊版渠道的 `1080p` 僅輸出橫屏。

**image\_urls** `string[]`

可選的公開參考圖 URL 數組，最多 `3` 張。不傳時爲文生視頻。此渠道不支持 base64/data URI，也不支持視頻輸入。

## Response

**id** `string`

任務 ID，用於查詢任務狀態。

**object** `string`

對象類型，通常爲 `generation.task`。

**model** `string`

使用的模型名稱。

**status** `string`

任務狀態：`queued`、`in_progress`、`completed`、`failed`。

**created\_at** `integer`

任務創建時間戳。

**video\_url** `string`

任務完成後的生成視頻 URL。

## Examples

```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"]
  }'
```

```json 200 theme={null}
{
  "id": "video_01JZEXAMPLE",
  "object": "generation.task",
  "model": "gemini-omni-flash",
  "status": "queued",
  "created_at": 1779247407
}
```

## 查詢任務

提交接口會返回任務 ID。使用通用視頻任務查詢接口獲取狀態和結果：

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.