> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jiekou.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 API is automatically compatible with this endpoint
</Info>

Use the Veo 3.1 video generation model to generate high-quality video content from text descriptions. This endpoint uses asynchronous processing, and you need to query the final generation result using the task\_id.

## Request Headers

<ParamField header="Content-Type" type="string" required={true}>
  Enum value: `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 values: `16:9`, `9:16`. The default value is `16:9`.
</ParamField>

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

  Enum values: `4`, `6`, `8`. The default value is `8`.
</ParamField>

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

  Default value: `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 what you want to prevent the model from generating.
</ParamField>

<ParamField body="person_generation" type="string" required={false}>
  Safety setting that controls whether people or faces are allowed to be generated.

  Enum values:

  * `allow_adult` (default): Only adults are allowed to be generated
  * `dont_allow`: People or faces are not allowed in the image
  * `allow_all`: Allows generating people of all ages (requires the project to be in the allowlist)
</ParamField>

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

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

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

  Value 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 will produce the same output video, making the generation process deterministic.

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

## Response Parameters

<ResponseField name="task_id" type="string" required={true}>
  The task\_id of the asynchronous task. You should use this task\_id to request the [Query Task Result API](/en/docs/models/reference-get-async-task-result) to obtain the generation result.
</ResponseField>
