Thingking Config does not works

In your official documentation, it says that we can use thinking config to disable thinking for 2.5 flash models

Gemini thinking  |  Gemini API  |  Google AI for Developers

but when i try to use the parameter it says unknown name

{
"error": {
"code": 400,
"message": "Invalid JSON payload received. Unknown name \"thinkingConfig\" at 'generation_config': Cannot find field.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "generation_config",
"description": "Invalid JSON payload received. Unknown name \"thinkingConfig\" at 'generation_config': Cannot find field."
}
]
}
]
}

Hi @aiassist ,

I’ve tested the functionality from my side, and it appears to be working as expected. Please see the attached screenshot for a visual.

I am calling the API using REST API similar like what you have in documentation, have u try using REST API?

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H 'Content-Type: application/json' \
-X POST \
-d '{
  "contents": [
    {
      "parts": [
        {
          "text": "Provide a list of 3 famous physicists and their key contributions"
        }
      ]
    }
  ],
  "generationConfig": {
    "thinkingConfig": {
        #  "thinkingBudget": 1024
          # Thinking off:
          "thinkingBudget": 0
          # Turn on dynamic thinking:
          # "thinkingBudget": -1
    }
  }
}'

Hi @aiassist ,

Could you please remove the commented lines and try running, please find below the same code and let us know if still the issue persist?

Thank you!