> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aireiter.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Gemini Omni 1.2 Flash 视频生成

> - 模型 ID：`gemini_omni_1_2_flash`
- 异步处理模式，返回任务 ID 用于后续查询
- 支持文生视频，或最多 3 张参考图
- 原生 720p，时长 3–15 秒任选；11–15 秒只能 9:16


> [!NOTE]
>
> 成片固定为 720p H.264 MP4：横屏 1280×720，竖屏 720×1280。不支持 1080p / 4K、参考视频和首尾帧。

## Authorizations

**Authorization** `string` *required*

所有接口均需要使用 Bearer Token 进行认证。

获取 API Key：

访问 [API Key 管理页面](https://aireiter.com/keys) 获取您的 API Key。

使用时在请求头中添加：

```
Authorization: Bearer YOUR_API_KEY
```

## Body

**model** `string` *required*

模型名称，固定传 `gemini_omni_1_2_flash`。

**params** `object` *required*

模型参数对象。

**params 对象属性**

**prompt** `string` *required*

视频生成的文本描述。必填。

**video\_length** `string` (default: 8)

生成视频时长，单位为秒。只接受字符串 `"3"` 到 `"15"` 的整秒：

* `"3"` / `"4"` / `"5"` / `"6"` / `"7"`
* `"8"` - 默认值
* `"9"` / `"10"` / `"11"` / `"12"` / `"13"` / `"14"` / `"15"`

> [!WARNING]
>
> 枚举校验要求字符串，请传 `"8"` 而不是数字 `8`。`"11"` 到 `"15"` 只能配 `aspect_ratio` 为 `9:16`。

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

视频宽高比：

* `16:9` - 横屏 1280×720，默认值
* `9:16` - 竖屏 720×1280

时长 11–15 秒只能传 `9:16`，传 `16:9` 会被拒绝。

**image\_url** `string | string[]`

参考图 URL，必须可由公网直接访问。也可传单张字符串。不传就是文生视频。

* 最多 3 张，第 4 张会被拒绝
* 短边不小于 300px，单张不超过 10MB

参考图用来定主体和风格，不是首帧 / 尾帧，成片不会强制从某张图开始或结束。

**out\_task\_id** `string` *required*

发起方任务 ID。

用户自定义的任务标识，必填。仅支持字母、数字、下划线和横线，长度为 1-64 个字符。后续可使用该 ID 查询任务状态和结果。

## Response

**out\_task\_id** `string`

发起方任务 ID，可用于查询结果。

**status** `string`

初始状态，通常为 `"pending"`。

**estimated\_credits** `number`

本次任务的预估消耗额度。

**created\_at** `string`

创建时间，ISO 格式。

## Query Task

本模型是异步视频生成。提交任务后，请使用 `out_task_id` 查询任务状态。也可参见 [获取任务状态](https://docs.aireiter.com/zh/api-reference/tasks/status.md)。

**out\_task\_id** `string` *required*

提交任务时传入的发起方任务 ID。

```bash theme={null}
curl --request POST \
  --url https://aireiter.com/api/openapi/query \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "out_task_id": "omni_12_t2v_123456"
  }'
```

查询成功并完成后，响应中的 `output` 数组会包含生成的视频，元素含 `video` 字段。

## 参数对照

| 输入 | `image_url` | `video_length` | `aspect_ratio` |
| - | - | - | - |
| 文生 | 不要传，或空数组 | `"3"`–`"10"` | `16:9` 或 `9:16` |
| 文生（长） | 不要传，或空数组 | `"11"`–`"15"` | 只能 `9:16` |
| 参考图 | 1–3 张 | `"3"`–`"10"` | `16:9` 或 `9:16` |
| 参考图（长） | 1–3 张 | `"11"`–`"15"` | 只能 `9:16` |

不支持的字段：`resolution`（固定 720p）、`video_url`（不支持参考视频）。

## Request Examples

```bash cURL（文生） theme={null}
curl --request POST \
  --url https://aireiter.com/api/openapi/submit \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gemini_omni_1_2_flash",
    "params": {
      "prompt": "一只金毛犬在阳光海滩上奔跑，跟拍镜头，写实风格",
      "aspect_ratio": "16:9",
      "video_length": "8"
    },
    "out_task_id": "omni_12_t2v_123456"
  }'
```

```bash cURL（3 张参考图） theme={null}
curl --request POST \
  --url https://aireiter.com/api/openapi/submit \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gemini_omni_1_2_flash",
    "params": {
      "prompt": "保持参考图里的人物和服装，在花园里走路",
      "image_url": [
        "https://example.com/ref-1.jpg",
        "https://example.com/ref-2.jpg",
        "https://example.com/ref-3.jpg"
      ],
      "aspect_ratio": "16:9",
      "video_length": "6"
    },
    "out_task_id": "omni_12_img3_123456"
  }'
```

```bash cURL（15 秒竖屏） theme={null}
curl --request POST \
  --url https://aireiter.com/api/openapi/submit \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gemini_omni_1_2_flash",
    "params": {
      "prompt": "城市夜景延时摄影，车流划出光轨，竖屏构图",
      "aspect_ratio": "9:16",
      "video_length": "15"
    },
    "out_task_id": "omni_12_t2v_15s_123456"
  }'
```

```python Python theme={null}
import requests

url = "https://aireiter.com/api/openapi/submit"

payload = {
    "model": "gemini_omni_1_2_flash",
    "params": {
        "prompt": "一只金毛犬在阳光海滩上奔跑，跟拍镜头，写实风格",
        "aspect_ratio": "16:9",
        "video_length": "8"
    },
    "out_task_id": "omni_12_t2v_123456"
}

headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript JavaScript theme={null}
const url = "https://aireiter.com/api/openapi/submit";

const payload = {
  model: "gemini_omni_1_2_flash",
  params: {
    prompt: "一只金毛犬在阳光海滩上奔跑，跟拍镜头，写实风格",
    aspect_ratio: "16:9",
    video_length: "8"
  },
  out_task_id: "omni_12_t2v_123456"
};

const headers = {
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
};

fetch(url, {
  method: "POST",
  headers: headers,
  body: JSON.stringify(payload)
})
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));
```

```go Go theme={null}
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    url := "https://aireiter.com/api/openapi/submit"

    payload := map[string]interface{}{
        "model": "gemini_omni_1_2_flash",
        "params": map[string]interface{}{
            "prompt":       "一只金毛犬在阳光海滩上奔跑，跟拍镜头，写实风格",
            "aspect_ratio": "16:9",
            "video_length": "8",
        },
        "out_task_id": "omni_12_t2v_123456",
    }

    jsonData, _ := json.Marshal(payload)

    req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
    req.Header.Set("Authorization", "Bearer <token>")
    req.Header.Set("Content-Type", "application/json")

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, _ := ioutil.ReadAll(resp.Body)
    fmt.Println(string(body))
}
```

```java Java theme={null}
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;

public class Main {
    public static void main(String[] args) throws Exception {
        String url = "https://aireiter.com/api/openapi/submit";

        String payload = """
            {
              "model": "gemini_omni_1_2_flash",
              "params": {
                "prompt": "一只金毛犬在阳光海滩上奔跑，跟拍镜头，写实风格",
                "aspect_ratio": "16:9",
                "video_length": "8"
              },
              "out_task_id": "omni_12_t2v_123456"
            }
        """;

        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create(url))
            .header("Authorization", "Bearer <token>")
            .header("Content-Type", "application/json")
            .POST(HttpRequest.BodyPublishers.ofString(payload))
            .build();

        HttpResponse<String> response = client.send(request,
            HttpResponse.BodyHandlers.ofString());

        System.out.println(response.body());
    }
}
```

```php PHP theme={null}
<?php

$url = "https://aireiter.com/api/openapi/submit";

$payload = [
    "model" => "gemini_omni_1_2_flash",
    "params" => [
        "prompt" => "一只金毛犬在阳光海滩上奔跑，跟拍镜头，写实风格",
        "aspect_ratio" => "16:9",
        "video_length" => "8"
    ],
    "out_task_id" => "omni_12_t2v_123456"
];

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
]);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>
```

```json 200 theme={null}
{
  "statusCode": 200,
  "message": "",
  "data": {
      "out_task_id": "omni_12_t2v_123456",
      "status": "pending",
      "estimated_credits": "<预估消耗额度>",
      "created_at": "2026-11-18T06:03:28.242Z"
  }
}
```

```json 400 theme={null}
  {
      "statusCode": 400,
      "message": "请求参数无效",
      "ok": false
  }
```

```json 401 theme={null}
{
  "error": {
    "code": 401,
    "message": "身份验证失败，请检查您的API密钥"
  }
}
```

```json 433 theme={null}
  {
    "error": {
      "code": 433,
      "message": "账户余额不足，请充值后再试"
    }
  }
```

```json 500 theme={null}
{
  "error": {
    "code": 500,
    "message": "服务器内部错误，请稍后重试"
  }
}
```


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