Skip to main content
POST
/
v1beta
/
models
/
{model_name}
:predictLongRunning
Video to Video
curl --request POST \
  --url https://gptproto.com/v1beta/models/{model_name}:predictLongRunning \
  --header 'Content-Type: <content-type>' \
  --header 'x-goog-api-key: <x-goog-api-key>' \
  --data '{
  "instances": [
    {
      "prompt": "<string>",
      "video": {
        "uri": "<string>"
      }
    }
  ],
  "parameters": {
    "resolution": "<string>"
  }
}'
{
  "error": {
    "message": "Invalid signature",
    "type": "401"
  }
}

Overview

This endpoint transforms existing videos based on text descriptions using Google’s Gemini Veo 3.1 model. The API accepts a video 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

instances
array
required
An array of instances containing the video generation parameters
parameters
object
Additional parameters for video generation

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",
            "video": {
                "uri": "https://generativelanguage.googleapis.com/v1beta/files/acwe2jipjo5j:download?alt=media"
            }
        }
    ],
    "parameters": {
        "resolution": "720p"
    }
}'

Response

Success
200
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

{
  "error": {
    "message": "Invalid signature",
    "type": "401"
  }
}