Overview
This endpoint generates videos from text descriptions using Google’s Gemini Veo 3.1 model. The API accepts 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
instances[].prompt
string
default: "a cat"
required
The text prompt describing the video content you want to generate
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": "a cat"
}
]
}'
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"
}
}