Text-to-Speech API from DoubaoPrice:35 PTC/ M characters Request
API Key from 302.AI backend
Example:Bearer {{YOUR_API_KEY}}
Body Params application/json
wav / pcm / ogg_opus / mp3,Defaults to pcm
[0.8,2],Defaults to 1, usually one decimal place is sufficient
Any non-empty string can be passed, and the incoming value can be tracked through server-side logs.
Text for synthesized speech, length limit 1024 bytes
{"audio": {
"voice_type": "zh_male_M392_conversation_wvae_bigtts",
"encoding": "mp3",
"speed_ratio": 1.0
},
"request": {
"reqid": "xxxx",
"text": "你好啊",
"operation": "query"
}
}
Request samples
curl --location --request POST 'https://api.302.ai/doubao/tts_hd' \
--header 'Authorization: Bearer sk-jls4AaVBGoe1GwZD64qZA1qyKTN1MPHa4NmvH1cT68z7K1Zz' \
--header 'Content-Type: application/json' \
--data-raw '{"audio": {
"voice_type": "zh_male_M392_conversation_wvae_bigtts",
"encoding": "mp3",
"speed_ratio": 1.0
},
"request": {
"reqid": "xxxx",
"text": "你好啊",
"operation": "query"
}
}'
Responses
application/json Modified at 2025-02-14 06:00:55