Gemini TTS Proxy
语音生成控制台
Model
...
Voice
Kore
Limit
8000
Output
WAV
生成结果
Audio output appears here
接口设置
/api/tts
curl
curl -X POST '/api/tts' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_SERVICE_KEY' \
--output gemini-tts.wav \
-d '{
"text": "Welcome to the Gemini text to speech console. This proxy returns a WAV file that another application can play or store directly.",
"voiceName": "Kore",
"stylePrompt": "Say in a clear, warm, professional narration style."
}'fetch
const response = await fetch("/api/tts", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": process.env.TTS_SERVICE_KEY
},
body: JSON.stringify({
"text": "Welcome to the Gemini text to speech console. This proxy returns a WAV file that another application can play or store directly.",
"voiceName": "Kore",
"stylePrompt": "Say in a clear, warm, professional narration style."
})
});
if (!response.ok) throw new Error(await response.text());
const wavBlob = await response.blob();