Supported models
Model name | Synthesis price (per 10,000 characters) | Free quota(Note) | |
|---|---|---|---|
MiniMax/speech-2.8-hd | CNY 3.5 | CNY 9.9 (Charged the first time a cloned voice is used for speech synthesis.) | None |
MiniMax/speech-02-hd | CNY 3.5 | ||
MiniMax/speech-2.8-turbo | CNY 2 | ||
MiniMax/speech-02-turbo | CNY 2 |
URL
- China (Beijing)
POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generationBase URL for SDK calls: https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1Replace WorkspaceId with your actual workspace ID.Headers
Parameter | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | The authentication token. The format is |
Content-Type | string | Yes | The media type of the request body. This must be set to |
X-DashScope-SSE | string | No | Enables Server-Sent Events (SSE) for streaming output. Set to |
Request bodymodelstring(Required)The name of the model to use. Supported models:
object(Required)
Properties text string(Required)The text to synthesize into speech.The text must be less than 10,000 characters long. For text longer than 3,000 characters, streaming output is recommended.stream_options object(Optional)Streaming output configuration. Effective only when the request header X-DashScope-SSE: enable is set.
Properties exclude_aggregated_audio boolean(Optional) Default: falseControls whether the audio field in the final synthesis-complete frame returns the full concatenated audio of the entire synthesis (i.e., the concatenation of all in-progress chunks as a single hex string).Valid values:
This parameter takes effect only in streaming output mode; it has no effect in non-streaming mode. object(Required)
Properties voice_id string(Required)Specifies the voice ID.To blend multiple voices, configure the timbre_weights parameter and leave this parameter empty.speed float(Optional) Default: 1.0Specifies the speech rate.Value range: [0.5, 2.0].vol float(Optional) Default: 1.0Specifies the volume.Value range: (0.0, 10.0].pitch integer(Optional) Default: 0Specifies the pitch.Value range: [-12, 12].emotion string(Optional) No default valueSpecifies the emotion. The model automatically detects the appropriate emotion from the input text, so you typically do not need to set this parameter manually.Valid values:
The speech-2.8-hd and speech-2.8-turbo models do not support whisper.boolean(Optional) Default: falseSpecifies whether to enable text normalization for Chinese and English. Enabling this improves performance in scenarios that involve reading numbers, but it might slightly increase latency.Valid values:
boolean(Optional) Default: falseSpecifies whether to enable reading of LaTeX formulas.Valid values:
$$x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}$$.
object(Optional)
Properties sample_rate integer(Optional) Default: 32000Specifies the sample rate (in Hz) of the generated audio.Valid values:
integer(Optional) Default: 128000Specifies the bitrate (in kbps) of the generated audio.Valid values:
This parameter applies only when the format parameter is set to mp3. For other formats, this parameter is ignored.string(Optional) Default: mp3Specifies the format of the generated audio.Valid values:
integer(Optional) Default: 1Specifies the number of audio channels for the generated audio.Valid values:
boolean(Optional) Default: falseSpecifies whether to encode the audio at a constant bitrate (CBR).Valid values:
This parameter is effective only for streaming output and when the audio format is mp3.object(Optional)
Properties tone string[](Optional)Defines custom pronunciation or replacement rules for specific words or symbols.
Use a forward slash (For Chinese text, tones are represented by numbers: 1 for the first tone, 2 for the second, 3 for the third, 4 for the fourth, and 5 for the neutral tone.Example:["Yan Shaofei/(yan4)(shao3)(fei1)", "omg/oh my god"]object[](Optional)Specifies the weights for blending multiple voices. You can blend up to four voices.
Properties voice_id string(Required)Specifies the voice ID.weight integer(Required)Specifies the weight of the voice. This must be set along with voice_id. A higher weight makes the synthesized voice sound more similar to the corresponding voice.Value range: [1, 100].string(Optional) Default: nullSpecifies whether to improve synthesis quality for specific low-resource languages and dialects. Set to auto to let the model decide automatically.
Valid values (click to view):
object(Optional)Modifies audio characteristics or applies sound effects. This parameter is supported for the following audio formats:
Properties pitch integer(Optional) No default valueSets the pitch (deep/bright).Lower values make the voice deeper; higher values make it brighter.Value range: [-100, 100].intensity integer(Optional) No default valueSets the intensity (powerful/soft).Lower values make the voice more powerful; higher values make it softer.Value range: [-100, 100].timbre integer(Optional) No default valueSets the timbre brightness (richer/crisp).Lower values make the voice richer; higher values make it crisper.Value range: [-100, 100].sound_effects string(Optional) No default valueSets the sound effect.Valid values:
boolean(Optional) Default: falseSpecifies whether to enable subtitle generation.Valid values:
This parameter is valid only in non-streaming output scenarios and only for the speech-2.8-hd, speech-2.8-turbo, speech-2.6-hd, speech-2.6-turbo, speech-02-hd, speech-02-turbo, speech-01-hd, and speech-01-turbo models.string(Optional) Default: hexSpecifies the format of the output result.Valid values:
This parameter applies only to non-streaming mode. Streaming mode always returns results in hex format.boolean(Optional) Default: falseSpecifies whether to add an inaudible AIGC watermark to the end of the synthesized audio.Valid values:
This parameter applies only to non-streaming output. |
Response bodyrequest_idstringA unique identifier for this API call.outputobjectThe data returned by the model.
Properties base_resp objectThe status code and details of this request.
Properties status_code integerThe status code.
stringDetails about the status.objectThe synthesized data object. This value can be null, so you should perform a null check.
Properties audio stringThe synthesized audio data. Its content depends on the output_format request parameter, containing a URL for url or hexadecimal-encoded data for hex.status integerThe current status of the audio stream: 1 indicates that synthesis is in progress, and 2 indicates that synthesis is complete.object
Properties audio_length integerThe audio duration in milliseconds.audio_sample_rateintegerThe audio sample rate.audio_sizeintegerThe audio file size in bytes.bitrateintegerThe audio bitrate.audio_formatstringThe format of the generated audio file. Valid values: [mp3, pcm, flac].Available options: mp3, pcm, and flac.audio_channel integerThe number of audio channels in the generated audio. A value of 1 indicates mono, and 2 indicates stereo.invisible_character_ratio floatThe percentage of invalid characters. If the percentage is 10% or less, the audio is generated successfully and this value is returned. If it exceeds 10%, the request fails.usage_charactersintegerThe number of billable characters.word_countintegerThe number of spoken words, including Chinese characters, numbers, and letters, but excluding punctuation marks.stringInclude this ID in feedback or support requests to aid troubleshooting.object
Details audio stringThe synthesized audio data is hex-encoded, and its format is consistent with the output format specified by the output_format parameter in the request.objectThe character usage for this request.
Properties characters integerThe number of characters in the input text. |