Unode
User GuideAPI ReferenceHelp & SupportBusiness Cooperation

Veo Video Generation

Google Veo provides text-to-video, image-to-video, first-and-last-frame, and reference-image generation through the same asynchronous video API.


Supported Models

ModelDescription
veo-3.1-generate-previewVeo 3.1 video generation model; supports every mode documented below
veo-3.1-fast-generate-previewFaster Veo 3.1 generation model; reference images are not supported

Overview

All generation modes use POST /v1/video/generations. The request fields determine the mode: omit image fields for text-to-video, provide image for image-to-video, add metadata.lastFrame to control the final frame, or provide metadata.referenceImages for asset and style references.

Generation is asynchronous:

  1. Submit a generation task.
  2. Poll its status using the returned task ID.
  3. Retrieve the generated video from the returned URL or base64 data.

Task Status Flow

queued → processing → succeeded
                 ↓
               failed

Depending on the provider, a completed video is returned as base64 data in bytes_base64_encoded or through the URL in url.


API List

MethodPathDescription
POST/v1/video/generationsSubmit a video generation task
GET/v1/video/generations/{task_id}Query task status and retrieve its result

1. Submit Video Generation Task (/v1/video/generations)

Choose the tab that matches your input and adjust the shared optional metadata as needed.

Usage Examples

Omit all image fields to generate a video from text alone.

{
  "model": "veo-3.1-generate-preview",
  "prompt": "A cat playing piano in a beautiful garden",
  "metadata": {
    "aspectRatio": "16:9",
    "durationSeconds": 8,
    "negativePrompt": "blurry, low quality",
    "personGeneration": "allow_all",
    "resolution": "1080p",
    "sampleCount": 1
  }
}

Provide a base64-encoded image in image. It becomes the video's first frame.

{
  "model": "veo-3.1-generate-preview",
  "prompt": "The cat begins playing the piano as flowers sway in the breeze",
  "image": "<BASE64_ENCODED_IMAGE_DATA>",
  "metadata": {
    "aspectRatio": "16:9",
    "durationSeconds": 8,
    "personGeneration": "allow_adult"
  }
}

Use image for the first frame and metadata.lastFrame for the last frame. This mode is supported by Veo 3.1 models.

{
  "model": "veo-3.1-generate-preview",
  "prompt": "The garden changes gradually from sunrise to sunset",
  "image": "<BASE64_ENCODED_FIRST_FRAME>",
  "metadata": {
    "lastFrame": "<BASE64_ENCODED_LAST_FRAME>",
    "durationSeconds": 8
  }
}

Provide the first-frame image plus up to three asset or style references in metadata.referenceImages. This mode is only supported by veo-3.1-generate-preview.

{
  "model": "veo-3.1-generate-preview",
  "prompt": "A cat plays piano in a garden matching the supplied visual style",
  "image": "<BASE64_ENCODED_FIRST_FRAME>",
  "metadata": {
    "referenceImages": [
      {
        "image": "<BASE64_ENCODED_CAT_REFERENCE>",
        "referenceType": "asset"
      },
      {
        "image": "<BASE64_ENCODED_STYLE_REFERENCE>",
        "referenceType": "style"
      }
    ]
  }
}

Complete Request

curl -X POST "https://www.unodetech.xyz/v1/video/generations" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer API_KEY" \
  -d @request-body.json

Request Headers

HeaderRequiredValue
Content-TypeYesapplication/json
AuthorizationYesBearer API_KEY

Request Body Fields

Response Example

{
  "id": "TASK_ID",
  "task_id": "TASK_ID",
  "object": "video",
  "model": "veo-3.1-generate-preview",
  "status": "queued",
  "progress": 0,
  "created_at": 1764616538
}

Response Body Fields

2. Query Task Status (/v1/video/generations/{task_id})

Complete Request

curl -X GET "https://www.unodetech.xyz/v1/video/generations/TASK_ID" \
  -H "Authorization: Bearer API_KEY"

Request Headers

HeaderRequiredValue
AuthorizationYesBearer API_KEY

Path Parameters

Response Examples

{
  "code": "success",
  "message": "",
  "data": {
    "bytes_base64_encoded": "",
    "error": null,
    "format": "mp4",
    "metadata": null,
    "status": "processing",
    "task_id": "TASK_ID",
    "url": ""
  }
}
{
  "code": "success",
  "message": "",
  "data": {
    "bytes_base64_encoded": "",
    "error": null,
    "format": "mp4",
    "metadata": null,
    "status": "succeeded",
    "task_id": "TASK_ID",
    "url": "https://www.unodetech.xyz/v1/videos/TASK_ID/content"
  }
}
{
  "code": "success",
  "message": "",
  "data": {
    "bytes_base64_encoded": "",
    "error": null,
    "format": "mp4",
    "metadata": null,
    "status": "failed",
    "task_id": "TASK_ID",
    "url": "Reference to video does not support this mix of reference images."
  }
}

When a task fails, url may contain the provider error message instead of a video URL.

Response Body Fields

Important Notice

Due to Google's Responsible AI Guidelines, Gemini-channel tasks can finish successfully while their outputs are blocked. Check data.metadata.rai_media_filtered_count and data.metadata.rai_media_filtered_reasons before treating an empty result as a transport failure.

Last updated on