gemini-3.8-flash with POST /v1beta/models/gemini-3.8-flash:generateContent.
Model specifications
Choose a workflow
- Text and thinking
- Multimodal understanding
- Structured output
- Function calling
- Built-in tools
Send text in
contents[].parts[].text. Use generationConfig.thinkingConfig.thinkingLevel to trade latency for reasoning depth.The final conversation turn must be a non-empty
user turn. Do not prefill a response by ending the request with a model turn.Request examples
- Text and thinking
- Multimodal understanding
- Structured output
- Function calling
- Built-in tools
cURL
Generation controls
Conversation and response handling
- Use
userandmodelroles for conversation history. - Preserve complete model turns and every
thoughtSignaturein multi-step function workflows. - Check
candidates[].finishReasonbefore consuming the output. - Read token counts from
usageMetadata, includingthoughtsTokenCountfor reasoning usage. - Search and Maps responses can include
groundingMetadatawith queries, sources, and supporting segments. - Code execution can return
executableCodeandcodeExecutionResultparts.
API Reference
View request fields, capability examples, and response schemas for Gemini 3.8 Flash.