> ## 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 First and Last Frame Video Generation

Use the Google Veo 3.1 model to generate a transition video based on the provided first-frame and last-frame images. Supports durations of 4/6/8 seconds, 720p and 1080p resolutions, and optional audio generation.

<Tip>
  This is an **asynchronous** API and will only return the task\_id of the async task. You should use this task\_id to request the [Get Task Result API](/en/docs/models/reference-get-async-task-result) to retrieve the generated result.
</Tip>

## 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="seed" type="integer">
  Random seed used to reproduce the generated result.

  Value range: \[0, 4294967295]
</ParamField>

<ParamField body="image" type="string" required={true}>
  First-frame image. Supports image URLs or Base64-encoded data. Format requirements: JPEG or PNG, up to 20 MB.
</ParamField>

<ParamField body="prompt" type="string" required={true}>
  Text prompt describing the video transition content between the first frame and the last frame.
</ParamField>

<ParamField body="last_image" type="string" required={true}>
  Last-frame image. Supports image URLs or Base64-encoded data. Format requirements: JPEG or PNG, up to 20 MB.
</ParamField>

<ParamField body="resolution" type="string" default="720p">
  Output video resolution.

  Available values: `720p`, `1080p`
</ParamField>

<ParamField body="aspect_ratio" type="string" default="16:9">
  Output video aspect ratio.

  Available values: `16:9`, `9:16`
</ParamField>

<ParamField body="sample_count" type="integer" default={1}>
  Number of generated video samples (1-4).

  Value range: \[1, 4]
</ParamField>

<ParamField body="enhance_prompt" type="boolean" default={true}>
  Whether to use Gemini to enhance the prompt. This feature cannot be disabled on Veo 3.x.
</ParamField>

<ParamField body="generate_audio" type="boolean" default={false}>
  Whether to generate audio at the same time.
</ParamField>

<ParamField body="negative_prompt" type="string">
  Describes content to avoid in the generated video.
</ParamField>

<ParamField body="duration_seconds" type="integer" default={8}>
  Generated video duration (seconds), supporting 4, 6, and 8 seconds.

  Available values: `4`, `6`, `8`
</ParamField>

<ParamField body="person_generation" type="string" default="allow_adult">
  Whether to allow generating people. allow\_adult: allow generating adults; dont\_allow: do not allow generating people; allow\_all: allow all people.

  Available values: `allow_adult`, `dont_allow`, `allow_all`
</ParamField>

## Response Information

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