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

# HeyGen Avatar 6

> HeyGen Avatar 6 API 可根据一张照片、一段动画角色参考视频或一个 HeyGen 公共形象，生成 1080p 或 2K 的口型同步说话视频，由 2–60 秒的音频驱动；使用公共形象时也可以由文字驱动。

> [!TIP]
>
> 1. 提交后会返回 `task_id`。如果提供了 `callback_url`，当任务状态变为 `finished` 或 `failed` 时，系统会向 `callback_url` 发送 POST 请求。
> 2. 无论是否提供 `callback_url`，都可以通过统一的[查询任务状态](https://docs.poyo.ai/zh/api-manual/task-management/status.md)接口获取结果。

HeyGen Avatar 6 把说话者变成一段说话视频，口型同步，带有面部表情和自然手势。可以驱动一张人物照片、参考视频中的动画或插画角色，或 HeyGen 的公共形象。语音来自音频文件；使用公共形象时，也可以由 HeyGen 声音朗读一段文字。系统根据传入的参数自动选择模式。

## 模型

* **heygen-avatar-6** — 生成 `1080p` 或 `2K` 的说话数字人视频，支持照片、参考视频和公共形象三种模式
* **heygen-avatar-6-turbo** — Avatar 6 的 Turbo 档，输入参数和模式与标准版相同

## 功能

* **三种输入模式**：人物照片、动画或插画角色的参考视频，或 HeyGen 公共形象。
* **由音频决定时长**：视频时长与语音音频一致，2 到 60 秒。
* **公共形象文字朗读**：传入 `text` 和可选的 `voice`，形象会朗读这段文字。
* **动作引导**：用 `prompt` 引导手势、表情和姿态。
* **输出**：`1080p` 或 `2K`。公共形象视频可选 `16:9`、`9:16`、`1:1`、`4:5` 或 `5:4`。

## 输入模式

| 模式 | 选择条件 | 输入 |
| - | - | - |
| 公共形象 | 传入 `avatar` | `avatar`，再加 `audio_url` 或 `text` |
| 参考视频 | 传入 `video_url` | `video_url` 和 `audio_url`，可在 `image_urls` 中加一张参考照片 |
| 照片 | 默认 | `image_urls` 和 `audio_url` |

每种模式接受该行列出的输入，以及通用选项 `prompt` 和 `resolution`。`aspect_ratio` 和 `voice` 属于公共形象模式。每个请求使用同一种模式的输入。

## 必填参数

* `image_urls`（字符串数组）：照片模式。恰好一张要驱动的人物照片，使用 `image_urls[0]`。
* `video_url`（字符串）：参考视频模式。一段动画或插画角色的视频，时长至少 2 秒，大小不超过 50 MB。
* `avatar`（字符串）：公共形象模式。[形象与声音](https://docs.poyo.ai/zh/api-manual/video-series/heygen-avatar-6-avatars.md)中列出的 1,248 个 HeyGen 公共形象之一，例如 `Abigail Sofa Front`。名称匹配不区分大小写，也不受多余空格影响。
* `audio_url`（字符串）：照片模式和参考视频模式的语音音频。公共形象模式下传 `audio_url` 或 `text` 二者之一。音频时长 2–60 秒，大小不超过 15 MB；视频时长与音频一致。
* `text`（字符串）：公共形象模式，替代 `audio_url` 使用。形象要朗读的文字，最多 1,000 个字符。

## 可选参数

* `image_urls`（字符串数组）：参考视频模式。一张同一角色的参考照片。
* `voice`（字符串）：公共形象模式下配合 `text` 使用。朗读文字的 HeyGen 声音，可选[形象与声音](https://docs.poyo.ai/zh/api-manual/video-series/heygen-avatar-6-avatars.md#声音)中的 102 个声音之一。名称匹配不区分大小写，也不受多余空格影响。默认值：`Warm Pro Narrator`。
* `prompt`（字符串）：引导形象的手势、表情和姿态，最多 1,200 个字符。
* `aspect_ratio`（字符串）：公共形象模式。`16:9`、`9:16`、`1:1`、`4:5` 或 `5:4`。默认值：`16:9`。照片模式和参考视频模式下，视频沿用输入照片或视频的宽高比。
* `resolution`（字符串）：`1080p` 或 `2K`。默认值：`1080p`。

## 输出

* 一个 MP4 视频文件。
* 视频时长跟随语音：等于 `audio_url` 的时长，或形象朗读完 `text` 所用的时间。视频可能比音频短约十分之一秒。

## 示例

### 照片

```json theme={"dark"}
{
  "model": "heygen-avatar-6",
  "callback_url": "https://your-domain.com/callback",
  "input": {
    "image_urls": ["https://example.com/presenter.png"],
    "audio_url": "https://example.com/speech.mp3",
    "prompt": "Face the camera with a warm smile and use small, natural hand gestures.",
    "resolution": "1080p"
  }
}
```

### 参考视频

```json theme={"dark"}
{
  "model": "heygen-avatar-6-turbo",
  "input": {
    "video_url": "https://example.com/cartoon-character.mp4",
    "image_urls": ["https://example.com/cartoon-character.png"],
    "audio_url": "https://example.com/speech.mp3",
    "resolution": "2K"
  }
}
```

### 公共形象 + 音频

```json theme={"dark"}
{
  "model": "heygen-avatar-6",
  "input": {
    "avatar": "Abigail Sofa Front",
    "audio_url": "https://example.com/speech.mp3",
    "aspect_ratio": "9:16"
  }
}
```

### 公共形象 + 文字

```json theme={"dark"}
{
  "model": "heygen-avatar-6-turbo",
  "input": {
    "avatar": "Abigail Office Front",
    "text": "Hello and welcome to this demonstration of HeyGen Avatar 6.",
    "voice": "Warm Pro Narrator",
    "prompt": "Speak with calm confidence and nod slightly at the end.",
    "aspect_ratio": "16:9",
    "resolution": "1080p"
  }
}
```

## 注意事项

* 所有媒体 URL 都必须可通过 HTTP 或 HTTPS 公开访问并可直接下载。
* 音频时长和参考视频时长在提交任务时检查。
* `avatar` 在提交任务时按形象列表检查。


## OpenAPI

````yaml zh/api-manual/video-series/heygen-avatar-6.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: PoYo AI - HeyGen Avatar 6 API
  description: >-
    HeyGen Avatar 6 API 可根据一张照片、一段动画角色参考视频或一个 HeyGen 公共形象，生成 1080p 或 2K
    的口型同步说话视频，由 2–60 秒的音频驱动；使用公共形象时也可以由文字驱动。
  version: 1.0.0
servers:
  - url: https://api.poyo.ai
    description: 生产环境
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - HeyGen Avatar 6
      summary: 提交 HeyGen Avatar 6 任务
      description: 根据一张照片、一段动画或插画角色的参考视频，或一个 HeyGen 公共形象生成说话的数字人视频。
      operationId: submitHeygenAvatar6Task
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
            examples:
              photo:
                summary: 照片
                value:
                  model: heygen-avatar-6
                  callback_url: https://your-domain.com/callback
                  input:
                    image_urls:
                      - https://example.com/presenter.png
                    audio_url: https://example.com/speech.mp3
                    prompt: >-
                      Face the camera with a warm smile and use small, natural
                      hand gestures.
                    resolution: 1080p
              reference-video:
                summary: 参考视频
                value:
                  model: heygen-avatar-6-turbo
                  input:
                    video_url: https://example.com/cartoon-character.mp4
                    image_urls:
                      - https://example.com/cartoon-character.png
                    audio_url: https://example.com/speech.mp3
                    resolution: 2K
              avatar-audio:
                summary: 公共形象 + 音频
                value:
                  model: heygen-avatar-6
                  input:
                    avatar: Abigail Sofa Front
                    audio_url: https://example.com/speech.mp3
                    aspect_ratio: '9:16'
              avatar-text:
                summary: 公共形象 + 文字
                value:
                  model: heygen-avatar-6-turbo
                  input:
                    avatar: Abigail Office Front
                    text: >-
                      Hello and welcome to this demonstration of HeyGen Avatar
                      6.
                    voice: Warm Pro Narrator
                    prompt: Speak with calm confidence and nod slightly at the end.
                    aspect_ratio: '16:9'
                    resolution: 1080p
      responses:
        '200':
          description: 任务提交成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
        '400':
          description: 请求参数无效
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: 未授权：API Key 无效
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SubmitRequest:
      type: object
      required:
        - model
        - input
      properties:
        model:
          type: string
          description: HeyGen Avatar 6 模型标识
          enum:
            - heygen-avatar-6
            - heygen-avatar-6-turbo
        callback_url:
          type: string
          format: uri
          description: 接收结果通知的 Webhook 回调 URL
          example: https://your-domain.com/callback
        input:
          type: object
          additionalProperties: false
          description: >-
            按传入的参数自动选择模式：传 `avatar` 为公共形象模式；否则传 `video_url`
            为参考视频模式；否则为照片模式。每个请求使用同一种模式的参数。
          properties:
            image_urls:
              type: array
              minItems: 1
              maxItems: 1
              items:
                type: string
                format: uri
              description: >-
                恰好一张图片。照片模式必填：要驱动的人物照片。参考视频模式可选：同一角色的参考照片。需为可公开访问的 HTTP 或 HTTPS
                URL，使用 `image_urls[0]`。
              example:
                - https://example.com/presenter.png
            video_url:
              type: string
              format: uri
              description: >-
                参考视频模式必填。一段动画或插画角色的视频，时长至少 2 秒，大小不超过 50 MB。需为可公开访问的 HTTP 或 HTTPS
                URL。
              example: https://example.com/cartoon-character.mp4
            avatar:
              type: string
              minLength: 1
              description: >-
                公共形象模式必填。[形象与声音](/zh/api-manual/video-series/heygen-avatar-6-avatars)中列出的
                1,248 个 HeyGen 公共形象之一，例如 `Abigail Sofa
                Front`。名称匹配不区分大小写，也不受多余空格影响。
              example: Abigail Sofa Front
            audio_url:
              type: string
              format: uri
              description: >-
                语音音频，时长 2–60 秒，大小不超过 15 MB。照片模式和参考视频模式必填；公共形象模式下传 `audio_url` 或
                `text` 二者之一。视频时长与音频一致。需为可公开访问的 HTTP 或 HTTPS URL。
              example: https://example.com/speech.mp3
            text:
              type: string
              minLength: 1
              maxLength: 1000
              description: 公共形象模式，替代 `audio_url` 使用。形象要朗读的文字，最多 1,000 个字符。
              example: Hello and welcome to this demonstration of HeyGen Avatar 6.
            voice:
              type: string
              minLength: 1
              default: Warm Pro Narrator
              description: >-
                公共形象模式下配合 `text` 使用。朗读文字的 HeyGen
                声音，可选[形象与声音](/zh/api-manual/video-series/heygen-avatar-6-avatars#声音)中的
                102 个声音之一。名称匹配不区分大小写，也不受多余空格影响。默认值：`Warm Pro Narrator`。
              example: Warm Pro Narrator
            prompt:
              type: string
              maxLength: 1200
              description: 引导形象的手势、表情和姿态，最多 1,200 个字符。
              example: >-
                Face the camera with a warm smile and use small, natural hand
                gestures.
            aspect_ratio:
              type: string
              enum:
                - '16:9'
                - '9:16'
                - '1:1'
                - '4:5'
                - '5:4'
              default: '16:9'
              description: 公共形象模式。输出宽高比。默认值：`16:9`。照片模式和参考视频模式下，视频沿用输入照片或视频的宽高比。
              example: '16:9'
            resolution:
              type: string
              enum:
                - 1080p
                - 2K
              default: 1080p
              description: 输出分辨率。默认值：`1080p`。
              example: 1080p
    SubmitResponse:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          example: 200
          enum:
            - 200
            - 400
            - 401
            - 402
            - 403
            - 404
            - 408
            - 429
            - 500
            - 502
            - 503
          description: >-
            业务状态码。`200` 表示成功，其他值都表示请求失败。请务必检查这个字段：部分参数校验错误会以 HTTP 200 返回，响应体里的
            `code` 为 `400`。


            - `200`：成功

            - `400`：请求参数无效

            - `401`：API Key 缺失或无效

            - `402`：积分不足

            - `403`：没有权限

            - `404`：资源不存在

            - `408`：请求超时

            - `429`：请求频率超限

            - `500`：服务器内部错误

            - `502`：上游服务错误

            - `503`：服务暂不可用


            详见[错误码](/zh/api-manual/error-codes)。
        data:
          type: object
          required:
            - task_id
            - status
            - created_time
          properties:
            task_id:
              type: string
              example: task-unified-1757165031-uyujaw3d
            status:
              type: string
              enum:
                - not_started
                - running
                - finished
                - failed
              example: not_started
              description: >-
                任务状态。提交后立即返回时始终为
                `not_started`。后续状态请通过[查询任务状态](/zh/api-manual/task-management/status)接口或
                `callback_url` 获取。


                - `not_started`：排队中，等待处理

                - `running`：生成中

                - `finished`：已完成，结果在 `files` 或 `output` 中

                - `failed`：失败，详情见 `error_message`
            created_time:
              type: string
              format: date-time
              example: '2025-11-12T10:30:00'
    ErrorResponse:
      type: object
      properties:
        code:
          type: integer
          example: 400
          enum:
            - 200
            - 400
            - 401
            - 402
            - 403
            - 404
            - 408
            - 429
            - 500
            - 502
            - 503
          description: >-
            业务状态码。`200` 表示成功，其他值都表示请求失败。请务必检查这个字段：部分参数校验错误会以 HTTP 200 返回，响应体里的
            `code` 为 `400`。


            - `200`：成功

            - `400`：请求参数无效

            - `401`：API Key 缺失或无效

            - `402`：积分不足

            - `403`：没有权限

            - `404`：资源不存在

            - `408`：请求超时

            - `429`：请求频率超限

            - `500`：服务器内部错误

            - `502`：上游服务错误

            - `503`：服务暂不可用


            详见[错误码](/zh/api-manual/error-codes)。
        error:
          type: object
          properties:
            message:
              type: string
              example: Invalid request parameters
            type:
              type: string
              example: invalid_request_error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        所有 API 接口都需要 Bearer Token 认证。


        创建 API Key：登录 PoYo，进入 **仪表盘 → API
        密钥**（[poyo.ai/zh/dashboard/api-key](https://poyo.ai/zh/dashboard/api-key)），点击创建
        Key。


        在请求头中添加：


        ```

        Authorization: Bearer YOUR_API_KEY

        ```

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.