# Gemini thinking settings: thinkingLevel, thinkingBudget and reasoning_effort Source: https://ofox.ai/docs/develop/models/gemini/thinking This page covers Gemini's thinking defaults and how to adjust them. For model IDs and endpoints, see the [Gemini family overview](https://ofox.ai/docs/develop/models/gemini). **Key point**:Except for Flash-Lite, Gemini models think by default, and complex questions can take more than a minute. Reduce thinking when speed matters. Gemini models think before answering. Thinking tokens count as output and are billed at the output rate; the count is in `usageMetadata.thoughtsTokenCount` (`usage.completion_tokens_details.reasoning_tokens` on the OpenAI-compatible API). | Model | Default | How to adjust | |---|---|---| | Gemini 3.x (except Flash-Lite) | Thinking on | `thinkingLevel`, e.g. `"low"`; `thinkingBudget` (a cap on thinking tokens) is also accepted | | Flash-Lite series (3.5, 3.1) | No thinking | Enabled by passing `thinkingLevel` or `thinkingBudget` | In our tests on the same math problem, `thinkingLevel: "low"` cut Gemini 3.5 Flash's thinking tokens from about 6000 to about 4600, with a corresponding drop in latency. `thinkingBudget: 0` turns off thinking on 3.5 Flash and 3 Flash Preview; 3.1 Pro Preview and 3.8 Flash still think when it is passed and cannot turn thinking off completely. **Python (google-genai)** ```python filename="gemini_thinking.py" import os from google import genai from google.genai import types client = genai.Client( api_key=os.environ["OFOX_API_KEY"], http_options={"api_version": "v1beta", "base_url": "https://api.ofox.ai/gemini"}, ) resp = client.models.generate_content( model="google/gemini-3.8-flash", contents="Find all positive integers n less than 50 for which n² + n + 41 is not prime.", config=types.GenerateContentConfig( thinking_config=types.ThinkingConfig(thinking_level="low"), ), ) print(resp.text) print("Thinking tokens:", resp.usage_metadata.thoughts_token_count or 0) ``` **cURL** ```bash filename="Terminal" curl "https://api.ofox.ai/gemini/v1beta/models/google/gemini-3.8-flash:generateContent" \ -H "x-goog-api-key: $OFOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "contents": [{"parts": [{"text": "Find all positive integers n less than 50 for which n² + n + 41 is not prime."}]}], "generationConfig": { "thinkingConfig": {"thinkingLevel": "low"} } }' ``` **Python (OpenAI SDK)** ```python filename="gemini_thinking_openai.py" import os from openai import OpenAI client = OpenAI(base_url="https://api.ofox.ai/v1", api_key=os.environ["OFOX_API_KEY"]) resp = client.chat.completions.create( model="google/gemini-3.8-flash", reasoning_effort="low", messages=[{"role": "user", "content": "Find all positive integers n less than 50 for which n² + n + 41 is not prime."}], ) print(resp.choices[0].message.content) details = resp.usage.completion_tokens_details print("Thinking tokens:", details.reasoning_tokens if details else 0) ``` - With `thinkingLevel: "low"`, the model may skip thinking on simple questions, in which case `thoughtsTokenCount` does not appear. - To see the thinking process, add `"includeThoughts": true` to `thinkingConfig`. Items in `parts` with `"thought": true` are thought summaries; the rest is the answer. - Thinking tokens count toward `maxOutputTokens`. If the limit is too low, the answer is cut off midway — see [Common errors](https://ofox.ai/docs/develop/models/gemini#errors). - `thinkingConfig` goes inside `generationConfig`.