Skip to main content
POST
https://gptproto.com
/
v1beta
/
models
/
veo-3.1-generate-preview:predictLongRunning
veo-3.1-generate-preview (Image To Video)
curl --request POST \
  --url https://gptproto.com/v1beta/models/veo-3.1-generate-preview:predictLongRunning

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://gptproto.com/v1beta/models/veo-3.1-generate-preview:predictLongRunning' \
--header 'x-goog-api-key: GPTPROTO_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
  "instances": [
    {
      "prompt": "Generate a video of a real-life model posing for a photoshoot.",
      "image": {
        "mimeType": "image/png",
        "bytesBase64Encoded": "BASE64_ENCODED_IMAGE"
      }
    }
  ],
  "parameters": {
    "aspectRatio": "9:16"
  }
}'

Query Result

After submitting a video generation request, the API returns an operation object. Use the operation name to poll for the result.
curl -X GET "https://api.gptproto.com/v1beta/models/{model}/operations/{operation_id}" \
  -H "x-goog-api-key: GPTPROTO_API_KEY" \
  -H "Content-Type: application/json"
Query URL uses api.gptproto.com domain. Replace {model} with the model name and {operation_id} with the operation ID from the generation response.
{
  "name": "models/veo-3.1-generate-preview/operations/abc123",
  "done": true,
  "response": {
    "generateVideoResponse": {
      "generatedSamples": [
        {
          "video": {
            "uri": "https://api.gptproto.com/upload/v1beta/files/abc:download?alt=media",
            "encoding": "video/mp4"
          }
        }
      ]
    }
  }
}

Download Video

Once the operation is complete, use the video URI from the response to download the generated video.
curl -L "https://api.gptproto.com/upload/v1beta/files/{file_id}:download?alt=media" \
  -H "x-goog-api-key: GPTPROTO_API_KEY" \
  -o output.mp4
Replace {file_id} with the file ID from the video URI in the query response (e.g. abc from .../files/abc:download?alt=media).

Parameters

Path Parameters

Endpoint: https://gptproto.com/v1beta/models/{model}:predictLongRunning
ModelDescription
veo-3.1-generate-previewVeo 3.1 standard — highest quality
veo-3.1-fast-generate-previewVeo 3.1 Fast — optimized for speed

Request Body

The request uses Google’s Vertex AI format with instances and parameters arrays.

instances[0] — Core Parameters

ParameterTypeRequiredDefaultDescription
promptstring✅ Yes-A text description of the desired video. Supports audio cues.
imageobject❌ No-Source image for image-to-video generation.
image.mimeTypestring❌ No-MIME type of the image (e.g. image/png, image/jpeg).
image.bytesBase64Encodedstring❌ No-Base64-encoded image data.
videoobject❌ No-Source video for video-to-video generation (editing/extension).
video.uristring❌ No-URL of the source video.

parameters — Advanced Parameters

ParameterTypeRequiredDefaultRangeDescription
aspectRatiostring❌ No16:916:9
9:16
The aspect ratio of the generated video.
resolutionstring❌ No720p720p
1080p
4k
The resolution of the generated video. 1080p and 4k only support 8s duration.
durationSecondsstring❌ No-4, 6, 8Length of the generated video in seconds. Must be 8 for 1080p/4k.
personGenerationstring❌ No-allow_all
allow_adult
Controls the generation of people.
enhancePromptboolean❌ Notruetrue, falseWhether to enhance the prompt for better quality.

Scene Comparison

Featuretext-to-videoimage-to-videovideo-to-video
prompt✅ Required✅ Required✅ Required
image✅ Required
video✅ Required
aspectRatio
resolution
Audio cues in prompt
Notes:
  • veo-3.1-generate-preview: Highest quality, suitable for professional content.
  • veo-3.1-fast-generate-preview: Lower latency, suitable for high-volume tasks.
  • Video retention: Generated videos are stored for 2 days.
  • Watermarking: Videos are watermarked using Google SynthID.

Error Codes

Common Error Codes

Error CodeError NameDescription
401UnauthorizedAPI key is missing or invalid
403ForbiddenYour API key doesn’t have permission to access this resource, or insufficient balance for the requested operation
429Too Many RequestsYou’ve exceeded your rate limit
500Internal server errorAn internal server error occurred
503Content policy violationContent blocked due to safety concerns (actual status code is 400)