Authorization: Bearer ********************{
"contents": [
{
"parts": [
{
"text": "[excited] 你好,这是 Gemini 3.1 Flash TTS 生成的语音。"
}
]
}
],
"generationConfig": {
"responseModalities": [
"AUDIO"
],
"speechConfig": {
"voiceConfig": {
"prebuiltVoiceConfig": {
"voiceName": "Kore"
}
}
}
}
}curl --location '/v1beta/models/gemini-3.1-flash-tts-preview:generateContent' \
--header 'x-goog-api-key: {{YOUR_API_KEY}}' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"contents": [
{
"parts": [
{
"text": "[excited] 你好,这是 Gemini 3.1 Flash TTS 生成的语音。"
}
]
}
],
"generationConfig": {
"responseModalities": [
"AUDIO"
],
"speechConfig": {
"voiceConfig": {
"prebuiltVoiceConfig": {
"voiceName": "Kore"
}
}
}
}
}'{}