The knobs that change every reply
Six parameters control most of what changes between two otherwise-identical Gemini calls:
temperature(0.0–2.0) — randomness. 0 is near-deterministic; 1.0 is the balanced default; > 1 is creative-but-weird.topP(0.0–1.0) — nucleus sampling. Restrict to tokens making up p of the probability mass.topK(1–100+) — only consider the top-K candidate tokens.maxOutputTokens— hard cap. Hitting it triggersfinishReason: MAX_TOKENS.responseMimeType—text/plainby default; switch toapplication/jsonfor JSON mode.seed— pin the random seed for reproducible runs (best-effort, not a guarantee on Pro).
Thinking config — the new lever
Gemini 2.5 introduced explicit thinkingConfig. The model can spend extra compute thinking before answering, and you pay for those thinking tokens at output rates. Choose the level deliberately:
MINIMAL— no extended thinking. Cheapest, fastest, fine for chat and simple Q&A.LOW— small budget. Useful for moderately tricky reasoning.MEDIUM— default for hard problems.HIGH— long-form reasoning, complex code, multi-step math. Spend this only when you mean to.
Safety settings
Four harm categories with five threshold levels each. Defaults in Gemini 2.5+ are OFF — the model does not block by default; you opt in to filtering.
| Category | What it covers |
|---|---|
HARM_CATEGORY_HARASSMENT | Targeted identity attacks |
HARM_CATEGORY_HATE_SPEECH | Slurs, profanity directed at groups |
HARM_CATEGORY_SEXUALLY_EXPLICIT | Sexual content |
HARM_CATEGORY_DANGEROUS_CONTENT | Instructions for harmful acts |
Thresholds: OFF, BLOCK_NONE, BLOCK_ONLY_HIGH, BLOCK_MEDIUM_AND_ABOVE, BLOCK_LOW_AND_ABOVE. The difference between OFF and BLOCK_NONE: OFF disables the classifier entirely; BLOCK_NONE still classifies but never blocks.