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

# Veo 3.1 Text-to-Video

<Info>
  The Veo 3.1 Preview version API has been automatically made compatible with this endpoint
</Info>

Generate high-quality video content from text descriptions using the Veo 3.1 video generation model. This API uses asynchronous processing and requires querying the final result via task\_id.

## Request Headers

<ParamField header="Content-Type" type="string" required={true}>
  Enum: `application/json`
</ParamField>

<ParamField header="Authorization" type="string" required={true}>
  Bearer authentication format: Bearer \{\{API Key}}.
</ParamField>

## Request Body

<ParamField body="prompt" type="string" required={true}>
  A text string describing the video you want to generate.
</ParamField>

<ParamField body="aspect_ratio" type="string" required={false}>
  Specifies the aspect ratio of the generated video.

  Enum: `16:9`, `9:16`. Default: `16:9`.
</ParamField>

<ParamField body="duration_seconds" type="integer" required={false}>
  The length of the video file you want to generate (in seconds).

  Enum: `4`, `6`, `8`. Default: `8`.
</ParamField>

<ParamField body="enhance_prompt" type="boolean" required={false}>
  Specifies whether to use Gemini to enhance your prompt. Only `true` is supported.

  Default: `true`
</ParamField>

<ParamField body="generate_audio" type="boolean" required={true}>
  Specifies whether to generate audio for the video.
</ParamField>

<ParamField body="negative_prompt" type="string" required={false}>
  A text string describing content you want to prevent the model from generating.
</ParamField>

<ParamField body="person_generation" type="string" required={false}>
  Safety setting that controls whether person or face generation is allowed.

  Enum:

  * `allow_adult` (default): Only allows generating adults
  * `dont_allow`: Does not allow including people or faces in the image
</ParamField>

<ParamField body="resolution" type="string" required={false}>
  Resolution of the generated video.

  Enum: `720p` (default) or `1080p`
</ParamField>

<ParamField body="sample_count" type="integer" required={false}>
  Number of videos to generate.

  Range: 1-4
</ParamField>

<ParamField body="seed" type="uint32" required={false}>
  A number used to initialize the random generation process. Using the same seed, prompt, and other parameters produces the same output video, making the generation process deterministic.

  Range: 0-4,294,967,295
</ParamField>

## Response

<ResponseField name="task_id" type="string" required={true}>
  The task\_id of the async task. Use the task\_id to call the [Get Async Task Result API](/docs/models/reference-get-async-task-result) to retrieve the generated result.
</ResponseField>
