> ## 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/cn/api-reference/uploads/images.md)上传本地图片, 通过[视频上传 API](https://docs.toapis.com/docs/cn/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.