Run in Apifox
Gemini 音频生成接口。 可使用gemini-2.5-flash-preview-tts等模型
Request Body Params application/json
{
"contents" : [
{
"parts" : [
{
"text" : "Say cheerfully: Have a wonderful day!"
}
]
}
] ,
"generationConfig" : {
"responseModalities" : [
"AUDIO"
] ,
"speechConfig" : {
"voiceConfig" : {
"prebuiltVoiceConfig" : {
"voiceName" : "Kore"
}
}
}
}
} Request Code Samples
curl --location 'https://moteapi.com/v1beta/models/gemini-2.5-flash-preview-tts:generateContent' \
--header 'Content-Type: application/json' \
--data '{
"contents": [
{
"parts": [
{
"text": "Say cheerfully: Have a wonderful day!"
}
]
}
],
"generationConfig": {
"responseModalities": [
"AUDIO"
],
"speechConfig": {
"voiceConfig": {
"prebuiltVoiceConfig": {
"voiceName": "Kore"
}
}
}
}
}' Responses
{
"candidates" : [
{
"content" : {
"role" : "string" ,
"parts" : [
{ }
]
} ,
"finishReason" : "string" ,
"safetyRatings" : [
{ }
]
}
] ,
"usageMetadata" : {
"promptTokenCount" : 0 ,
"candidatesTokenCount" : 0 ,
"totalTokenCount" : 0
}
} Modified at 2026-07-03 04:02:59