AIAPIAIAPI API

Gemini Omni 1.1 Flash image-to-video

Model ID google/gemini-omni-1.1-flash/image-to-video

概览

Google · image-to-video

重要: Optional extra.thinking_level accepts default, high or low. Videos include native audio; there is no audio toggle. 1080p and 4k are upscaled outputs.

接口

POST /v1/video/generations

认证

Authorization: Bearer <AIAPIAIAPI_API_KEY>

请求体

参数类型必填可空默认值约束说明
modelstring是否-values: google/gemini-omni-1.1-flash/image-to-video用于路由请求的模型 ID。
promptstring是否--Required prompt, up to 20000 characters.
imagestring是否-accepts: HTTP/HTTPS URL, Base64主输入图或首帧图,支持 HTTPS URL 或 Base64 data URL。
end_imagestring否否-accepts: HTTP/HTTPS URL, Base64可选的结束帧图片,支持 HTTPS URL 或 Base64 data URL。
durationinteger否否`10`range: 3-10生成视频的时长,单位为秒。
resolutionstring否否`720p`values: 360p, 720p, 1080p, 4k输出视频分辨率。
aspect_ratiostring否否`16:9`values: 16:9, 9:16输出视频宽高比。
seedinteger否否`-1`min: -1随机种子;使用 -1 可获得随机结果。

model

类型:string · 必填:是 · 可空:否

用于路由请求的模型 ID。

prompt

类型:string · 必填:是 · 可空:否

Required prompt, up to 20000 characters.

image

类型:string · 必填:是 · 可空:否

主输入图或首帧图,支持 HTTPS URL 或 Base64 data URL。

end_image

类型:string · 必填:否 · 可空:否

可选的结束帧图片,支持 HTTPS URL 或 Base64 data URL。

duration

类型:integer · 必填:否 · 可空:否

生成视频的时长,单位为秒。

resolution

类型:string · 必填:否 · 可空:否

输出视频分辨率。

aspect_ratio

类型:string · 必填:否 · 可空:否

输出视频宽高比。

seed

类型:integer · 必填:否 · 可空:否

随机种子;使用 -1 可获得随机结果。

请求示例

curl --request POST \
  --url https://aiapiaiapi.com/v1/video/generations \
  --header 'Authorization: Bearer $AIAPIAIAPI_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
      "model": "google/gemini-omni-1.1-flash/image-to-video",
      "prompt": "A cinematic camera movement through a forest",
      "image": "https://example.com/reference.jpg",
      "duration": 10,
      "resolution": "720p"
    }'

JSON

{
  "model": "google/gemini-omni-1.1-flash/image-to-video",
  "prompt": "A cinematic camera movement through a forest",
  "image": "https://example.com/reference.jpg",
  "duration": 10,
  "resolution": "720p"
}

响应

{
  "id": "vid_01K2ABC123",
  "object": "video.generation",
  "model": "google/gemini-omni-1.1-flash/image-to-video",
  "status": "queued",
  "progress": null,
  "outputs": [],
  "created_at": 1786960800,
  "started_at": null,
  "completed_at": null,
  "error": null
}

任务状态

使用创建响应中的 id 作为 task_id:

GET /v1/video/generations/{task_id}

{
  "id": "vid_01K2ABC123",
  "object": "video.generation",
  "model": "google/gemini-omni-1.1-flash/image-to-video",
  "status": "completed",
  "progress": 100,
  "outputs": [
    { "type": "video", "url": "https://cdn.example.com/videos/vid_01K2ABC123.mp4" }
  ],
  "created_at": 1786960800,
  "started_at": 1786960805,
  "completed_at": 1786960900,
  "error": null
}

错误响应

参数校验错误返回 HTTP 400,并包含稳定的错误代码。

{
  "error": {
    "type": "invalid_request_error",
    "code": "unsupported_value",
    "message": "The parameter value is not supported by this model.",
    "param": "duration"
  }
}

文档索引

获取完整文档索引:

https://aiapiaiapi.com/llms.txt

使用该文件发现所有可用的 API 文档。