Skip to main content
POST
/
v1beta
/
models
/
veo-3.1-fast-generate-preview:predictLongRunning
veo (text to video)
curl --request POST \
  --url https://api.example.com/v1beta/models/veo-3.1-fast-generate-preview:predictLongRunning
Gemini’s veo 3.1 fast generate preview for the text to video API.

Authentication

  1. Sign up for a GPTProto account at https://gptproto.com
  2. Navigate to the API Keys section in your dashboard
  3. Generate a new API key (sk-xxxxx)
  4. Copy and securely store your API key For authentication details, please refer to the Authentication section.

Initiate Request

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 Example

{
    "name": "models/veo-3.1-generate-preview/operations/abc"
}

Query Task

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.
curl --location 'https://api.gptproto.com/v1beta/models/veo-3.1-generate-preview/operations/{operation_id}' \
  --header 'x-goog-api-key: YOUR_API_KEY'

Parameters

ParameterTypeRequiredDefaultDescription
instancesarray✅ Yes-An array of instances containing the video generation parameters
instances[].promptstring✅ Yesa catThe text prompt describing the video content you want to generate