> ## 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.

# Eleven v4 多音色对话

> - 顺序台词与指定音色合成对话
- inputs 每项使用 text/voice_id，最多10个不同音色
- 总文本建议不超过2000字符
- 异步处理模式，使用返回的任务ID [进行查询](/pages/zh/api-manual/task-management/get-task-detail)
- 完成后从 `results[0].url` 下载音频；timestamps 请求仅在完整功能可用时受理，结果保留实际返回的对齐和说话人区间，不补造缺失字段。请及时下载，链接保留时间取决于文件存储服务。


`eleven-v4-text-to-dialogue` 与 `eleven-v4-text-to-dialogue-custom-voice` 共用非空 `inputs`，每项必填 `text` 与 `voice_id`。保持台词顺序和音色ID；最多10个不同音色，重复ID只计一次，台词可超过10段。总文本建议不超过2000字符，超出可能提前结束或报错；这不是本地硬上限。

可选 `settings` 包含 stability（默认0.5）、**similarity**（默认0.75）及可选 clone\_strength，均为0–1。省略/null整个对象保留音色设置；clone\_strength仅适用于v4专业克隆音色。前后文为 `previous_text` / `future_text`，不计字符费。seed为0–4294967295，文本规范化默认auto。

custom允许公共/私有音色混合，普通入口不检查互斥类别。同一次请求的所有ID必须可共同访问；不会拆分到不同账号生成或替换音色。ID不保证永久可用、可跨服务迁移或用户独享，音色不可用按任务规则失败退款。

默认输出mp3\_44100\_128，28种格式见参数。显式时间戳与发音词典只有在完整功能可用时受理；结果仅保留实际返回的对齐和说话人段，可能缺省，不补造元数据。完成后[查询任务](https://docs.aihubmax.com/pages/zh/api-manual/task-management/get-task-detail.md)并及时下载results\[0].url。

两模型均为 **\$0.00008/Unicode字符**，累计各项inputs\[].text，包括空格、标点和标签，不计ID、前后文与设置，不补齐千字符。使用提交时价格和分组倍率，预扣差额在完成时结算。

迁移：inputs\[].voice → inputs\[].voice\_id；平铺控制移至settings，原similarity\_boost改为settings.similarity。未知字段明确拒绝；历史任务不重建、不重新生成。


## OpenAPI

````yaml openapi/zh/eleven-v4-text-to-dialogue.json POST /v1/audios/generations
openapi: 3.1.0
info:
  title: Eleven v4 Dialogue / Custom Voice
  version: '1.0'
servers:
  - url: https://api.aihubmax.com/e
security:
  - BearerAuth: []
paths:
  /v1/audios/generations:
    post:
      tags:
        - Audio > 语音合成
      summary: Eleven v4 Dialogue / Custom Voice
      description: >
        - 顺序台词与指定音色合成对话

        - inputs 每项使用 text/voice_id，最多10个不同音色

        - 总文本建议不超过2000字符

        - 异步处理模式，使用返回的任务ID
        [进行查询](/pages/zh/api-manual/task-management/get-task-detail)

        - 完成后从 `results[0].url` 下载音频；timestamps
        请求仅在完整功能可用时受理，结果保留实际返回的对齐和说话人区间，不补造缺失字段。请及时下载，链接保留时间取决于文件存储服务。
      operationId: eleven-v4-text-to-dialogue
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ElevenV4DialogueRequest'
            examples:
              按顺序合成对话:
                summary: 按顺序合成对话
                value:
                  model: eleven-v4-text-to-dialogue
                  inputs:
                    - text: 你好。
                      voice_id: existing-voice-id
      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:
    ElevenV4DialogueRequest:
      type: object
      required:
        - model
        - inputs
      properties:
        seed:
          anyOf:
            - maximum: 4294967295
              minimum: 0
              type: integer
            - type: 'null'
          default: null
          description: 随机种子。
          example: 0
        language_code:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: ISO 639-1 语言代码。
          example: zh
        apply_text_normalization:
          default: auto
          description: 文本规范化。
          enum:
            - auto
            - 'on'
            - 'off'
          type: string
          example: auto
        output_format:
          default: mp3_44100_128
          description: 音频编码、采样率及码率；共 28 种格式。
          enum:
            - mp3_22050_32
            - mp3_24000_48
            - mp3_44100_32
            - mp3_44100_64
            - mp3_44100_96
            - mp3_44100_128
            - mp3_44100_192
            - pcm_8000
            - pcm_16000
            - pcm_22050
            - pcm_24000
            - pcm_32000
            - pcm_44100
            - pcm_48000
            - wav_8000
            - wav_16000
            - wav_22050
            - wav_24000
            - wav_32000
            - wav_44100
            - wav_48000
            - ulaw_8000
            - alaw_8000
            - opus_48000_32
            - opus_48000_64
            - opus_48000_96
            - opus_48000_128
            - opus_48000_192
          type: string
          example: mp3_44100_128
        timestamps:
          default: false
          description: 请求语音时间戳；仅在当前可用来源支持时受理。
          type: boolean
          example: false
        pronunciation_dictionary_locators:
          anyOf:
            - items:
                additionalProperties: false
                properties:
                  pronunciation_dictionary_id:
                    description: 发音词典 ID。
                    minLength: 1
                    type: string
                  version_id:
                    description: 发音词典版本 ID。
                    minLength: 1
                    type: string
                required:
                  - pronunciation_dictionary_id
                  - version_id
                type: object
              maxItems: 3
              type: array
            - type: 'null'
          default: null
          description: |-
            最多三个发音词典和版本；要求完整能力支持。

            > 非必须不要传这个参数。
          x-advanced: true
          example:
            - pronunciation_dictionary_id: dictionary-id
              version_id: version-id
        model:
          description: >-
            `eleven-v4-text-to-dialogue`：顺序多音色对话；`eleven-v4-text-to-dialogue-custom-voice`：允许公共/私有音色混合。两者累计台词
            Unicode 字符，$0.00008/字符，不补齐千字符。
          examples:
            - eleven-v4-text-to-dialogue
            - eleven-v4-text-to-dialogue-custom-voice
          type: string
          default: eleven-v4-text-to-dialogue
        inputs:
          description: 顺序台词，最多 10 个不同音色，重复 ID 只计一次。总文本建议不超过 2000 字符，超出有截断或失败风险。
          items:
            additionalProperties: false
            properties:
              text:
                description: 本段台词；总文本建议不超过 2000 字符，超出可能提前结束或报错。
                minLength: 1
                type: string
                example: 你好。
              voice_id:
                description: 本段已有音色的原始 ID。
                minLength: 1
                type: string
                example: existing-voice-id
            required:
              - text
              - voice_id
            type: object
          minItems: 1
          type: array
          example:
            - text: 你好。
              voice_id: existing-voice-id
        settings:
          anyOf:
            - additionalProperties: false
              properties:
                stability:
                  anyOf:
                    - maximum: 1
                      minimum: 0
                      type: number
                    - type: 'null'
                  default: 0.5
                  description: 稳定性，0–1；null 不覆盖已保存设置。
                  example: 0.5
                similarity:
                  anyOf:
                    - maximum: 1
                      minimum: 0
                      type: number
                    - type: 'null'
                  default: 0.75
                  description: 音色相似度，0–1；null 不覆盖已保存设置。
                  example: 0.75
                clone_strength:
                  anyOf:
                    - maximum: 1
                      minimum: 0
                      type: number
                    - type: 'null'
                  default: null
                  description: 仅适用于 v4 专业克隆音色的强度。
                  example: 0.5
              type: object
            - type: 'null'
          default: null
          description: 省略或 null 保留音色设置；对象中相似度字段为 similarity。
          example:
            similarity: 0.75
            stability: 0.5
        previous_text:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: |-
            对话前文，不计入字符费用。

            > 非必须不要传这个参数。
          x-advanced: true
          example: 开场。
        future_text:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: |-
            对话后文，不计入字符费用。

            > 非必须不要传这个参数。
          x-advanced: true
          example: 结束。
      additionalProperties: false
    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:
            - audio.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:
            - audio
          example: audio
    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`

````

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