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

# Veo 3 视频生成 API

> 使用 Veo 3 模型生成4/6/ 8 秒高质量视频，支持文生视频、帧转视频和参考图模式，分辨率最高支持 4K。

通过 即刻API 统一网关调用 Veo 3 视频生成接口，支持文本生成视频、图生视频（帧转视频或参考图模式），时长4/6/ 8 秒，所有任务均为异步处理。

<Info>
  生成的视频链接有效期为 **24 小时**，请及时保存。
</Info>

## 请求参数

<ParamField body="model" default="veo31-fast-720p" type="string" required>
  视频生成模型名称。可用模型：

  * `veo31-fast-720p` — 快速生成模型，720p
  * `veo31-fast-1080p` — 快速生成模型，1080p
  * `veo31-720p` — 标准生成模型，720p
  * `veo31-1080p` — 标准生成模型，1080p
  * `veo31-ref-720p` — 参考图生视频模型，720p
  * `veo31-ref-1080p` — 参考图生视频模型，1080p

  示例：`"veo31-fast-720p"`
</ParamField>

<ParamField body="prompt" type="string" required>
  视频生成的文本描述。

  <ParamField body="size" type="string" required>
    视频尺寸，必须传具体分辨率字符串。

    请注意：

    * `size` 为必填参数
    * 必须传实际分辨率，不能传 `16:9`、`9:16`、`720p`、`1080p`
    * `size` 必须和所选 `model` 对应，否则接口会报错

    各模型支持的 `size` 如下：

    * `veo31-720p`：`1280x720` 或 `720x1280`
    * `veo31-1080p`：`1920x1080` 或 `1080x1920`
    * `veo31-ref-720p`：`1280x720` 或 `720x1280`
    * `veo31-ref-1080p`：`1920x1080` 或 `1080x1920`
    * `veo31-fast-720p`：`1280x720` 或 `720x1280`
    * `veo31-fast-1080p`：`1920x1080` 或 `1080x1920`

    你也可以按输出方向理解：

    * 横屏 720p：`1280x720`
    * 竖屏 720p：`720x1280`
    * 横屏 1080p：`1920x1080`
    * 竖屏 1080p：`1080x1920`

    示例：`"1280x720"`
  </ParamField>
</ParamField>

<ParamField body="seconds" type="string">
  视频时长（秒）。支持：

  * `4`
  * `6`
  * `8`
  * veo31-ref-720p、veo31-ref-1080p
    仅支持 8 秒

  示例：`"4"`

  说明：`seconds` 与 `duration` 二选一即可，推荐优先使用 `seconds`。
</ParamField>

<ParamField body="duration" type="integer">
  视频时长（秒）。支持：

  * `4`
  * `6`
  * `8`
  * veo31-ref-720p、veo31-ref-1080p
    仅支持 8 秒

  示例：`4`

  说明：`duration` 与 `seconds` 二选一即可。
</ParamField>

<ParamField body="input_reference" type="string">
  参考图输入。用于参考图生视频。

  支持两种方式：

  * 传图片 URL（JSON 请求中推荐）
  * 使用同名字段上传图片文件（`multipart/form-data` 请求中可用）

  示例：`"https://example.com/reference.jpg"`
</ParamField>

## 请求示例

<CodeGroup>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://geekapis.com/v1/videos \
    --header 'Authorization: Bearer <YOUR_API_KEY>' \
    --header 'Content-Type: application/json' \
    --data '{
      "model": "veo31-fast-720p",
      "prompt": "海豚在碧蓝海洋中跳跃",
      "size": "1280x720",
      "seconds": "4"
    }'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://geekapis.com/v1/videos/generations",
      headers={
          "Authorization": "Bearer <YOUR_API_KEY>",
          "Content-Type": "application/json"
      },
      json={
          "model": "veo3.1-fast",
          "prompt": "海豚在碧蓝海洋中跳跃",
          "duration": 8,
          "aspect_ratio": "16:9",
          "metadata": {
              "resolution": "720p"
          }
      }
  )
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://geekapis.com/v1/videos/generations", {
    method: "POST",
    headers: {
      "Authorization": "Bearer <YOUR_API_KEY>",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      model: "veo3.1-fast",
      prompt: "海豚在碧蓝海洋中跳跃",
      duration: 8,
      aspect_ratio: "16:9",
      metadata: {
        resolution: "720p"
      }
    })
  });
  const data = await response.json();
  console.log(data);
  ```
</CodeGroup>

/

## 返回示例

```json 200 theme={null}
{
  "id": "task_xxx",
  "task_id": "task_xxx",
  "object": "video",
  "model": "veo31-fast-4s-16x9-720p",
  "status": "queued",
  "progress": 0,
  "created_at": 1782462640,
  "seconds": "4",
  "size": "1280x720"
}
```

## 查询任务状态

提交后，使用以下接口轮询任务进度：

```text theme={null}
GET https://geekapis.com/v1/videos/{task_id}
```
