Key capabilities
- SSE Streaming — Real-time token-by-token response delivery
- Thinking mode — Supports thinking configuration for enhanced reasoning
- Multi-turn conversations — Handles complex dialogue with system instructions
- Safety settings — Configurable content safety filters
Quick example
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
key | string | Yes | API key (query parameter) |
alt | string | No | Set to sse for SSE streaming |
contents | array | Yes | Array of { role, parts } objects |
systemInstruction | object | No | System instruction with parts array |
generationConfig.temperature | float | No | 0–2. Controls randomness. Default: 1 |
generationConfig.topP | float | No | Nucleus sampling threshold. Default: 1 |
generationConfig.thinkingConfig | object | No | Thinking mode configuration |
safetySettings | array | No | Content safety filter settings |
API Reference
View the interactive API playground for Gemini 2.5 Pro (Stream).