curl -X POST "https://api.applerouter.ai/v1beta/models/gemini-2.5-flash-preview-tts:generateContent" \ -H "Authorization: Bearer sk-your-api-key" \ -H "Content-Type: application/json" \ -d '{ "contents": [ { "parts": [ {"text": "Say cheerfully: Have a wonderful day!"} ] } ], "generationConfig": { "responseModalities": ["AUDIO"], "speechConfig": { "voiceConfig": { "prebuiltVoiceConfig": { "voiceName": "Kore" } } } } }'
{ "candidates": [ { "content": { "role": "model", "parts": [ { "inlineData": { "mimeType": "audio/wav", "data": "base64_encoded_audio..." } } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 15, "candidatesTokenCount": 1000, "totalTokenCount": 1015 } }
Generate speech using Gemini TTS models
gemini-2.5-flash-preview-tts
responseModalities
AUDIO
speechConfig
使用 Bearer Token 认证。格式: Authorization: Bearer sk-xxxxxx
模型名称
Show child attributes
成功