Skip to main content
POST
/
v1beta
/
models
/
{model_name}
:predictLongRunning
Text 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": [
    {}
  ],
  "instances[].prompt": "<string>"
}'
{
  "error": {
    "message": "Invalid signature",
    "type": "401"
  }
}

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

instances
array
required
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

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"
  }
}