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 'https://api.kie.ai/gemini/v1/models/gemini-3-8-flash:streamGenerateContent' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"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": {
"tempor_7d": "reprehenderit quis et",
"utea": "dolor Ut"
},
"name": "get_weather_forecast",
"id": "gp737npz"
},
"thoughtSignature": "Es8CCswCAb4example",
"text": "Teres minima cibo vulpes desidero talus capitulus tamen curvo autus. Ciminatio tribuo qui colligo thesaurus. Velociter cruentus textus atrox curvo solum amoveo vinum candidus."
},
{
"functionCall": {
"args": {
"Lorem35": true,
"deserunt_f2c": -18354863,
"consequate68": "cillum qui ex"
},
"name": "get_weather_forecast",
"id": "gp737npz"
},
"thoughtSignature": "Es8CCswCAb4example",
"text": "Denuncio sursum vulariter acerbitas.\nAb cunabula vigor perferendis."
}
]
},
"finishReason": "STOP"
},
{
"content": {
"role": "model",
"parts": [
{
"functionCall": {
"args": {
"deserunte8": -61205564
},
"name": "get_weather_forecast",
"id": "gp737npz"
},
"thoughtSignature": "Es8CCswCAb4example",
"text": "Apto absens vere denego adfero.\nTenus versus turba arbor ulciscor itaque ver alias.\nSoleo maxime pecus ascisco concido.\nTripudio alveus hic appello calamitas turba cuius."
},
{
"functionCall": {
"args": {
"dolore392": 98588514.72090021,
"ex_7f": "velit dolore do reprehenderit sit"
},
"name": "get_weather_forecast",
"id": "gp737npz"
},
"thoughtSignature": "Es8CCswCAb4example",
"text": "Neque adulescens condico solitudo ago non. Molestias cena sumptus vomer. Suffoco civitas ara."
},
{
"functionCall": {
"args": {
"ut_26": true
},
"name": "get_weather_forecast",
"id": "gp737npz"
},
"thoughtSignature": "Es8CCswCAb4example",
"text": "Solio cohors charisma aetas laboriosam. Apostolus autus subnecto demergo combibo theatrum laboriosam. Aestivus natus terminatio ullus.\nEt comburo deduco taceo audio coma coepi vita. Vado deleniti thema adflicto compello armarium sto tactus ullus aestivus. Charisma in caute canonicus sui aperio super caelum crastinus.\nBrevis crur quos cernuus. Turbo capto aro blanditiis cunabula adflicto. Crustulum tutis verto cohors correptius adhuc decet conqueror talio audacia."
}
]
},
"finishReason": "STOP"
}
],
"modelVersion": "gemini-3-8-flash",
"usageMetadata": {
"candidatesTokenCount": 18,
"thoughtsTokenCount": 55,
"totalTokenCount": 325,
"promptTokenCount": 252
},
"credits_consumed": 0.01,
"responseId": "xRS0aZC5BNHVz7IPuaO42Qk"
}