streamGenerateContent. Function calling responses appear in candidates[].content.parts[].functionCall.text/event-stream or provider stream chunksparts[].functionCallthoughtSignature and usage metadatacontents.googleSearch.functionDeclarations.generationConfig.thinkingConfig.contents as the primary conversation input.tools.googleSearch to enable Google Search grounding.tools.functionDeclarations to define callable functions.generationConfig.thinkingConfig to control thoughts output and thinking level.X-Goog-Api-Key. Do not add it as a regular request parameter.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"
}