Generate videos from images with text prompts using Gemini Veo 3.1
The operation_id can be obtained from the response of the predictLongRunning endpoint.
After a successful query, the API returns a URL (response.generateVideoResponse.generatedSamples.video.uri) for downloading the video. This URL is required when making the request.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
instances | array | ✅ Yes | - | An array of instances containing the video generation parameters The text prompt describing the video animation you want to generate from the image |
image | object | ✅ Yes | - | The source image information The URI of the source image file (must be a valid Google Cloud Storage or Generative Language API file URI). Either uri or bytesBase64Encoded must be provided. |
mimeType | string | ❌ No | - | The MIME type of the image (e.g., image/png, image/jpeg). Required when using bytesBase64Encoded. |
bytesBase64Encoded | string | ❌ No | - | Base64-encoded image data. Either uri or bytesBase64Encoded must be provided. |
parameters | object | ❌ No | - | Additional parameters for video generation The duration of the output video in seconds. Default: 8 |
aspectRatio | string | ❌ No | - | The aspect ratio of the output video. Options: 9:16, 16:9, 1:1. Default: 9:16 |
resolution | string | ❌ No | - | The resolution of the output video. Options: 720p, 1080p |
durationSeconds | number | ❌ No | - | The duration of the output video in seconds. Default: 8 ,Options: 4, 6, 8 |