> ## 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 Text to Speech

> Generate speech with text and an explicit existing voice_id. Both regular and custom models accept up to 10000 Unicode characters. Optional nested voice settings, context and effects.

Submit asynchronously and [query the task](/pages/en/api-manual/task-management/get-task-detail). Download results[0].url on completion. Only returned metadata is preserved; save audio promptly.

Both `eleven-v4-text-to-speech` and `eleven-v4-text-to-speech-custom-voice` require `text` and `voice_id`. There is no default voice. Text accepts 1–10000 Unicode characters, including spaces, punctuation, emoji and audio tags. For ordered segments with multiple voices, use [Dialogue](https://docs.aihubmax.com/pages/en/api-manual/audio-series/elevenlabs/eleven-v4-text-to-dialogue.md).

Supply the original ID of an existing, accessible voice. Custom supports private and public voices; the regular model may also use an accessible private voice. An ID does not guarantee permanent availability or exclusive access by a Gateway user. Other callers with the ID and model permission may use it. Unavailable voices fail through the normal task and refund flow. The [voice catalog](https://docs.aihubmax.com/pages/en/api-manual/audio-series/elevenlabs/preset-voice-id.md) is for discovery and previews.

Optional `voice_settings` contains `stability` (default0.5), `similarity_boost` (default0.75) and optional `clone_strength`, all0–1. Omitting or nulling the whole object preserves saved voice settings; providing an object applies its field defaults. Clone strength requires a v4 professional clone and does not create a voice. Style, speed and SSML are not promised.

Use `previous_text` / `next_text` for context; context is not spoken or billed. `seed` accepts0–4294967295, `language_code` is optional, and `apply_text_normalization` is auto/on/off (default auto). `audio_effects` supports filter, environment and background catalog IDs, distance0–1 (default0), send\_level0–1 (default1), and pan -1–1 (default0). Reverb or nonzero pan cannot use raw PCM, μ-law or A-law. Effects add no customer surcharge.

`output_format` defaults to `mp3_44100_128`; see the parameter list for all28 MP3/PCM/WAV/μ-law/A-law/Opus values. Raw PCM is16-bit little-endian; decode using the returned sample rate, channels and Content-Type. Timestamps, versioned pronunciation dictionaries and safety controls require the complete requested capability; unsupported requests fail explicitly.

Both models cost \*\*$0.00008 per Unicode character** ($0.08/1000), without rounding to blocks of1000. Only `text` is counted. Saved prices and group multipliers apply, with the reservation adjusted at completion and failures refunded under the task rules.

[Query the task](https://docs.aihubmax.com/pages/en/api-manual/task-management/get-task-detail.md) and download `results[0].url` on completion. Preserve returned file metadata and alignment fields; ordinary audio may omit alignment and voice segments. Missing fields are not synthesized. Save audio promptly.

Migration: `voice` → `voice_id`, flat settings → `voice_settings`, and Speech `future_text` → `next_text`. Old and unknown nested fields are rejected explicitly. Accepted tasks and historical bills retain their original contracts; old Turbo names have no compatibility alias.


## OpenAPI

````yaml openapi/en/eleven-v4-text-to-speech.json POST /v1/audios/generations
openapi: 3.1.0
info:
  title: Eleven v4 Speech / Custom Voice
  version: '1.0'
servers:
  - url: https://api.aihubmax.com/e
security:
  - BearerAuth: []
paths:
  /v1/audios/generations:
    post:
      tags:
        - Audio > Speech synthesis
      summary: Eleven v4 Speech / Custom Voice
      description: >-
        Generate speech with text and an explicit existing voice_id. Both
        regular and custom models accept up to 10000 Unicode characters.
        Optional nested voice settings, context and effects.


        Submit asynchronously and [query the
        task](/pages/en/api-manual/task-management/get-task-detail). Download
        results[0].url on completion. Only returned metadata is preserved; save
        audio promptly.
      operationId: eleven-v4-text-to-speech
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ElevenV4SpeechRequest'
            examples:
              指定音色的单段语音:
                summary: Example request
                value:
                  model: eleven-v4-text-to-speech
                  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:
    ElevenV4SpeechRequest:
      type: object
      required:
        - model
        - text
        - voice_id
      properties:
        seed:
          anyOf:
            - maximum: 4294967295
              minimum: 0
              type: integer
            - type: 'null'
          default: null
          description: >-
            Optional random seed; zero is a valid explicit value. See
            minimum/maximum.
          example: 0
        language_code:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Language in ISO 639-1, such as zh or en.
          example: zh
        apply_text_normalization:
          default: auto
          description: 'Text normalization: auto, on or off. Defaults to auto.'
          enum:
            - auto
            - 'on'
            - 'off'
          type: string
          example: auto
        output_format:
          default: mp3_44100_128
          description: >-
            Output encoding, sample rate and bitrate; 28 formats, default
            mp3_44100_128.
          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: >-
            Request alignment timestamps. The entire requested capability must
            be available; unsupported requests fail explicitly. Only actual
            alignment returned with the result is preserved.
          type: boolean
          example: false
        pronunciation_dictionary_locators:
          anyOf:
            - items:
                additionalProperties: false
                properties:
                  pronunciation_dictionary_id:
                    description: Pronunciation dictionary ID.
                    minLength: 1
                    type: string
                  version_id:
                    description: Fixed pronunciation dictionary version ID.
                    minLength: 1
                    type: string
                required:
                  - pronunciation_dictionary_id
                  - version_id
                type: object
              maxItems: 3
              type: array
            - type: 'null'
          default: null
          description: >-
            Up to 3 versioned pronunciation dictionaries. Requires the complete
            capability; unsupported requests fail explicitly.


            > Advanced option: omit unless needed.
          x-advanced: true
          example:
            - pronunciation_dictionary_id: dictionary-id
              version_id: version-id
        model:
          description: >-
            eleven-v4-text-to-speech: speech with a specified existing voice.
            eleven-v4-text-to-speech-custom-voice: also supports private voices.
            Both require voice_id and cost $0.00008 per Unicode character
            without rounding to 1000-character blocks.
          examples:
            - eleven-v4-text-to-speech
            - eleven-v4-text-to-speech-custom-voice
          type: string
          default: eleven-v4-text-to-speech
        text:
          description: >-
            1–10000 Unicode characters, including spaces, punctuation and audio
            tags.
          maxLength: 10000
          minLength: 1
          type: string
          example: 欢迎收听。
        voice_id:
          description: >-
            Original ID of an existing voice. Required; the voice must remain
            accessible and valid.
          minLength: 1
          type: string
          example: existing-voice-id
        voice_settings:
          anyOf:
            - additionalProperties: false
              properties:
                stability:
                  anyOf:
                    - maximum: 1
                      minimum: 0
                      type: number
                    - type: 'null'
                  default: 0.5
                  description: Stability, 0–1. Null does not override the saved setting.
                  example: 0.5
                similarity_boost:
                  anyOf:
                    - maximum: 1
                      minimum: 0
                      type: number
                    - type: 'null'
                  default: 0.75
                  description: >-
                    Voice similarity, 0–1. Null does not override the saved
                    setting.
                  example: 0.75
                clone_strength:
                  anyOf:
                    - maximum: 1
                      minimum: 0
                      type: number
                    - type: 'null'
                  default: null
                  description: >-
                    Optional strength, 0–1, only for a v4 professional cloned
                    voice.
                  example: 0.5
              type: object
            - type: 'null'
          default: null
          description: >-
            Omit or use null to preserve saved voice settings. An explicit
            object applies its field defaults.
          example:
            similarity_boost: 0.75
            stability: 0.5
        previous_text:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: |-
            Previous context. Not spoken or included in character billing.

            > Advanced option: omit unless needed.
          x-advanced: true
          example: 节目开始了。
        next_text:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: |-
            Following context. Not spoken or included in character billing.

            > Advanced option: omit unless needed.
          x-advanced: true
          example: 下面开始正文。
        audio_effects:
          anyOf:
            - additionalProperties: false
              properties:
                filter_preset_id:
                  anyOf:
                    - minLength: 1
                      type: string
                    - type: 'null'
                  default: null
                  description: Filter preset catalog ID.
                  example: filter-id
                environment_id:
                  anyOf:
                    - minLength: 1
                      type: string
                    - type: 'null'
                  default: null
                  description: Reverb environment catalog ID.
                  example: environment-id
                background_noise_id:
                  anyOf:
                    - minLength: 1
                      type: string
                    - type: 'null'
                  default: null
                  description: Background sound catalog ID.
                  example: background-id
                distance:
                  default: 0
                  description: Distance, 0–1. Defaults to 0.
                  maximum: 1
                  minimum: 0
                  type: number
                  example: 0
                send_level:
                  default: 1
                  description: Effect send level, 0–1. Defaults to 1.
                  maximum: 1
                  minimum: 0
                  type: number
                  example: 1
                pan:
                  default: 0
                  description: Stereo pan, -1–1. Defaults to 0.
                  maximum: 1
                  minimum: -1
                  type: number
                  example: 0
              type: object
            - type: 'null'
          default: null
          description: >-
            Audio effects with no customer surcharge. Reverb or nonzero pan
            requires a stereo-capable format and forbids raw PCM, μ-law and
            A-law.


            > Advanced option: omit unless needed.
          x-advanced: true
          example:
            pan: 0
        enable_safety_checker:
          anyOf:
            - type: boolean
            - type: 'null'
          default: null
          description: >-
            Explicit safety control; false is not ignored. Unsupported requests
            fail explicitly.
          example: true
      additionalProperties: false
    TaskResponse:
      type: object
      properties:
        created:
          type: integer
          description: Task creation timestamp
          example: 1757165031
        id:
          type: string
          description: Task ID
          example: task-unified-1757165031-uyujaw3d
        model:
          type: string
          description: >-
            eleven-v4-text-to-speech: speech with a specified existing voice.
            eleven-v4-text-to-speech-custom-voice: also supports private voices.
            Both require voice_id and cost $0.00008 per Unicode character
            without rounding to 1000-character blocks.
        object:
          type: string
          description: Task type
          enum:
            - audio.generation.task
        progress:
          type: integer
          description: Task progress (0–100)
          minimum: 0
          maximum: 100
          example: 0
        status:
          type: string
          description: Task status
          enum:
            - pending
            - processing
            - completed
            - failed
          example: pending
        task_info:
          type: object
          description: Asynchronous task information
          properties:
            can_cancel:
              type: boolean
              description: Whether the task can be canceled
              example: true
            estimated_time:
              type: integer
              description: Estimated completion time in seconds
              example: 45
        type:
          type: string
          description: Output type
          enum:
            - audio
          example: audio
    ErrorResponse400:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: Bad request
            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: Validation failed
            type:
              type: string
              example: validation_error
    ErrorResponse429:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: Rate limit exceeded
            type:
              type: string
              example: rate_limit_error
    ErrorResponse500:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: Internal server error
            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: Task created
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TaskResponse'
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse400'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse401'
    PaymentRequired:
      description: Insufficient balance
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse402'
    UnprocessableEntity:
      description: Validation failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse422'
    TooManyRequests:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse429'
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse500'
    ServiceUnavailable:
      description: Service unavailable
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse503'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |
        All endpoints require Bearer authentication.

        Add this request header:

        `Authorization: Bearer YOUR_API_KEY`

````

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