Submit a toolSubmit

Gemini returns 400 on thinking_budget. Switch to thinking_level

HTTP 400 INVALID_ARGUMENT means thinking_budget was sent on Gemini 4, or both thinking fields were sent. Drop thinking_budget and set only thinking_level. Short answer: 5 steps. 1) Read the 400 as a thinking-config mismatch; 2) Remove thinking_budget from the request; 3) Pick a level the model actually supports; 4) Keep Gemini 2.5 on thinking_budget only; 5) Retest with a one-line prompt.

Last updated: · This page is the decision checklist; the tools list for “Fix Gemini 400 thinking_budget / thinking_level conflict” is a separate URL.

The problem: HTTP 400 INVALID_ARGUMENT means thinking_budget was sent on Gemini 4, or both thinking fields were sent. Drop thinking_budget and set only thinking_level.

How do I switch to thinking_level when Gemini returns 400 on thinking_budget?

  1. Read the 400 as a thinking-config mismatch

    On Vertex AI / Gemini Enterprise Agent Platform docs, `thinking_budget` is deprecated for Gemini 3+, returns 400 INVALID_ARGUMENT on Gemini 4, and can fail intermittently on Gemini 3. Specifying both `thinking_level` and `thinking_budget` in the same request also errors. Docs: https://docs.cloud.google.com/vertex-ai/generative-ai/docs/thinking

  2. Remove thinking_budget from the request

    Delete `thinkingBudget` / `thinking_budget` from `thinkingConfig` / `ThinkingConfig`. Keep a single control: `thinking_level` (or `thinkingLevel`) for Gemini 3 and later. Gemini API Gemini 3 guidance: migrate to `thinking_level` and don’t send both in one request — https://ai.google.dev/gemini-api/docs/gemini-3

  3. Pick a level the model actually supports

    Use the model’s supported set from the thinking guide (for example Gemini 4 Neon/Hydrogen: low, medium, high, xhigh; some Gemini 3 Flash variants also allow minimal; Gemini 3 Pro preview historically used low/high). Sending `minimal` on a Gemini 4 model, or `thinking_level` on Gemini 2.5, will fail—match the table for your model id. Levels: https://ai.google.dev/gemini-api/docs/thinking

  4. Keep Gemini 2.5 on thinking_budget only

    For Gemini 2.5 and earlier, configure `thinking_budget` and do not send `thinking_level` (that combination errors the other way). Only after you upgrade the model id to Gemini 3/4 should you switch the field names.

  5. Retest with a one-line prompt

    Call the same model with a tiny prompt and only `thinking_level` set. If it succeeds, restore your real prompt. If you still see 400, check for unsupported level values, leftover `thinking_budget` in a shared client default, or a proxy that injects both fields.

Which tools are best to fix Gemini 400 thinking_budget / thinking_level conflict?

Vertex AI thinking guide

Documents 400 INVALID_ARGUMENT for thinking_budget on Gemini 4 and for sending both thinking fields.

Gemini 3 developer guide

Migrate from thinking_budget to thinking_level; don’t send both in one request.

Gemini thinking levels

Supported thinking_level values per model family.

Google AI Studio

Quickly verify a model accepts your thinking_level before shipping client code.

All tools for “Fix Gemini 400 thinking_budget / thinking_level conflict” →

Related fixes

See also AI tools launched today on the daily board.