generationConfig.responseModalities 中包含 AUDIO,并通过 speechConfig.voiceConfig 指定音色。{
"contentType": "application/json",
"properties": {
"contents": {
"items": {
"properties": {
"parts": {
"items": {
"properties": {
"inline_data": {
"properties": {
"data": {
"type": "string"
},
"mime_type": {
"type": "string"
}
},
"required": [
"mime_type",
"data"
],
"type": "object"
},
"text": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"type": "array"
},
"generationConfig": {
"properties": {
"imageConfig": {
"properties": {
"aspectRatio": {
"type": "string",
"x-apifox-mock": "16:9"
}
},
"required": [
"aspectRatio"
],
"type": "object"
},
"responseModalities": {
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"responseModalities",
"imageConfig"
],
"type": "object"
}
},
"required": [
"contents",
"generationConfig"
]
}{
"contents": [
{
"parts": [
{
"text": "说出,我是谁,谁是我"
}
]
}
],
"generationConfig": {
"responseModalities": [
"AUDIO"
],
"speechConfig": {
"voiceConfig": {
"prebuiltVoiceConfig": {
"voiceName": "Kore"
}
}
}
},
"model": "gemini-2.5-flash-preview-tts"
}