Overview
This endpoint generates videos from images based on text descriptions using Google’s Gemini Veo 3.1 model. The API accepts an image URI along with a text prompt and returns a long-running operation for video generation.
Authentication
This endpoint requires authentication using an API key.
x-goog-api-key
string
default: "sk-***********"
required
Your API key in the format: YOUR_API_KEY
Content-Type
string
default: "application/json"
required
Must be set to application/json
Parameters
model_name
string
default: "veo-3.1-generate-preview"
required
The name of the model to use for the request.
Request Body
An array of instances containing the video generation parameters The text prompt describing the video animation you want to generate from the image
The source image information The URI of the source image file (must be a valid Google Cloud Storage or Generative Language API file URI)
Additional parameters for video generation The resolution of the output video. Options: 720p, 1080p
Request Example
curl --location 'https://api.gptproto.com/v1beta/models/veo-3.1-generate-preview:predictLongRunning' \
--header 'x-goog-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"instances": [
{
"prompt": "The cat starts walking forward",
"image": {
"uri": "https://generativelanguage.googleapis.com/v1beta/files/abc123:download?alt=media"
}
}
],
"parameters": {
"resolution": "720p"
}
}'
Response
Successful response returns a long-running operation {
"name" : "operations/veo-3.1-generate-preview-xxxxx" ,
"metadata" : {
"@type" : "type.googleapis.com/google.cloud.aiplatform.v1beta1.GenerateVideoMetadata" ,
"createTime" : "2025-01-19T00:00:00Z"
}
}
Error Responses
401 - Invalid signature
403 - Invalid Token
403 - Insufficient balance
500 - Internal server error
503 - Content policy violation
{
"error" : {
"message" : "Invalid signature" ,
"type" : "401"
}
}