WARNING
⚠️ Chat only
This model currently supports chat requests only and has not yet been adapted for agent use. Connecting it to an agent may cause request errors or unexpected results.
The Gemini endpoint returns streaming chunks from streamGenerateContent. Function calling responses appear in candidates[].content.parts[].functionCall.
Streaming Response Format:
parts[].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.Authentication: send your KIE API key as Authorization: Bearer YOUR_API_KEY.
Errors are returned with HTTP 200 and a JSON body {"code": , "msg": ""}. Check code (200 = success) before reading choices/candidates.
curl --location 'https://api.kie.ai/gemini/v1/models/gemini-3-5-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": {
"location": "Beijing"
},
"name": "get_weather_forecast",
"id": "gp737npz"
},
"thoughtSignature": "Es8CCswCAb4example"
}
]
},
"finishReason": "STOP"
}
],
"modelVersion": "gemini-3-5-flash",
"usageMetadata": {
"candidatesTokenCount": 18,
"thinkingTokenCount": 55,
"totalTokenCount": 325,
"promptTokenCount": 252
},
"credits_consumed": 0.01
}