> ## 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 1.1 影片生成與編輯

> 使用官方 Gemini Omni 1.1 Flash Preview 生成, 編輯或延長 3-10 秒影片, 支援四種解析度

* 透過 `model` 指定 `gemini-omni-1.1-flash-preview-official`
* 支援文生影片, 圖生影片, 參考圖生影片, 影片編輯和影片延長
* 最多支援 10 張參考圖和 3 個輸入影片; 圖片與影片可在同一請求中混用
* 時長 3-10 秒; 解析度支援 360p / 720p / 1080p / 4K
* 非同步任務介面, 提交後使用任務 ID 查詢結果

> [!NOTE]
>
> 中國大陸使用者可將範例網域替換為 `https://toapis.cn`.

> [!WARNING]
>
> 請先透過[圖片上傳 API](https://docs.toapis.com/docs/zh-Hant/api-reference/uploads/images.md)上傳本機圖片, 透過[影片上傳 API](https://docs.toapis.com/docs/zh-Hant/api-reference/uploads/videos.md)上傳本機影片, 再傳入回傳的 URL. 不要直接傳 base64 媒體資料.

## Authorizations

**Authorization** `string` *required*

使用 Bearer Token 認證：

```
Authorization: Bearer YOUR_API_KEY
```

## Body

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

模型名稱. 使用 `gemini-omni-1.1-flash-preview-official`.

**prompt** `string` *required*

影片生成, 編輯或延長的提示詞.

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

影片時長（秒）, 整數 `3`-`10`. `extend` 任務時表示續拍長度, 缺省約 10 秒.

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

影片比例，支援：

* `16:9` 橫屏
* `9:16` 直屏

`edit` 和 `extend` 任務不傳此欄位.

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

影片解析度，支援：

* `360p`
* `720p`
* `1080p`
* `4K`

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

可選的參考圖 URL 陣列，最多 `10` 張. 不傳時為文生影片. 可與 `video_list` 同時使用，例如續拍時附加參考圖.

**video\_list** `object[]`

可選的輸入影片，最多 `3` 個. 每一項必須包含 `video_url`，例如 `{ "video_url": "https://example.com/input.mp4" }`. 支援 HTTPS URL, data URI 和平臺上傳後回傳的影片 URL; 後端下載的單個輸入影片最大 50 MB, 支援 MP4/MOV. 可與 `image_urls` 同時使用，支援影片加參考圖的混合輸入. `edit` 和 `extend` 任務必須提供輸入影片.

**metadata** `object`

可選的 Interactions 生成參數. 支援 `temperature`（`0.0`–`2.0`）, `topP` / `top_p`（`0.0`–`1.0`）, `candidateCount` / `candidate_count`, `previous_interaction_id`，以及 `task`（`text_to_video`, `image_to_video`, `reference_to_video`, `edit` 或 `extend`）. 省略 `task` 時，平臺不會擅自預設；由上游根據 prompt 與媒體推斷. 對 `edit` 和 `extend`（或帶輸入影片且未明確指定其他任務）路徑，平臺會省略 `aspect_ratio`. `extend` 透過 `video_list` 輸入來源影片續拍，不能與 `previous_interaction_id` 同時使用.

不接受 Veo 專屬參數，例如 `generateAudio`, `negativePrompt` 和 `seed`.

## 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-1.1-flash-preview-official",
    "prompt": "A red paper boat floating on a calm lake at sunrise",
    "duration": 3,
    "aspect_ratio": "16:9",
    "resolution": "360p"
  }'
```

影片編輯範例：

```bash 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-1.1-flash-preview-official",
    "prompt": "Change the sky to a warm sunset",
    "duration": 6,
    "resolution": "1080p",
    "video_list": [{"video_url": "https://example.com/uploaded-video.mp4"}],
    "metadata": {"task": "edit"}
  }'
```

影片延長範例（`duration` 為續拍秒數，缺省約 10 秒；輸出為來源影片加上續拍片段）：

```bash 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-1.1-flash-preview-official",
    "prompt": "Continue the scene: the subject keeps moving naturally",
    "duration": 5,
    "video_list": [{"video_url": "https://example.com/uploaded-video.mp4"}],
    "metadata": {"task": "extend"}
  }'
```

```json 200 theme={null}
{
  "id": "video_01JZEXAMPLE",
  "object": "generation.task",
  "model": "gemini-omni-1.1-flash-preview-official",
  "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.