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

# ElevenLabs 音色设计

> - 通过文字描述设计候选音色，可选参考音频引导
- 返回试听文本和全部候选的试听链接及 generated_voice_id
- 试听并明确选择后，再调用 Voice Create
- 异步处理模式，使用返回的任务ID [进行查询](/pages/zh/api-manual/task-management/get-task-detail)
- 完成后读取 `results[0].text` 与 `results[0].previews[]`；试听全部候选后，让用户明确选择一个 `generated_voice_id`，再调用 `elevenlabs-voice-create`。候选音频返回可下载 URL，不返回 Base64。
- 按实际返回的试听文本字符数计费一次，不乘候选数量。请及时保存试听音频。


`elevenlabs-voice-design` 根据文字描述生成候选音色及试听。可以描述语言、年龄感、音色和表达风格，也可以提供有权使用的参考音频引导设计。

1. 提交 `voice_description`（20–1000 字符）。试听文本方式二选一：传入 `text`（100–1000 字符），或设置 `auto_generate_text=true` 并省略 `text`。
2. [查询任务](https://docs.aihubmax.com/pages/zh/api-manual/task-management/get-task-detail.md)，完成后读取 `results[0].text` 与全部 `results[0].previews[]`。每个候选包含试听 `url` 和 `generated_voice_id`；音频已转换为下载链接，不返回 Base64。
3. 展示并试听全部候选，让用户明确选中一个。确认后，才将该候选的 `generated_voice_id` 传给 [Voice Create](https://docs.aihubmax.com/pages/zh/api-manual/audio-series/elevenlabs/elevenlabs-voice-create.md)。不要自动保存第一个候选或把全部候选都创建。

`reference_audio_base64` 只接受非空裸 Base64，不接受 URL 或 Data URI。仅使用本人或已获授权的音频。可选 `prompt_strength` 为0–1，0偏向参考音频、1偏向描述；`loudness` 为 -1–1（默认0.5），`guidance_scale` 为0–100（默认5），`seed` 为0–2147483647，`should_enhance` 默认false。当前设计模型不支持 `quality`，该字段及其他未知字段会被拒绝。

完成结果中的候选保留实际返回的 `media_type`、`duration_secs`、`language`、`detected_labels` 和其他元数据，并附 `file_name`、`file_size`；字段可为null，调用方应允许新增字段。每个候选的音色不同，通常共用同一份 `text`。候选数量以实际结果为准，请展示全部结果；候选可能过期，明确选定后应及时创建。

基准价为 **USD 0.08/1000个实际返回的试听文本 Unicode 字符**。只统计响应 `text` 一次，不乘候选数量，不补齐千字符；描述和其他控制参数不收费。自动文本预扣1000字符，手填文本预扣输入长度，完成后按实际文本和提交时分组倍率多退少补；失败按任务规则退款。

请及时下载试听音频，链接保留时间由文件存储策略决定。`generated_voice_id` 是待保存的候选 ID，后续合成使用的是 Create 返回的 `voice_id`。


## OpenAPI

````yaml openapi/zh/elevenlabs-voice-design.json POST /v1/audios/generations
openapi: 3.1.0
info:
  title: ElevenLabs Voice Design
  version: '1.0'
servers:
  - url: https://api.aihubmax.com/e
security:
  - BearerAuth: []
paths:
  /v1/audios/generations:
    post:
      tags:
        - Audio > Voice Creation
      summary: ElevenLabs Voice Design
      description: >
        - 通过文字描述设计候选音色，可选参考音频引导

        - 返回试听文本和全部候选的试听链接及 generated_voice_id

        - 试听并明确选择后，再调用 Voice Create

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

        - 完成后读取 `results[0].text` 与 `results[0].previews[]`；试听全部候选后，让用户明确选择一个
        `generated_voice_id`，再调用 `elevenlabs-voice-create`。候选音频返回可下载 URL，不返回
        Base64。

        - 按实际返回的试听文本字符数计费一次，不乘候选数量。请及时保存试听音频。
      operationId: elevenlabs-voice-design
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ElevenLabsVoiceDesignRequest'
            examples:
              自动生成候选音色和试听文本:
                summary: 自动生成候选音色和试听文本
                value:
                  model: elevenlabs-voice-design
                  voice_description: 自然、温暖、清晰的成年中文旁白声音，适合长篇讲解。
                  auto_generate_text: 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:
    ElevenLabsVoiceDesignRequest:
      type: object
      required:
        - model
        - voice_description
      properties:
        model:
          const: elevenlabs-voice-design
          description: >-
            `elevenlabs-voice-design`：设计候选音色；按实际返回的试听文本 Unicode
            字符数一次计费，$0.08/1000字符，不乘候选数量。
          enum:
            - elevenlabs-voice-design
          examples:
            - elevenlabs-voice-design
          type: string
          default: elevenlabs-voice-design
        voice_description:
          description: 声音描述，20–1000 字符；可描述语言、音色、年龄感和表达风格，不计费。
          maxLength: 1000
          minLength: 20
          type: string
          example: 自然、温暖、清晰的成年中文旁白声音，适合长篇讲解。
        text:
          anyOf:
            - maxLength: 1000
              minLength: 100
              type: string
            - type: 'null'
          default: null
          description: >-
            试听文本，100–1000 字符。与 auto_generate_text=true 二选一。按响应 text
            的实际字符数只计一次费用，不乘候选数量。
          example: >-
            欢迎收听今天的分享。欢迎收听今天的分享。欢迎收听今天的分享。欢迎收听今天的分享。欢迎收听今天的分享。欢迎收听今天的分享。欢迎收听今天的分享。欢迎收听今天的分享。欢迎收听今天的分享。欢迎收听今天的分享。欢迎收听今天的分享。欢迎收听今天的分享。欢迎收听今天的分享。欢迎收听今天的分享。欢迎收听今天的分享。
        auto_generate_text:
          default: false
          description: 自动生成试听文本。启用时不传 text；先预扣 1000 字符，按实际返回文本结算。
          type: boolean
          example: true
        reference_audio_base64:
          anyOf:
            - minLength: 1
              type: string
            - type: 'null'
          default: null
          description: 可选参考音频的裸 Base64 字符串，不接受 URL 或 Data URI。使用本人或已获授权的声音素材。
          example: <base64-encoded-audio>
        prompt_strength:
          anyOf:
            - maximum: 1
              minimum: 0
              type: number
            - type: 'null'
          default: null
          description: 描述与参考音频的权重：0 偏向参考音频，1 偏向描述。
          example: 0.5
        loudness:
          default: 0.5
          description: 试听音量，-1–1。
          maximum: 1
          minimum: -1
          type: number
          example: 0.5
        guidance_scale:
          default: 5
          description: 声音描述引导强度，0–100。
          maximum: 100
          minimum: 0
          type: number
          example: 5
        seed:
          anyOf:
            - maximum: 2147483647
              minimum: 0
              type: integer
            - type: 'null'
          default: null
          description: 随机种子。
          example: 0
        should_enhance:
          default: false
          description: 是否增强声音描述。
          type: boolean
          example: false
      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.