Skip to content

MaaS_Az_tts/Op_tts

Request Method

POST

https://genaiapi-m2.cloudsway.net/v1/{endpoint}/audio/speech

Parameter Description Example
Authorization AccessKey Bearer ${AccessKey} Bearer xxxxxx

Request Parameters

Parameter Description Example
model Use Model MaaS_Az_tts
input Text for which audio needs to be generated how are you
voice Available sounds when generating audio Optional values: "Alloy", "echo", "fable", "onyx", "nova", "shimmer" alloy
response_format Audio format Optional values: "mp3", "opus", "aac", "flac", "wav", "pcm" mp3
speed Audio Speed Range: 0.25 to 4.0. 1

Return value

File Stream

Request example

curl --location 'https://genaiapi-m2.cloudsway.net/v1/ai/{endpoint}/audio/speech' \
--header 'Authorization: Bearer xxxx' \
--header 'Content-Type: application/json' \
--data '{
    "input":"<speak version='\''1.0'\'' xml:lang='\''en-US'\''><voice xml:lang='\''en-US'\'' xml:gender='\''Female'\'' name='\''en-US-AvaMultilingualNeural'\''>my voice is my passport verify me</voice></speak>",
    "response_format":"audio-16khz-128kbitrate-mono-mp3"
}'

MaaS OSpeech

curl --location 'https://genaiapi-m2.cloudsway.net/v1/ai/{endpoint}/audio/speech' \
--header 'Authorization: Bearer xxxx' \
--header 'Content-Type: application/json' \
--data '{
    "input":"hi,what is your name?",
    "voice":"alloy",
    "speed":1.0,
    "response_format":"mp3"
}'

Get the regional voice list of MaaS ASpeech

Request Method

GET

https://genaiapi-m2.cloudsway.net/v1/ai/ {endpointPath}/cognitiveservices/voices/list

header

Parameter Description Example
Authorization AccessKey Bearer ${AccessKey} Bearer xxxxxx

Sample request

```plain text curl --location 'https://genaiapi-m2.cloudsway.net/v1/ai/{endpointPath}/cognitiveservices/voices/list' \ --header 'Authorization: Bearer xxxx'

## Return Parameters&#x20;

Object Array

Object Parameters:

| **Parameter**   | **Description**           | **Example**                                                      |
| --------------- | ------------------------- | ---------------------------------------------------------------- |
| Name            | Full name of voice        | Microsoft Server Speech Text to Speech Voice (af-ZA, AdriNeural) |
| DisplayName     | Display name              | Adri                                                             |
| LocalName       | Local Name                | Adri                                                             |
| ShortName       | Abbreviation              | af-ZA-AdriNeural                                                 |
| Gender          | Voice sex                 | Female                                                           |
| Locale          | Language environment      | af-ZA                                                            |
| LocaleName      | Language environment name | Afrikaans (South Africa)                                         |
| SampleRateHertz | Sampling hertz            | 48000                                                            |
| VoiceType       | Voice type                | Neural                                                           |
| Status          | Status                    | GA                                                               |
| WordsPerMinute  | Words read per minute     | 147                                                              |

**Response**

```json
[
    {
        "Name": "Microsoft Server Speech Text to Speech Voice (af-ZA, AdriNeural)",
        "DisplayName": "Adri",
        "LocalName": "Adri",
        "ShortName": "af-ZA-AdriNeural",
        "Gender": "Female",
        "Locale": "af-ZA",
        "LocaleName": "Afrikaans (South Africa)",
        "SampleRateHertz": "48000",
        "VoiceType": "Neural",
        "Status": "GA",
        "VoiceTag": {
            "ModelSeries": [
                "Monolingual"
            ],
            "Source": [
                "Azure"
            ],
            "TailoredScenarios": [
                "Assistant",
                "Narration"
            ],
            "VoicePersonalities": [
                "Well-Rounded",
                "Animated",
                "Bright"
            ]
        },
        "WordsPerMinute": "147"
    },
......
]