BUG REPORT - Discrepancy in thinkingLevel Parameter Case Sensitivity: Google AI Studio vs. Production API

Issue Summary

There is a significant discrepancy in how the Gemini API’s thinkingLevel parameter for Gemini 3 series models handles text case sensitivity between the Google AI Studio testing interface and the Gemini API production endpoints (including Cloud Run deployment).

In Google AI Studio, using developer-documented lowercase values (e.g., "low") often triggers a “400 - invalid argument” validation error, while uppercase values (e.g., "LOW") are accepted. Conversely, when the same application is deployed to production (e.g., via Google Cloud Run), the API behaves as documented, accepting both lowercase (and uppercase) values without error.

Detailed Observations

  • Environment A: Google AI Studio

    • Behavior: Passing e.g. "low", "medium", or "high" into the thinkingLevel field throws a validation error: Invalid value for thinkingLevel.

    • Workaround: Changing the string to uppercase ("LOW", "HIGH") resolves the error in this environment.

  • Environment B: Production API / Cloud Run Deployment

    • Behavior: The application accepts the standard lowercase strings "minimal", "low", "medium", and "high" as valid inputs.

    • Result: No errors are thrown, and the model correctly adjusts its internal reasoning depth.

Root Cause Hypothesis (TBC)

The issue likely stems from a mismatch between the client-side validation layer in AI Studio/SDKs and the server-side API logic:

  • SDK Enums: Internal SDK definitions frequently define valid configuration keys in UPPERCASE (e.g., THINKING_LEVEL_LOW). The AI Studio UI or SDK validation logic may be strictly enforcing these Enum names rather than the underlying string values?

Steps to Reproduce

  1. Open Google AI Studio.

  2. Select a Gemini 3 model (e.g., gemini-3-flash-preview).

  3. In your app code, set the thinkingLevel parameter to "low" for example.

  4. Call the Gemini API. Observe the validation error.

  5. Change the value to "LOW" and observe that the error disappears.

  6. Deploy the app to Cloud Run using the lowercase "low" and observe that it works perfectly.

Desired Resolution

  • Update Google AI Studio and associated client SDKs to ensure they accept lowercase string values for thinkingLevel, aligning them with the official REST API documentation and production behavior.

  • Ensure consistency across platforms (AI Studio, Vertex AI, and Gemini API) to prevent developer confusion when moving from prototype to production.