streamGenerateContent 返回流式结果。函数调用结果会出现在 candidates[].content.parts[].functionCall 中。text/event-stream 或提供方分块流parts[].functionCall 中返回thoughtSignature 和 usage 信息体现contents 进行标准对话。googleSearch 启用联网搜索。functionDeclarations 进行函数调用。generationConfig.thinkingConfig 控制思考配置。contents 作为主要输入字段。tools.googleSearch 开启 Google Search。tools.functionDeclarations 定义可调用函数。generationConfig.thinkingConfig 控制思考输出与 thinking level。X-Goog-Api-Key,不作为普通请求参数填写。curl --location --request POST 'https://api.kie.ai/gemini/v1/models/gemini-3-flash-v1betamodels:streamGenerateContent' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"stream": true,
"contents": [
{
"role": "user",
"parts": [
{
"text": "What is the weather in Beijing today?"
}
]
}
],
"tools": [
{
"functionDeclarations": [
{
"name": "get_weather_forecast",
"description": "Get the weather forecast for a given location",
"parameters": {
"type": "OBJECT",
"properties": {
"location": {
"type": "STRING",
"description": "The city name, e.g. Beijing"
}
},
"required": [
"location"
]
}
}
]
}
],
"generationConfig": {
"thinkingConfig": {
"includeThoughts": true,
"thinkingLevel": "high"
}
}
}'{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"functionCall": {
"args": {
"location": "Beijing"
},
"name": "get_weather_forecast",
"id": "gp737npz"
},
"thoughtSignature": "Es8CCswCAb4example"
}
]
},
"finishReason": "STOP"
}
],
"modelVersion": "gemini-3-flash",
"usageMetadata": {
"candidatesTokenCount": 18,
"thoughtsTokenCount": 55,
"totalTokenCount": 325,
"promptTokenCount": 252
},
"credits_consumed": 0.01,
"responseId": "xRS0aZC5BNHVz7IPuaO42Qk"
}