> ## 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 图生视频

<Info>
  Veo 3.1 Preview 版本 API 已自动兼容到本接口
</Info>

使用 Veo 3.1 视频生成模型，通过输入图像和文本描述生成高质量视频内容。该接口采用异步处理方式，需要通过 task\_id 查询最终生成结果。

## 请求头

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

<ParamField header="Authorization" type="string" required={true}>
  Bearer 身份验证格式: Bearer \{\{API 密钥}}。
</ParamField>

## 请求体

<ParamField body="prompt" type="string" required={true}>
  描述您想要生成的视频的文本字符串。
</ParamField>

<ParamField body="image" type="string" required={false}>
  输入图像，支持 URL 或 base64 编码的方式。
</ParamField>

<ParamField body="last_image" type="string" required={false}>
  结尾图像，用于填充视频最后一帧图像。支持 URL 或 base64 编码的方式。
</ParamField>

<ParamField body="reference_images" type="object[]" required={false}>
  最多三张 `asset` 图像或最多一张 `style` 图像的列表，用于描述模型在生成视频时使用的参考图像。

  <Expandable title="properties">
    <ParamField body="image" type="string" required={false}>
      参考图像，支持 URL 或 base64 编码的方式。
    </ParamField>

    <ParamField body="reference_type" type="string" required={true}>
      指定提供的参考图像类型。支持以下值：

      * `asset`: 参考图像为生成的视频提供资产，例如：场景、物体或角色。
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="aspect_ratio" type="string" required={false}>
  指定生成视频的宽高比。

  枚举值: `16:9`、`9:16`。默认值为 `16:9`。
</ParamField>

<ParamField body="duration_seconds" type="integer" required={false}>
  您想要生成的视频文件的长度（秒）。

  枚举值: `4`、`6`、`8`，当使用 `reference_images` 时只能为 `8` 。

  默认值为 `8`。
</ParamField>

<ParamField body="enhance_prompt" type="boolean" required={false}>
  指定是否使用 Gemini 增强您的提示词。仅支持 `true`。

  默认值: `true`
</ParamField>

<ParamField body="generate_audio" type="boolean" required={true}>
  指定是否为视频生成音频。
</ParamField>

<ParamField body="negative_prompt" type="string" required={false}>
  描述您想要阻止模型生成的内容的文本字符串。
</ParamField>

<ParamField body="person_generation" type="string" required={false}>
  控制是否允许人物或面部生成的安全设置。

  枚举值:

  * `allow_adult` (默认): 仅允许生成成人
  * `dont_allow`: 不允许在图像中包含人物或面部
  * `allow_all`: 允许生成所有年龄段的人物（需项目在 allowlist 中）
</ParamField>

<ParamField body="resolution" type="string" required={false}>
  生成视频的分辨率。

  枚举值: `720p` (默认) 或 `1080p`
</ParamField>

<ParamField body="sample_count" type="integer" required={false}>
  要生成的视频样本数量。

  取值范围: 1-4
</ParamField>

<ParamField body="seed" type="uint32" required={false}>
  用于初始化随机生成过程的数字。使用相同的种子、提示词和其他参数会产生相同的输出视频，使生成过程具有确定性。

  取值范围: 0-4,294,967,295
</ParamField>

## 响应信息参数

<ResponseField name="task_id" type="string" required={true}>
  异步任务的 task\_id。您应该使用该 task\_id 请求 [查询任务结果 API](/docs/models/reference-get-async-task-result) 以获取生成结果
</ResponseField>
