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

# HeyGen Video Agent

> - HeyGen Video Agent 智能视频代理，仅需提示词即可自动完成数字人视频生成
 - 可选指定头像、声音、风格和画面方向；视频时长由 Agent 自动决定
- 异步处理模式，使用返回的任务ID [进行查询](/pages/zh/api-manual/task-management/get-task-detail)
- 生成的视频链接，有效期为24小时，请尽快保存




## OpenAPI

````yaml openapi/zh/heygen-video-agent.json POST /v1/videos/generations
openapi: 3.1.0
info:
  title: HeyGen Video Agent
  version: '1.0'
servers:
  - url: https://api.aihubmax.com
security:
  - BearerAuth: []
paths:
  /v1/videos/generations:
    post:
      tags:
        - Video > HeyGen
      summary: HeyGen Video Agent
      description: >
        - HeyGen Video Agent 智能视频代理，仅需提示词即可自动完成数字人视频生成
         - 可选指定头像、声音、风格和画面方向；视频时长由 Agent 自动决定
        - 异步处理模式，使用返回的任务ID
        [进行查询](/pages/zh/api-manual/task-management/get-task-detail)

        - 生成的视频链接，有效期为24小时，请尽快保存
      operationId: heygen-video-agent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HeygenVideoAgentRequest'
            examples:
              最简用法_只传_prompt_avatar_voice_由模型自动挑选:
                summary: 最简用法：只传 prompt，avatar / voice 由模型自动挑选
                value:
                  model: heygen-video-agent
                  prompt: >-
                    A weather reporter in front of a sunny city skyline
                    introducing today's forecast in an upbeat tone.
              指定_avatar_voice_竖屏:
                summary: 指定 avatar / voice / 竖屏
                value:
                  model: heygen-video-agent
                  prompt: >-
                    Explain quantum computing to a curious teenager in 30
                    seconds.
                  avatar_id: Anna_public_3_20240108
                  voice_id: en-US-Studio-O
                  orientation: portrait
              带参考素材与无痕模式:
                summary: 带参考素材与无痕模式
                value:
                  model: heygen-video-agent
                  prompt: >-
                    Create a product walkthrough based on the attached
                    screenshots.
                  file_urls:
                    - https://example.com/screenshot-1.png
                    - https://example.com/screenshot-2.png
                  incognito_mode: true
      responses:
        '200':
          $ref: '#/components/responses/TaskCreated'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  schemas:
    HeygenVideoAgentRequest:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          description: '`heygen-video-agent`：智能视频代理，自动生成数字人视频'
          examples:
            - heygen-video-agent
          type: string
          default: heygen-video-agent
        prompt:
          description: |
            自然语言 prompt，描述希望生成的视频内容

            **说明：**
            - 最长 10000 字符
            - Video Agent 会自主决定选角、脚本、场景编排与剪辑
            - 输出视频时长由模型自主决定，客户端无法指定
          maxLength: 10000
          type: string
          example: >-
            A weather reporter in front of a sunny city skyline introducing
            today's forecast.
        avatar_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: |
            指定使用的 HeyGen avatar 标识

            **说明：**
            - 不传或留空 → 由 Video Agent 自动挑选
            - 可传 HeyGen 官方 avatar ID，也可传 `auto` 交由模型决定
          example: Anna_public_3_20240108
        voice_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: |
            指定使用的 HeyGen voice 标识

            **说明：**
            - 不传或留空 → 由 Video Agent 自动挑选
            - 可传 HeyGen 官方 voice ID，也可传 `auto` 交由模型决定
          example: en-US-Studio-O
        style_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: |
            HeyGen 视觉风格模板 ID

            **说明：**
            - 控制场景构图、节奏与美学
            - 不传则使用默认风格
          example: modern_vlog_01
        orientation:
          anyOf:
            - enum:
                - landscape
                - portrait
              type: string
            - type: 'null'
          default: null
          description: |
            输出视频方向

            **可选值：**
            - `landscape` — 横屏
            - `portrait` — 竖屏
            - 不传 → 由 Video Agent 自动判断
          example: landscape
        file_urls:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          description: |-
            参考素材 URL 列表（图片 / 视频 / 音频 / PDF）

            **说明：**
            - 最多 20 个 URL


            > 非必须不要传这个参数。
          x-advanced: true
          example:
            - https://example.com/screenshot-1.png
        incognito_mode:
          anyOf:
            - type: boolean
            - type: 'null'
          default: null
          description: |-
            是否启用无痕模式（禁用 agent 记忆）

            > 非必须不要传这个参数。
          x-advanced: true
          example: true
    TaskResponse:
      type: object
      properties:
        created:
          type: integer
          description: 任务创建时间戳
          example: 1757165031
        id:
          type: string
          description: 任务ID
          example: task-unified-1757165031-uyujaw3d
        model:
          type: string
          description: 实际使用的模型名称
        object:
          type: string
          description: 任务的具体类型
          enum:
            - video.generation.task
        progress:
          type: integer
          description: 任务进度百分比 (0-100)
          minimum: 0
          maximum: 100
          example: 0
        status:
          type: string
          description: 任务状态
          enum:
            - pending
            - processing
            - completed
            - failed
          example: pending
        task_info:
          type: object
          description: 异步任务信息
          properties:
            can_cancel:
              type: boolean
              description: 任务是否可以取消
              example: true
            estimated_time:
              type: integer
              description: 预计完成时间（秒）
              example: 45
        type:
          type: string
          description: 任务的输出类型
          enum:
            - video
          example: video
    ErrorResponse400:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: 请求格式错误
            type:
              type: string
              example: invalid_request_error
    ErrorResponse401:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: API密钥无效
            type:
              type: string
              example: authentication_error
    ErrorResponse402:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: 账户余额不足
            type:
              type: string
              example: insufficient_quota
    ErrorResponse422:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: 参数校验失败
            type:
              type: string
              example: validation_error
    ErrorResponse429:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: 请求频率超限
            type:
              type: string
              example: rate_limit_error
    ErrorResponse500:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: 服务器内部错误
            type:
              type: string
              example: server_error
    ErrorResponse503:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: 服务暂不可用，请稍后重试
            type:
              type: string
              example: service_unavailable
  responses:
    TaskCreated:
      description: 任务创建成功
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TaskResponse'
    BadRequest:
      description: 请求格式错误
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse400'
    Unauthorized:
      description: 未授权
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse401'
    PaymentRequired:
      description: 余额不足
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse402'
    UnprocessableEntity:
      description: 参数校验失败
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse422'
    TooManyRequests:
      description: 请求频率超限
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse429'
    InternalServerError:
      description: 服务器内部错误
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse500'
    ServiceUnavailable:
      description: 服务暂不可用
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse503'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |
        ## 所有接口均需要使用Bearer Token进行认证 ##

        使用时在请求头中添加：

        `Authorization: Bearer YOUR_API_KEY`

````