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

# MiniMax Speech 2.8 HD Async Text-to-Speech

Use this API to create an async text-to-speech task. Supports text or file input, with a text length limit of 50,000 characters and a file limit of 100,000 characters.

<Tip>
  This is an **async** API that only returns the task\_id of the async task. Use the task\_id to call the [Get Async Task Result API](/docs/models/reference-get-async-task-result) to retrieve the generated result.
</Tip>

## Request Headers

<ParamField header="Content-Type" type="string" required={true}>
  Enum: `application/json`
</ParamField>

<ParamField header="Authorization" type="string" required={true}>
  Bearer authentication format: Bearer \{\{API Key}}.
</ParamField>

## Request Body

<ParamField body="text" type="string">
  The text to be synthesized into audio, limited to a maximum of 50,000 characters. Either this or `text_file_id` is required.<br /><br />Interjection tags: Only when the model is `speech-2.8-hd` or `speech-2.8-turbo`, interjection tags can be inserted into the text. Supported interjections: `(laughs)` (laughter), `(chuckle)` (chuckle), `(coughs)` (cough), `(clear-throat)` (throat clearing), `(groans)` (groan), `(breath)` (normal breathing), `(pant)` (panting), `(inhale)` (inhale), `(exhale)` (exhale), `(gasps)` (gasp), `(sniffs)` (sniff), `(sighs)` (sigh), `(snorts)` (snort), `(burps)` (burp), `(lip-smacking)` (lip smacking), `(humming)` (humming), `(hissing)` (hissing), `(emm)` (umm), `(whistles)` (whistle), `(sneezes)` (sneeze), `(crying)` (sobbing), `(applause)` (applause)
</ParamField>

<ParamField body="text_file_id" type="integer">
  The text file ID for audio synthesis. Single file length limit is less than 100,000 characters. Supported file formats: txt, zip. Either this or `text` is required; format is automatically validated upon submission.<br />**txt file**: Length limit \<100,000 characters. Supports custom pauses using `&lt;#x#&gt;` markers. x is the pause duration (in seconds), range \[0.01, 99.99], up to two decimal places. Note that pauses must be placed between two vocalizable text segments; consecutive pause markers cannot be used.<br />**zip file**:<br />The archive must contain txt or json files of the same format.<br />json file format: Supports \[`title`, `content`, `extra`] three fields, representing title, body, and additional information respectively. If all three fields exist, 3 sets of results will be produced, totaling 9 files stored in a single folder. If a field does not exist or is empty, no corresponding result will be generated for that field.
</ParamField>

<ParamField body="voice_modify" type="object">
  <Expandable title="properties" defaultOpen={true}>
    <ParamField body="pitch" type="integer">
      Pitch adjustment (deep/bright), range \[-100, 100]. Values closer to -100 produce a deeper sound; values closer to 100 produce a brighter sound.

      Range: \[-100, 100]
    </ParamField>

    <ParamField body="timbre" type="integer">
      Timbre adjustment (rich/crisp), range \[-100, 100]. Values closer to -100 produce a richer sound; values closer to 100 produce a crisper sound.

      Range: \[-100, 100]
    </ParamField>

    <ParamField body="intensity" type="integer">
      Intensity adjustment (powerful/soft), range \[-100, 100]. Values closer to -100 produce a more powerful sound; values closer to 100 produce a softer sound.

      Range: \[-100, 100]
    </ParamField>

    <ParamField body="sound_effects" type="string">
      Sound effect settings. Only one can be selected at a time. Possible values:

      1. spacious\_echo (Spacious Echo)
      2. auditorium\_echo (Auditorium Broadcast)
      3. lofi\_telephone (Telephone Distortion)
      4. robotic (Electronic Voice)

      Possible values: `spacious_echo`, `auditorium_echo`, `lofi_telephone`, `robotic`
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="audio_setting" type="object">
  <Expandable title="properties" defaultOpen={true}>
    <ParamField body="format" type="string" default="mp3">
      The format of the generated audio. Options: \[mp3, pcm, flac], Default: `mp3`

      Possible values: `mp3`, `pcm`, `flac`
    </ParamField>

    <ParamField body="bitrate" type="integer" default={128000}>
      The bitrate of the generated audio. Options: \[32000, 64000, 128000, 256000], Default: `128000`. This parameter only applies to `mp3` format audio.
    </ParamField>

    <ParamField body="channel" type="integer" default={2}>
      The number of audio channels. Options: \[1, 2], where `1` is mono and `2` is stereo. Default: 1
    </ParamField>

    <ParamField body="audio_sample_rate" type="integer" default={32000}>
      The sample rate of the generated audio. Options: \[8000, 16000, 22050, 24000, 32000, 44100], Default: `32000`
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="voice_setting" type="object" required={true}>
  <Expandable title="properties" defaultOpen={true}>
    <ParamField body="vol" type="number" default={1}>
      The volume of the synthesized audio. Higher values result in louder volume. Range (0, 10], Default: 1.0

      Range: \[0, 10]
    </ParamField>

    <ParamField body="pitch" type="integer" default={0}>
      The pitch of the synthesized audio. Range \[-12, 12], Default: 0, where 0 outputs the original voice.

      Range: \[-12, 12]
    </ParamField>

    <ParamField body="speed" type="number" default={1}>
      The speech rate of the synthesized audio. Higher values result in faster speech. Range \[0.5, 2], Default: 1.0

      Range: \[0.5, 2]
    </ParamField>

    <ParamField body="emotion" type="string">
      Controls the emotion of the synthesized speech. Possible values: \["happy", "sad", "angry", "fearful", "disgusted", "surprised", "calm", "fluent", "whisper"], corresponding to 9 emotions: happy, sad, angry, fearful, disgusted, surprised, neutral, vivid, whisper.
      <br />The model automatically matches appropriate emotions based on input text; manual specification is generally unnecessary.
      <br />This parameter only applies to `speech-2.6-hd`, `speech-2.6-turbo`, `speech-02-hd`, `speech-02-turbo`, `speech-01-hd`, `speech-01-turbo` models.
      <br />Options `fluent` and `whisper` only apply to `speech-2.6-turbo` and `speech-2.6-hd` models.

      Possible values: `happy`, `sad`, `angry`, `fearful`, `disgusted`, `surprised`, `calm`, `fluent`, `whisper`
    </ParamField>

    <ParamField body="voice_id" type="string" required={true}>
      The voice ID for the synthesized audio. To set mixed voices, use the timber\_weights parameter and set this parameter to an empty value. Supports system voices, cloned voices, and text-generated voices. Below are some of the latest system voice IDs; see the official documentation for the full list of supported voices.
      <br />**Chinese**:<br />moss\_audio\_ce44fc67-7ce3-11f0-8de5-96e35d26fb85<br />moss\_audio\_aaa1346a-7ce7-11f0-8e61-2e6e3c7ee85d<br />Chinese (Mandarin)\_Lyrical\_Voice<br />Chinese (Mandarin)\_HK\_Flight\_Attendant<br />**English**:<br />English\_Graceful\_Lady<br />English\_Insightful\_Speaker<br />English\_radiant\_girl<br />English\_Persuasive\_Man<br />moss\_audio\_6dc281eb-713c-11f0-a447-9613c873494c<br />moss\_audio\_570551b1-735c-11f0-b236-0adeeecad052<br />moss\_audio\_ad5baf92-735f-11f0-8263-fe5a2fe98ec8<br />English\_Lucky\_Robot<br />**Japanese**:<br />Japanese\_Whisper\_Belle<br />moss\_audio\_24875c4a-7be4-11f0-9359-4e72c55db738<br />moss\_audio\_7f4ee608-78ea-11f0-bb73-1e2a4cfcd245<br />moss\_audio\_c1a6a3ac-7be6-11f0-8e8e-36b92fbb4f95
    </ParamField>

    <ParamField body="english_normalization" type="boolean" default={false}>
      Enables English text normalization. When enabled, it can improve performance in number reading scenarios but slightly increases latency. Default: false.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="aigc_watermark" type="boolean" default={false}>
  Controls whether to add an audio rhythm identifier at the end of the synthesized audio. Default: False. This parameter only applies to non-streaming synthesis.
</ParamField>

<ParamField body="language_boost" type="string">
  Whether to enhance recognition of specified minority languages and dialects. Default: `null`. Can be set to `auto` to let the model automatically determine the language type.

  Possible values: `Chinese`, `Chinese,Yue`, `English`, `Arabic`, `Russian`, `Spanish`, `French`, `Portuguese`, `German`, `Turkish`, `Dutch`, `Ukrainian`, `Vietnamese`, `Indonesian`, `Japanese`, `Italian`, `Korean`, `Thai`, `Polish`, `Romanian`, `Greek`, `Czech`, `Finnish`, `Hindi`, `Bulgarian`, `Danish`, `Hebrew`, `Malay`, `Persian`, `Slovak`, `Swedish`, `Croatian`, `Filipino`, `Hungarian`, `Norwegian`, `Slovenian`, `Catalan`, `Nynorsk`, `Tamil`, `Afrikaans`, `auto`
</ParamField>

<ParamField body="continuous_sound" type="boolean" default={false}>
  Enable this parameter to make clause transitions more natural. Only supported for `speech-2.8-hd` and `speech-2.8-turbo` models.
</ParamField>

<ParamField body="pronunciation_dict" type="object">
  <Expandable title="properties" defaultOpen={true}>
    <ParamField body="tone" type="array">
      Define pronunciation annotation or replacement rules for characters or symbols that require special marking. In Chinese text, tones are represented by numbers:
      1st tone is `1`, 2nd tone is `2`, 3rd tone is `3`, 4th tone is `4`, neutral tone is `5`.
      Example:
      \["omg/oh my god"]
    </ParamField>
  </Expandable>
</ParamField>

## Response

<ResponseField name="file_id" type="integer" required={false}>
  The ID of the corresponding audio file returned after successful task creation.<br /><br />After the task is completed, you can query using the file\_id. This field is not returned when the request fails.

  Note: The returned download URL is valid for 9 hours (32,400 seconds) from generation. After expiration, the file will become invalid and the generated content will be lost. Please download in time.
</ResponseField>

<ResponseField name="task_id" type="string" required={false}>
  Use the task\_id to call the [Get Async Task Result API](/docs/models/reference-get-async-task-result) to retrieve the generated output.
</ResponseField>

<ResponseField name="base_resp" type="object" required={false}>
  <Expandable title="properties" defaultOpen={true}>
    <ResponseField name="status_msg" type="string" required={true}>
      Status details
    </ResponseField>

    <ResponseField name="status_code" type="integer" required={true}>
      Status code<br /><br />`0`: Normal<br />`1002`: Rate limited<br />`1004`: Authentication failed<br />`1039`: TPM rate limit triggered<br />`1042`: Illegal characters exceed 10%<br />`2013`: Parameter error
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="task_token" type="string" required={false}>
  The key information used to complete the current task
</ResponseField>

<ResponseField name="usage_characters" type="integer" required={false}>
  Billed character count
</ResponseField>
