> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mixroute.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Veo

> Veo video generation parameters, media objects, and request examples using MixRoute metadata.

Veo generates video with native audio. This page uses the Gemini Developer API field definitions. MixRoute keeps `model` and `prompt` at the root and places both media inputs and generation settings directly inside `metadata`.

`POST https://api.mixroute.ai/v1/video/generations`

<Info>
  Use a flat `metadata` object. Do not add `metadata.instances` or `metadata.parameters`. Veo 3 models generate audio natively; do not send `generateAudio`. Vertex-specific output storage, Pub/Sub, masks, and other enterprise-only settings are not part of this request format.
</Info>

## Models and Versions

| Model ID | Version |
| - | - |
| `veo-3.1-generate-preview` | Veo 3.1 |
| `veo-3.1-fast-generate-preview` | Veo 3.1 Fast |
| `veo-3.0-generate-001` | Veo 3 |
| `veo-3.0-fast-generate-001` | Veo 3 Fast |

Confirm route availability in the [Model Marketplace](https://console.mixroute.ai/models).

## Request Parameters

| Field | Type | Required | Description |
| - | - | - | - |
| `model` | string | Yes | Complete MixRoute route ID. |
| `prompt` | string | Yes | MixRoute video prompt describing the scene and motion; may include dialogue, sound effects, and music cues. |
| `metadata` | object | Conditional | Required when supplying the media inputs or generation settings below. |
| `metadata.image` | object | No | First-frame Image object. Use `bytesBase64Encoded` for the raw Base64 string and `mimeType` for its MIME type, such as `image/png` or `image/jpeg`. |
| `metadata.lastFrame` | object | Conditional | Last-frame Image object for interpolation, with the same fields as `image`. Must be used together with `metadata.image`. |
| `metadata.referenceImages` | object\[] | No | Veo 3.1 reference inputs, at most three objects. Each contains `image` (Image object) and `referenceType: "asset"`. Use an 8-second duration. |
| `metadata.video` | object | No | Veo 3.1 extension input from a previous Veo generation. Supply `uri`, or Base64 bytes in `encodedVideo` with MIME type in `encoding`; do not use Vertex `gcsUri` or `bytesBase64Encoded` video fields. |
| `metadata.durationSeconds` | integer | No | Veo 3.1: 4, 6, or 8 seconds. Use 8 for reference images, extension, 1080p, or 4k. Veo 3/3 Fast generate 8-second videos. |
| `metadata.aspectRatio` | string | No | Values: `16:9` (default) or `9:16`. Legacy Veo 3 1080p output requires `16:9`. |
| `metadata.resolution` | string | No | Veo 3.1: `720p` (default), `1080p`, `4k`; 1080p/4k require 8 seconds. Extension is 720p only. Veo 3/3 Fast use 720p or 1080p. |
| `metadata.sampleCount` | integer | No | Number of generated videos. Gemini Developer API produces one video per request; use `1`. |
| `metadata.negativePrompt` | string | No | Description of content or visual characteristics to exclude from the video. |
| `metadata.personGeneration` | string | No | For Veo 3.1, text-to-video/extension uses `allow_all`; image/interpolation/reference modes use `allow_adult`. Regional policy can restrict the available choice to `allow_adult`. |
| `metadata.enhancePrompt` | boolean | No | Veo 3/3.1 do not support disabling prompt rewriting. Omit this field; false is not a supported off switch. |

## Scenario Constraints

* Image objects use raw Base64 data, not a `data:image/...;base64,` prefix or an arbitrary URL string.
* Reference images and video extension are Veo 3.1 capabilities; do not apply them to legacy Veo 3 routes.
* Extension input must be a recent Veo output: 720p, 16:9 or 9:16, at most 141 seconds, and still within its retention window. Each extension adds 7 seconds, up to 20 extensions and 148 seconds total; `durationSeconds` must still be 8 for the extension request.
* Frame rate is 24 fps and audio is generated natively. Output retention is limited; retrieve completed results promptly.

## Examples

Set `MIXROUTE_API_KEY` before calling the API. Replace media placeholders with accessible inputs. Accepted requests create billable generation tasks; do not automatically resubmit after a submission timeout.

<Tabs>
  <Tab title="Text to video">
    ```bash theme={null}
    curl --location "https://api.mixroute.ai/v1/video/generations" \
      --header "Authorization: Bearer $MIXROUTE_API_KEY" \
      --header "Content-Type: application/json" \
      --data '{
      "model": "veo-3.1-fast-generate-preview",
      "prompt": "A blue circle gently pulses on a clean white background.",
      "metadata": {
        "durationSeconds": 4,
        "aspectRatio": "9:16",
        "resolution": "720p",
        "sampleCount": 1
      }
    }'
    ```
  </Tab>
</Tabs>

### Python

```python theme={null}
import json
import os
import requests

payload = json.loads(r'''
{
  "model": "veo-3.1-fast-generate-preview",
  "prompt": "A blue circle gently pulses on a clean white background.",
  "metadata": {
    "durationSeconds": 4,
    "aspectRatio": "9:16",
    "resolution": "720p",
    "sampleCount": 1
  }
}
''')
response = requests.post(
    "https://api.mixroute.ai/v1/video/generations",
    headers={"Authorization": "Bearer " + os.environ["MIXROUTE_API_KEY"]},
    json=payload,
    timeout=60,
)
response.raise_for_status()
print(response.json())
```

## Task Results

Save the MixRoute task ID returned by submission and poll [Query Video Task](/api-reference/endpoint/query-video-task). A successful submission creates a task; read the result only after the task reaches a successful terminal state. Response envelopes and result locations vary by route.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.