跳到主要内容

原生Gemini格式

POST /v1beta/models/{model}:generateContent

请求参数​

参数名类型必选说明
model (path)string必选模型名称
contentsarray<object>必选-
contents[].partsarray<object>可选-
contents[].parts[].textstring可选-
generationConfigobject必选-
generationConfig.responseModalitiesarray<string>必选-
generationConfig.speechConfigobject必选-
generationConfig.speechConfig.voiceConfigobject必选-

请求示例​

{
"path": {
"model": "string"
},
"body": {
"contents": [
{}
],
"generationConfig": {
"responseModalities": [
"string"
],
"speechConfig": {
"voiceConfig": {
"prebuiltVoiceConfig": {
"voiceName": "string"
}
}
}
}
}
}

响应字段(200)​

字段名类型说明
无结构化响应字段(可能为二进制或无响应体)