Skip to content

Gemini Omni Flash Video API ​

Gemini Omni Flash is a high-performance multimodal model for fast video generation, editing, and cinematic control. It can use text, images, audio, and video together, supports conversational editing through the Interactions API, and can apply Gemini world knowledge to physical scenes and storytelling.

Calling Method ​

Endpoint and Authentication ​

Use these Interactions endpoints to create requests or retrieve results:

text
POST https://api.exchangetoken.ai/v1beta/interactions
GET  https://api.exchangetoken.ai/v1beta/interactions/{id}

Use your Exchange Token API key in either of the following authentication headers:

http
x-goog-api-key: YOUR_API_KEY
http
Authorization: Bearer YOUR_API_KEY

Content-Type Header:

http
Content-Type: application/json

Request Body ​

The request body follows the Vertex AI Interactions API create schema. The examples below use these common fields:

FieldTypeRequiredDescription
modelstringYesModel name. Text and video editing examples use gemini-omni-flash-preview; set $MODEL in image examples to the model you are calling.
previous_interaction_idstringNoThe previous interaction's id, used to continue editing a generated video.
inputstring, content object, or content arrayYesMain interaction input. Use a string for text-to-video, or an array for multimodal image/video editing input.
input[].typestringConditionalContent item type, such as text, image, video, or user_input.
input[].textstringConditionalText prompt when type is text.
input[].datastringConditionalBase64 image content. Videos use uri and do not accept Base64 data.
input[].uristringConditionalMedia file address.
input[].mime_typestringConditionalMIME type for media inputs, such as image/jpeg, image/png, or video/mp4.
input[].contentarrayConditionalNested content array when using a user_input wrapper.
backgroundbooleanNoRun in the background; defaults to false.
storebooleanNoDefaults to true.
streambooleanNoReturn SSE events; defaults to false.
response_formatobject or arrayNoOutput format options. Examples use an object; for an array, configure each output item.
response_format.typestringNoSet to video for video output.
response_format.deliverystringNoDelivery mode. Examples use uri to receive a video link.
response_format.aspect_ratiostringNoVideo aspect ratio: 16:9 or 9:16.
response_format.resolutionstringNoOutput resolution, such as 720p.
response_format.durationstringNoVideo duration, such as 5s; include the number and unit in one string.
response_format.gcs_uristringOmitThe platform supplies storage for video URI output.
generation_configobjectNoGeneration options.
generation_config.video_config.taskstringNoOptional video task hint. Values include text_to_video, image_to_video, reference_to_video, edit, and extend; follow the selected model's parameter constraints.

TIP

To receive a video link, set both response_format.type: video and response_format.delivery: uri, and omit gcs_uri. The platform allocates output storage and converts storage URIs in model output to signed download links.

Response Body ​

Common fields:

FieldTypeDescription
idstringUnique identifier of the interaction
objectstringResource type identifier, typically interaction
statusstringCurrent interaction status, such as in_progress, completed, or failed
rolestringRole associated with the response payload, typically model
createdstringInteraction creation time in ISO 8601 format
updatedstringLast interaction update time in ISO 8601 format
modelstringName of the model used for the interaction
stepsarrayOrdered step objects returned by the interaction
usageobjectToken usage summary for the interaction when provided by upstream

Common steps fields:

FieldTypeDescription
typestringStep type, for example model_output
contentarrayContent items carried by the step
content[].uristringVideo download URL; read it from a type: model_output step

Example:

json
{
  "id": "v1_...",
  "status": "completed",
  "role": "model",
  "created": "2026-05-27T06:15:03Z",
  "updated": "2026-05-27T06:15:03Z",
  "steps": [
    {
      "content": [
        {
          "text": "",
          "type": "text"
        }
      ],
      "type": "model_output"
    },
    {
      "content": [
        {
          "mime_type": "video/mp4",
          "uri": "https://storage.googleapis.com/example-bucket/output.mp4?X-Goog-Signature=EXAMPLE",
          "type": "video"
        }
      ],
      "type": "model_output"
    }
  ],
  "object": "interaction",
  "model": "gemini-omni-flash-preview"
}

Get an Input Video URI ​

Video input must be provided through uri and only supports Google Cloud Storage addresses (gs://...). Base64 video input is not supported. If you have a publicly accessible gs:// address, use it directly. Otherwise, use the platform's Google Cloud Storage upload feature: follow the steps below to upload the video and use the returned gcs_uri as the input URI.

Get an Upload URL ​

Call the upload URL endpoint with your Exchange Token API key. The request body accepts only an optional filename to specify the file name.

bash
curl --fail-with-body -sS -X POST "https://api.exchangetoken.ai/v1/storage/upload-urls" \
  -H "x-goog-api-key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"filename":"source.mp4"}' \
  -o upload.json

Example response:

json
{
  "upload_url": "https://storage.googleapis.com/BUCKET/uploads/.../source.mp4?X-Goog-...",
  "gcs_uri": "gs://BUCKET/uploads/.../source.mp4",
  "expires_at": "2026-10-14T00:00:00Z",
  "method": "PUT",
  "headers": {}
}

Use upload_url to upload the file and set the video input's uri field in the Interactions API to gcs_uri. The upload link is valid for 24 hours; check expires_at for its exact expiry. This request only allocates an upload URL; the video file still needs to be uploaded.

Upload a Local Video ​

Read the addresses from upload.json and upload the local file with PUT. The example uses Bash, curl, and jq.

bash
VIDEO_FILE="./source.mp4"
UPLOAD_URL=$(jq -er '.upload_url' upload.json)
VIDEO_URI=$(jq -er '.gcs_uri' upload.json)

curl --fail-with-body -sS -X PUT "$UPLOAD_URL" \
  --upload-file "$VIDEO_FILE"

After upload, $VIDEO_URI can be used as the uri of a video content item in an Interactions API request.

Text to Video ​

Generate a video with audio from a text prompt. For best results, describe the scene, camera movement, lighting, mood, and key actions.

bash
curl -X POST "https://api.exchangetoken.ai/v1beta/interactions" \
  -H "x-goog-api-key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-omni-flash-preview",
    "input": "A marble rolling fast on a chain reaction style track, continuous smooth shot.",
    "response_format": { "type": "video", "delivery": "uri" }
  }'

Control Aspect Ratio ​

Set response_format.aspect_ratio to 9:16 for portrait video or 16:9 for landscape video.

bash
curl -X POST "https://api.exchangetoken.ai/v1beta/interactions" \
  -H "x-goog-api-key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-omni-flash-preview",
    "input": "A futuristic city with neon lights and flying cars, cyberpunk style",
    "response_format": {
      "type": "video",
      "delivery": "uri",
      "aspect_ratio": "9:16"
    }
  }'

Image to Video ​

Put images and the text prompt in the same input array. Set $MODEL to the model you are calling and $BASE64_IMAGE to the image content encoded as Base64.

bash
curl -X POST "https://api.exchangetoken.ai/v1beta/interactions" \
  -H "x-goog-api-key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "'"$MODEL"'",
    "input": [
      { "type": "image", "data": "'"$BASE64_IMAGE"'", "mime_type": "image/jpeg" },
      { "type": "text", "text": "turn this into realistic footage, using the drawing only as a guide for movement, do not show the drawing in the final video" }
    ],
    "response_format": { "type": "video", "delivery": "uri" }
  }'

TIP

Images can also reference uploaded files through uri. For data, supply plain Base64 content and a mime_type matching the file.

Subject Reference ​

Put multiple reference images in the input array and describe the role of each image in the prompt.

bash
curl -X POST "https://api.exchangetoken.ai/v1beta/interactions" \
  -H "x-goog-api-key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "'"$MODEL"'",
    "input": [
      { "type": "image", "data": "'"$CAT_B64"'", "mime_type": "image/png" },
      { "type": "image", "data": "'"$YARN_B64"'", "mime_type": "image/png" },
      { "type": "text", "text": "A cat playfully batting at a ball of yarn." }
    ],
    "response_format": { "type": "video", "delivery": "uri" }
  }'

Task Parameter ​

Use generation_config.video_config.task to specify a task mode. The gateway forwards this field; when omitted, the model determines the task from the prompt and input media. See the Vertex AI VideoConfig definition.

Parameter values (follow the selected model's constraints):

  • text_to_video
  • image_to_video
  • reference_to_video
  • edit
  • extend
bash
curl -X POST "https://api.exchangetoken.ai/v1beta/interactions" \
  -H "x-goog-api-key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "'"$MODEL"'",
    "input": [
      { "type": "image", "data": "'"$BASE64_IMAGE"'", "mime_type": "image/jpeg" },
      { "type": "text", "text": "turn this into realistic footage, using the drawing only as a guide for movement, do not show the drawing in the final video" }
    ],
    "generation_config": {
      "video_config": {
        "task": "image_to_video"
      }
    },
    "response_format": { "type": "video", "delivery": "uri" }
  }'

Edit Your Own Videos ​

Submit the edit with $VIDEO_URI ready. See Get an Input Video URI for how to obtain the address.

bash
curl -sS -w "\n[HTTP %{http_code}]\n" "https://api.exchangetoken.ai/v1beta/interactions" \
  -H "x-goog-api-key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-omni-flash-preview",
    "input": [
      {
        "type": "user_input",
        "content": [
          {
            "type": "video",
            "mime_type": "video/mp4",
            "uri": "'"$VIDEO_URI"'"
          },
          {
            "type": "text",
            "text": "When the person touches the mirror, make the mirror ripple beautifully like liquid, and the person arm turns into reflective mirror material"
          }
        ]
      }
    ],
    "generation_config": { "video_config": { "task": "edit" } },
    "response_format": { "type": "video", "delivery": "uri" }
  }'

Multi-turn Editing ​

After the previous turn completes, previous_interaction_id references that interaction and input provides the new editing instructions. Subsequent requests must use the same API key and model.

When using previous_interaction_id, omit generation_config.video_config.task and describe the edits in input to avoid an upstream parameter conflict error.

bash
PREVIOUS_INTERACTION_ID="YOUR_INTERACTION_ID"

curl -X POST "https://api.exchangetoken.ai/v1beta/interactions" \
  -H "x-goog-api-key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-omni-flash-preview",
    "previous_interaction_id": "'"$PREVIOUS_INTERACTION_ID"'",
    "input": "Keep the subject and camera motion unchanged, and change the background to a snowy mountain.",
    "response_format": { "type": "video", "delivery": "uri" }
  }'

Background Generation and Retrieval ​

background: true enables background execution. Creation and retrieval requests must use the same API key for authentication.

bash
curl -X POST "https://api.exchangetoken.ai/v1beta/interactions" \
  -H "x-goog-api-key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-omni-flash-preview",
    "input": "A paper boat drifts across a quiet pond in soft morning light.",
    "background": true,
    "response_format": { "type": "video", "delivery": "uri" }
  }'

GET /v1beta/interactions/{id} retrieves the task status and result. The {id} path parameter is the interaction identifier returned by the creation request.

bash
INTERACTION_ID="YOUR_INTERACTION_ID"

curl --fail-with-body -sS "https://api.exchangetoken.ai/v1beta/interactions/$INTERACTION_ID" \
  -H "x-goog-api-key: $API_KEY" \
  -o result.json

The response field status indicates the task state:

StatusDescription
in_progressThe task is running and can be polled periodically.
completedThe task has completed; generated results are available in steps.
failedThe task has failed; error details are included in the response.
incompleteThe task did not complete fully; details are included in the response.