generateContent API.
Key capabilities
- 1M token context - Up to 1,048,576 input tokens and 65,536 output tokens
- Multimodal input - Text, image, video, audio, and PDF input; text output
- Agentic execution - Fewer reasoning steps, turns, and tool calls for multi-step workflows
- Coding - Improved production code generation, instruction following, and diagnostic behavior
- Spatial reasoning - Improved chart interpretation, visual blueprint conversion, and complex layout reasoning
- Tools - Function calling, code execution, File Search, Google Search, Google Maps, URL context, structured output, and Computer Use (Preview)
- Thinking -
mediumby default; usehighfor deeper reasoning
Quick example
API changes
Requests must not end with a non-emptymodel role turn. End the conversation with a non-empty user turn; otherwise the API returns HTTP 400.
Parameters
API Reference
View the interactive API reference for Gemini 3.6 Flash.