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

# 文本生成视频

> Veo 3 文本生成视频 — 从文本描述生成高质量视频

使用 Google Veo 3.1 从文本描述生成高质量视频。支持多种速度模式。

### 可用模型

`veo3` · `veo3_fast` · `veo3_lite`

### 速度模式

<AccordionGroup>
  <Accordion title="Quality 质量模式（默认）— veo3">
    最佳生成质量。推荐大多数场景使用。
  </Accordion>

  <Accordion title="Fast 快速模式 — veo3_fast">
    速度优先。适合对时效性要求高的场景。
  </Accordion>

  <Accordion title="Lite 轻量模式 — veo3_lite">
    轻量版本，固定 720p 输出。单价最低，适合草稿和大批量生成。不支持 4K/1080p 放大 — 传 `resolution` 会被自动忽略。
  </Accordion>
</AccordionGroup>

<ParamField body="model" type="string" required>
  模型名称，如 `veo3`、`veo3_fast`、`veo3_lite`。
</ParamField>

<ParamField body="callBackUrl" type="string">
  Webhook 回调地址。
</ParamField>

<ParamField body="input" type="object" required>
  <Expandable title="properties" defaultOpen>
    <ParamField body="prompt" type="string" required>
      描述想要生成的视频内容的提示词。
    </ParamField>

    <ParamField body="ratio" type="string">
      视频宽高比。可选值：`16:9`、`9:16`。默认值：`16:9`。
    </ParamField>

    <ParamField body="resolution" type="string">
      分辨率放大。可选值：`1080p`、`4k`。不传则为默认分辨率（不放大）。
    </ParamField>

    <ParamField body="duration" type="integer">
      视频时长（秒）。可选值：`4`、`6`、`8`。默认值：`8`。

      Credits 按时长线性折扣：相同模式与分辨率下，4 秒视频费用为 8 秒视频的一半。具体费率见定价页。

      注意：

      * `r2v` 模式仅支持 `8` 秒；传 4/6 会回退到 8 秒并打 warn 日志。
      * `i2v`（单张图片）Quality 等级仅支持 `8` 秒；如需 4s/6s 请选 `i2v-fl`（首尾帧）。
    </ParamField>
  </Expandable>
</ParamField>

<RequestExample>
  ```bash 质量模式（默认） theme={null}
  curl --request POST \
    --url https://api.maxapi.io/api/v1/task/submit \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
    "model": "veo3",
    "callBackUrl": "https://example.com/webhook",
    "input": {
      "prompt": "黄金时刻，海浪拍打着岩石海岸",
      "ratio": "16:9",
      "resolution": "1080p"
    }
  }'
  ```

  ```bash 快速模式 theme={null}
  curl --request POST \
    --url https://api.maxapi.io/api/v1/task/submit \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
    "model": "veo3_fast",
    "callBackUrl": "https://example.com/webhook",
    "input": {
      "prompt": "黄金时刻，海浪拍打着岩石海岸",
      "ratio": "9:16",
      "resolution": "1080p"
    }
  }'
  ```

  ```bash 轻量模式（仅 720p） theme={null}
  curl --request POST \
    --url https://api.maxapi.io/api/v1/task/submit \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
    "model": "veo3_lite",
    "callBackUrl": "https://example.com/webhook",
    "input": {
      "prompt": "黄金时刻，海浪拍打着岩石海岸",
      "ratio": "16:9"
    }
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 提交成功 theme={null}
  {
    "code": 0,
    "msg": "ok",
    "data": {
      "taskId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
    }
  }
  ```
</ResponseExample>

***

## 查询结果

通过[查询任务](/cn/api-reference/query-task)接口或 Webhook 获取生成结果：

```json theme={null}
{
  "code": 0,
  "msg": "ok",
  "data": {
    "taskId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "status": "SUCCESS",
    "input": {
      "model": "veo3",
      "prompt": "黄金时刻，海浪拍打着岩石海岸",
      "ratio": "16:9",
      "resolution": "1080p"
    },
    "result": {
      "type": "video",
      "urls": [
        "https://example.com/output/video-a1b2c3d4.mp4"
      ]
    },
    "created_at": "2026-02-12T10:00:00.000000Z",
    "updated_at": "2026-02-12T10:02:30.000000Z"
  }
}
```

<Note>
  Veo 3 每次生成返回 1 个视频。视频时长通常为 5-8 秒。无需指定 `mode` 参数 — 系统会根据图片数量自动识别生成模式。
</Note>
