POST https://studio.dataeyes.ai/v1beta/models/{model}:generateContent
POST https://studio.dataeyes.ai/v1beta/models/{model}:streamGenerateContent?alt=sse/v1beta/models/gemini-3.8-flash:generateContent.| Method | Example |
|---|---|
x-goog-api-key header (SDK default) | x-goog-api-key: sk-xxx |
Authorization header | Authorization: Bearer sk-xxx |
key URL parameter | ...:generateContent?key=sk-xxx |
{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"text": "I am Gemini, a large language model built by Google, designed to assist you with a wide variety of tasks.",
"thoughtSignature": "…"
}
]
},
"finishReason": "STOP"
}
],
"usageMetadata": {
"promptTokenCount": 13,
"candidatesTokenCount": 23,
"thoughtsTokenCount": 323,
"totalTokenCount": 359
},
"modelVersion": "gemini-3.8-flash"
}thoughtsTokenCount.| Parameter | Type | Required | Description |
|---|---|---|---|
contents | array | Yes | Conversation content. Each item has a role (user or model) and a parts array |
systemInstruction | object | No | System instruction, for example {"parts": [{"text": "..."}]} |
generationConfig | object | No | Generation settings. See the table below |
tools | array | No | Tools: functionDeclarations, googleSearch, urlContext, codeExecution |
generationConfig fields:| Field | Description |
|---|---|
temperature | Sampling temperature |
maxOutputTokens | Maximum output tokens |
thinkingConfig | Thinking settings, for example {"thinkingLevel": "low"}. Add "includeThoughts": true to return a thought summary |
responseMimeType | Set to application/json to output JSON |
responseSchema | Constrains the JSON structure, used together with responseMimeType |
parts can contain text (text), public files (fileData), Base64 files (inlineData), and function results (functionResponse).:streamGenerateContent?alt=sse. Each data: chunk is a fully structured response fragment. Use the usageMetadata in the last chunk as the final usage.thinkingLevel controls how deeply the model thinks (low, high). Set includeThoughts to true to return a thought summary."thought": true, placed before the answer:{
"parts": [
{ "text": "**My Thought Process on Resolving the Deception** …", "thought": true },
{ "text": "… The person telling the truth is **B**. …", "thoughtSignature": "…" }
]
}text:"{\"name\":\"John Smith\",\"age\":28,\"city\":\"Seattle\",\"job\":\"product manager\"}"functionCall:{
"parts": [
{
"functionCall": { "name": "get_weather", "args": { "city": "Shanghai" } },
"thoughtSignature": "…"
}
]
}contents, include the original question, the part returned by the model (unchanged, including thoughtSignature), and a functionResponse, in that order:{
"contents": [
{"role": "user", "parts": [{"text": "What's the weather like in Shanghai today?"}]},
{"role": "model", "parts": [
{"functionCall": {"name": "get_weather", "args": {"city": "Shanghai"}}, "thoughtSignature": "…"}
]},
{"role": "user", "parts": [
{"functionResponse": {"name": "get_weather", "response": {"city": "Shanghai", "weather": "Cloudy", "temperature": 22}}}
]}
],
"tools": [ …same as step 1… ]
}| Tool | Syntax | What it does |
|---|---|---|
| Google Search | "tools": [{"googleSearch": {}}] | Searches the web before answering. Sources are in groundingMetadata |
| URL context | "tools": [{"urlContext": {}}] | Reads the URLs in the prompt. Results are in urlContextMetadata |
| Code execution | "tools": [{"codeExecution": {}}] | Writes and runs Python code, returning executableCode and codeExecutionResult |
groundingMetadata in the response (excerpt):{
"webSearchQueries": ["2026 Nobel Prize in Physics winner"],
"groundingChunks": [
{ "web": { "uri": "https://vertexaisearch.cloud.google.com/grounding-api-redirect/…", "title": "nobelprize.org" } }
]
}mimeType to application/pdf.