> ## 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`. 此預覽模型支援文字生成影片, 圖片生成影片, 參考圖生成及影片編輯.

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

## 參數

`Authorization: Bearer YOUR_API_KEY`

| 欄位              | 說明                                                                              |
| --------------- | ------------------------------------------------------------------------------- |
| `model`         | `gemini-omni-1.1-flash-preview-official`                                        |
| `prompt`        | 必填. 描述需要生成或編輯的內容.                                                               |
| `duration`      | 整數 3-10 秒, 預設 6 秒.                                                              |
| `resolution`    | 360p / 720p / 1080p / 4K, 預設 720p.                                              |
| `aspect_ratio`  | 16:9 / 9:16, 預設 16:9. 編輯影片時不傳此欄位.                                               |
| `image_urls`    | 最多 10 張參考圖 URL, 不可與輸入影片混用.                                                      |
| `video_list`    | 最多 3 項, 每項包含 video\_url. 支援 MP4/MOV, 每項最大 50 MiB.                               |
| `metadata.task` | 選填: text\_to\_video / image\_to\_video / reference\_to\_video / edit. 省略時由模型判斷. |

請先上傳媒體以取得 URL. 不接受 Veo 專屬參數, 例如 generateAudio, negativePrompt 及 seed. 影片輸入請使用 video\_list.

## 計費

USD, 輸出依請求秒數計費. 輸入影片依伺服器探測時長逐項無條件進位至整秒, 另計 \$0.006950/秒. 以下為基本價格, 群組或帳戶折扣以報價為準.

| 輸出解析度 |       每秒價格 |
| ----- | ---------: |
| 360p  | \$0.027034 |
| 720p  | \$0.081088 |
| 1080p | \$0.121632 |
| 4K    | \$0.243264 |

## 請求範例

```bash theme={null}
curl https://toapis.com/v1/videos/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-omni-1.1-flash-preview-official",
    "prompt": "A red paper boat floating on a calm lake at sunrise",
    "duration": 3,
    "resolution": "360p",
    "aspect_ratio": "16:9"
  }'
```

```json theme={null}
{
  "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"}
}
```

## 查詢結果

提交後取得任務 id, 透過統一任務查詢介面取得狀態與結果.

```bash theme={null}
curl https://toapis.com/v1/videos/generations/TASK_ID \
  -H "Authorization: Bearer YOUR_API_KEY"
```
