Gemini 3.6 Flash
This page is generated from the upstream official OpenAPI documentation. Endpoints, parameters and examples match the official docs; brand and API domain are replaced with ModelFold.
Endpoint
POST /gemini/v1/models/gemini-3-6-flash:streamGenerateContent
Full URL: https://ai.modelfold.online/gemini/v1/models/gemini-3-6-flash:streamGenerateContent
Authentication: every request must include the
Authorization: Bearer <API_KEY>header.
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.
Streaming Support
The Gemini endpoint returns streaming chunks from streamGenerateContent. Function calling responses appear in candidates[].content.parts[].functionCall.
Streaming Response Format:
- Content-Type: text/event-stream. The last data chunk carries usageMetadata and credits_consumed, followed by data: [DONE].
- Function calls are returned inside
parts[].functionCall - Thinking output may be reflected through
thoughtSignatureand usage metadata
Features
- Standard chat with
contents. - Google Search grounding with
googleSearch. - Function calling with
functionDeclarations. - Thinking configuration with
generationConfig.thinkingConfig.
Request Notes
- Use
contentsas the primary conversation input. - Use
tools.googleSearchto enable Google Search grounding. - Use
tools.functionDeclarationsto define callable functions. - Use
generationConfig.thinkingConfigto control thoughts output and thinking level.
Authentication
Authentication: send your ModelFold API key as Authorization: Bearer YOUR_API_KEY.
Error Responses
Errors are returned with HTTP 200 and a JSON body {"code": <int>, "msg": "<reason>"}. Check code (200 = success) before reading choices/candidates.
Request Parameters
Body (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
contents | array<object> | Yes | Conversation input for Gemini. |
contents[].role | string | Yes | Content role. Allowed values:user / model。 示例:user。 |
contents[].parts | `array<object | object | object>` |
tools | `array<object | object>` | No |
generationConfig | object | No | Generation configuration. |
generationConfig.thinkingConfig | object | No | Thinking configuration. |
generationConfig.thinkingConfig.includeThoughts | boolean | No | Whether to include thought output. 示例:true。 |
generationConfig.thinkingConfig.thinkingLevel | string | No | Thinking level. Allowed values:low / high。 示例:high。 |
stream | boolean | No | If set to true, the response is returned as stream chunks. Default:true。 示例:true。 |
Request Example
curl -X POST "https://ai.modelfold.online/gemini/v1/models/gemini-3-6-flash:streamGenerateContent" \
-H "Authorization: Bearer $MODELFOLD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"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"
}
}
}'{
"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"
}
}
}Response
200 — Request successful.
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
candidates | array<object> | 否 | Candidate results |
candidates[].content | object | 否 | — |
candidates[].content.role | string | 否 | 示例:model。 |
candidates[].content.parts | array<object> | 否 | — |
candidates[].content.parts[].functionCall | object | 否 | Function call payload |
candidates[].content.parts[].thoughtSignature | string | 否 | Thought signature 示例:Es8CCswCAb4example。 |
candidates[].content.parts[].text | string | 否 | Text output |
candidates[].finishReason | string | 否 | Candidate finish reason 示例:STOP。 |
modelVersion | string | 否 | Returned model version. May be absent. 示例:gemini-3-6-flash。 |
usageMetadata | object | 否 | Token usage metadata |
usageMetadata.candidatesTokenCount | integer | 否 | 示例:18。 |
usageMetadata.thinkingTokenCount | integer | 否 | 示例:55。 |
usageMetadata.totalTokenCount | integer | 否 | 示例:325。 |
usageMetadata.promptTokenCount | integer | 否 | 示例:252。 |
credits_consumed | number | 否 | Credits consumed by the request 示例:0.01。 |
{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"functionCall": {
"args": {
"location": "Beijing"
},
"name": "get_weather_forecast",
"id": "gp737npz"
},
"thoughtSignature": "Es8CCswCAb4example"
}
]
},
"finishReason": "STOP"
}
],
"modelVersion": "gemini-3-6-flash",
"usageMetadata": {
"candidatesTokenCount": 18,
"thinkingTokenCount": 55,
"totalTokenCount": 325,
"promptTokenCount": 252
},
"credits_consumed": 0.01
}