跳至正文
EN

Gemini Omni 1.2 Flash API 接入文档

使用 VezAPI 密钥接入 Gemini Omni 1.2 Flash。下列操作共用同一个账号余额和鉴权方式。

服务地址: https://api.vezapi.com
请求头使用 Authorization: Bearer YOUR_VEZAPI_KEY。每次提交使用唯一的 Idempotency-Key,查询同一笔提交时才复用。

Gemini Omni 1.2 Flash

POST/api/v1/jobs/createTask

模型标识: google/gemini-omni-flash-1-2

参数类型说明与限制
model
必填
string

用于生成任务的模型名称。该字段为必填项。此接口必须使用 `google/gemini-omni-flash-1-2` 模型。

可选值:"google/gemini-omni-flash-1-2"

默认:"google/gemini-omni-flash-1-2"

callBackUrl
可选
string

任务完成通知的回调 URL。该参数为可选项。如果提供,当任务完成时,无论成功或失败,系统都会向该 URL 发送 POST 请求。如果未提供,则不会发送回调通知。

input
必填
object

生成任务的输入参数。一次请求只使用一种生成模式:文生 / 参考图、只传首帧、首尾帧,或视频编辑。

input.prompt
必填
string

视频提示词,必填,不能为空。用于描述场景、动作、镜头语言和声音。

minLength: 1

maxLength: 20000

input.duration
可选
integer

生成视频的时长,单位为秒,传整数。 - 文生 / 参考图(不传首帧、不传视频):**必填**,取值 **3–15** - 只传首帧:**必填**,取值 **3–15** - 首尾帧:**必填**,取值 **3–10** - 视频编辑(传入 `video_list`):**不要传**,输出时长由输入视频决定

minimum: 3

maximum: 15

input.aspect_ratio
可选
string

生成视频的画面宽高比。可选值:`16:9`、`9:16`、`auto`。默认 `16:9`。无参考图时,`auto` 按 `16:9` 处理。

可选值:"16:9", "9:16", "auto"

默认:"16:9"

input.resolution
可选
string

生成视频的分辨率。可选值:`360p`、`720p`、`1080p`、`4k`。默认 `720p`。

可选值:"360p", "720p", "1080p", "4k"

默认:"720p"

input.seeds
可选
integer

随机种子。取值范围:10000–99999,传单个整数。不传时由系统自动生成。

minimum: 10000

maximum: 99999

input.image_urls
可选
array

参考图地址,最多 **6** 张。用于提供人物、场景、风格或分镜参考。两张参考图不会被当作首尾帧。 限制: - 请使用可公开访问的图片 URL - 单张大小不超过 `20MB` - 与 `first_frame_url`、`last_frame_url` 互斥 - 每张占用 1 个额度

maxItems: 6

input.first_frame_url
可选
string

首帧图片地址,用于指定生成视频的起始画面。请使用可公开访问的图片 URL。 - 只传首帧(不传尾帧):`duration` 必填,整数 3–15 - 同时传 `last_frame_url`:`duration` 必填,整数 3–10 - 传入本字段时,不要传 `image_urls`、`video_list` - 不能只传 `last_frame_url`

input.last_frame_url
可选
string

尾帧图片地址,用于指定生成视频的结束画面。必须同时传入 `first_frame_url`,不能单独使用。此时 `duration` 必填,取值 3–10。传入首尾帧时,不要传 `image_urls`、`video_list`。

input.video_list
可选
array

视频地址数组,最多 **1** 条。传入后为视频编辑模式,**不要再传 `duration`**,输出时长由输入视频决定。可同时传入 `image_urls`。与 `first_frame_url`、`last_frame_url` 互斥。请使用可公开访问的视频 URL,建议 MP4,不超过 **15 秒**。

maxItems: 1

请求示例
curl -X POST 'https://api.vezapi.com/api/v1/jobs/createTask' \
  -H 'Authorization: Bearer YOUR_VEZAPI_KEY' \
  -H 'Idempotency-Key: your-unique-request-id' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "google/gemini-omni-flash-1-2",
  "input": {
    "prompt": "A cat plays piano in a jazz bar, one continuous shot, soft live jazz",
    "duration": 8,
    "aspect_ratio": "16:9",
    "resolution": "720p"
  }
}'
返回值与错误

HTTP 200

请求成功

参数类型说明与限制
code
可选
integer

Status code of the request. The HTTP status is 200 even when the request fails, so always check this field: 200 means success; any other value means the request failed and msg describes the reason. Common values: 401 invalid or missing API key; 402 insufficient credits; 429 rate limit exceeded; 422 or 500 the request could not be processed (read msg and check your parameters before retrying).

可选值:200, 401, 402, 404, 422, 429, 433, 455, 500, 501, 505

msg
可选
string

Response message, error description upon failure

data
必填
object
data.taskId
必填
string

The task ID can be used with the "Get Task Details" endpoint to query the task status.

任务状态与回调

异步任务请保存返回的 taskId。调用 GET /api/v1/jobs/recordInfo?taskId=... 查询,或在创建时设置 callBackUrl。只有任务所属账号可以查询任务或基于任务创建派生资源。

超时可能表示请求已经受理。请在控制台查看原请求,不要自动新建任务。回调可能重试并重复到达,请使用 X-VezAPI-Event-Id 去重。

文件、日志与计费

生成媒体通常随上游保留 14 天,上传文件在 24 小时后失效。请在过期前保存所需文件。VezAPI 仅流式转发已登记资源,不提供永久作品库。请求日志保留两个自然月。

调用前预留积分,最终按实际优惠扣分 1:1 结算。用量不明时暂停新付费请求。若保护其他任务预留后余额不足以结算,会保留待结算记录,补足余额后再扣费;模型用量不会将钱包扣成负数。按时长计价的输入文件由服务端读取时长,读取失败时不提交模型任务。