gemini-omni-flash-preview

gemini-omni-flash-preview
视频Googlegemini-omni-videogemini-omni-flash-preview
gemini-omni-video

Authentication

Base URL
https://host.docker.internal:8000
Authorization
Authorization: Bearer YOUR_API_KEY
Content-Type
application/json
Model name
gemini-omni-flash-preview

Integration protocols

Why this protocol

适合使用 Google Interactions 原生接口提交多模态视频任务并轮询状态的用户。

Endpoint
POST/v1beta/interactions
Authorization: Bearer YOUR_API_KEYContent-Type: application/json

Request / Response JSON

// REQUEST
{
  "model": "gemini-omni-flash-preview",
  "background": true,
  "input": [
    {
      "type": "image",
      "data": "BASE64_IMAGE_DATA",
      "mime_type": "image/jpeg"
    },
    {
      "type": "text",
      "text": "让参考图中的主体自然运动,保持外观一致,使用单一连续镜头。"
    }
  ],
  "generation_config": {
    "video_config": {
      "task": "image_to_video"
    }
  },
  "response_format": {
    "type": "video",
    "aspect_ratio": "16:9",
    "delivery": "uri"
  }
}
// RESPONSE
{
  "id": "interaction_example",
  "object": "interaction",
  "status": "completed",
  "model": "gemini-omni-flash-preview",
  "steps": [
    {
      "type": "model_output",
      "content": [
        {
          "type": "video",
          "mime_type": "video/mp4",
          "uri": "https://host.docker.internal:8000/v1beta/files/file_example:download"
        }
      ]
    }
  ],
  "usage": {
    "total_input_tokens": 22,
    "total_output_tokens": 58805,
    "total_tokens": 59183
  }
}

Request / Response schema

// INPUT SCHEMA
FieldTypeRequired
modelstringY
backgroundbooleanY
inputarrayY
input[]objectY
input[].typestringY
input[].datastringY
input[].mime_typestringY
generation_configobjectY
generation_config.video_configobjectY
generation_config.video_config.taskstringY
response_formatobjectY
response_format.typestringY
response_format.aspect_ratiostringY
response_format.deliverystringY
// RESPONSE SCHEMA
FieldTypeRequired
idstringY
objectstringY
statusstringY
modelstringY
stepsarrayY
steps[]objectY
steps[].typestringY
steps[].contentarrayY
steps[].content[]objectY
steps[].content[].typestringY
steps[].content[].mime_typestringY
steps[].content[].uristringY
usageobjectY
usage.total_input_tokensintegerY
usage.total_output_tokensintegerY
usage.total_tokensintegerY

Code examples

cURLrequest.sh
curl -X POST "https://host.docker.internal:8000/v1beta/interactions" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
  "model": "gemini-omni-flash-preview",
  "background": true,
  "input": [
    {
      "type": "image",
      "data": "BASE64_IMAGE_DATA",
      "mime_type": "image/jpeg"
    },
    {
      "type": "text",
      "text": "让参考图中的主体自然运动,保持外观一致,使用单一连续镜头。"
    }
  ],
  "generation_config": {
    "video_config": {
      "task": "image_to_video"
    }
  },
  "response_format": {
    "type": "video",
    "aspect_ratio": "16:9",
    "delivery": "uri"
  }
}'

# Poll status cURL
# Replace interaction_example with the interaction_id returned by the create response
curl -X GET "https://host.docker.internal:8000/v1beta/interactions/interaction_example" \
  -H "Authorization: Bearer YOUR_API_KEY"