MaaS-Ele TextToSpeech
1.Request Method:
POST
2.Request Path:
/tts-e/text-to-speech/{voice_id}
3.PathVariables
| Parameter | Description | Example |
|---|---|---|
| voice_id | Voice ID, see Appendix for details | EXAVITQu4vr4xnSDxMaL |
4.QueryParams
| Parameter | Description | Example |
|---|---|---|
| enable_logging | Privacy mode true: (default) non-privacy mode false: privacy mode |
true |
| optimize_streaming_latency | Latency optimization (deprecated parameter) Available values: 1-4 |
1 |
| output_format | Output format Available values: mp3_22050_32 mp3_44100_32 mp3_44100_64 mp3_44100_96 mp3_44100_128 (default) mp3_44100_192 pcm_16000 pcm_22050 pcm_24000 pcm_44100 ulaw_8000 |
mp3_44100_128 |
5.Request Headers
| Parameter | Description | Example |
|---|---|---|
| Authorization | AccessKey Bearer ${AccessKey} | Bearer RWYxxxxGd |
6.Request Body
| Parameter | Required | Description | Example |
|---|---|---|---|
| text | Yes | Text (required) | how are you |
| model_id | No | Model ID Available values: eleven_monolingual_v1 (default) eleven_multilingual_v2 eleven_turbo_v2_5 eleven_turbo_v2 eleven_multilingual_v1 eleven_monolingual_v1 |
1 |
| language_code | No | Language code, currently only supported by eleven_turbo_v2_5 | ISO 639-1 |
| voice_settings | No | Voice settings | {"stability":0,"similarity_boost":1.0} |
| voice_settings.stability | No | Stability | 0 |
| voice_settings.similarity_boost | No | Similarity Boost | 1.0 |
| voice_settings.style | No | Voice Style | 0 |
| voice_settings.use_speaker_boost | No | Use Speaker Boost true (default)/false |
true |
| pronunciation_dictionary_locators | No | object[] List of pronunciation dictionary locators, supports up to 3 |
"pronunciation_dictionary_locators": [{"pronunciation_dictionary_id": " |
| pronunciation_dictionary_locators.pronunciation_dictionary_id | No | Pronunciation Dictionary ID | 123 |
| pronunciation_dictionary_locators.version_id | No | Version ID | 123 |
| seed | No | Deterministic Sampling | 123 |
| previous_text | No | Previous Text Content | hi |
| next_text | No | Next Text Content | how are you |
| previous_request_ids | No | string[] List of previous sample request IDs |
["xx","xxx"] |
| next_request_ids | No | string[] List of next sample request IDs |
["xx","xxx"] |
7.Response Headers
| Parameter | Description | Example |
|---|---|---|
| character-cost | Character Size | 333 |
| request-id | Request ID | 12342wqwqe |
8.Response Body
File stream
9.Request Example:
curl --location '${endpointPath}/tts-e/text-to-speech/{voice_id}' \
--header 'Authorization: Bearer ${AccessKey}' \
--header 'Content-Type: application/json' \
--data '{
"text": "hi",
"voice_settings": {
"stability": 0,
"similarity_boost": 1.0
}
}'
10.Appendix
- Available voice_id
| name | voice_id |
|---|---|
| Sarah | EXAVITQu4vr4xnSDxMaL |
| Laura | FGY2WhTYpPnrIDTdsKH5 |
| Charlie | IKne3meq5aSn9XLyUdCD |
| George | JBFqnCBsd6RMkjVDRZzb |
| Callum | N2lVS1w4EtoT3dr4eOWO |
| Liam | TX3LPaxmHKxFdv7VOQHJ |
| Charlotte | XB0fDUnXU5powFXDhCwa |
| Alice | Xb7hH8MSUJpSbSDYk0k2 |
| Matilda | XrExE9yKIg1WjnnlVkGX |
| Will | bIHbv24MWmeRgasZH58o |
| Jessica | cgSgspJ2msm6clMCkdW9 |
| Eric | cjVigY5qzO86Huf0OWal |
| Chris | iP95p4xoKVk53GoZ742B |
| Brian | nPczCjzI2devNBz1zQrb |
| Daniel | onwK4e9ZLuTAKqWW03F9 |
| Lily | pFZP5JQG7iQjIQuC4Bku |
| Bill | pqHfZKP75CvOlQylNhV4 |