# Set budget on thinking models

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1beta/models/gemini-2.5-flash-preview-04-17:generateContent:
    post:
      summary: Set budget on thinking models
      deprecated: false
      description: >-
        The `thinkingBudget` parameter gives the model guidance on the number of
        thinking tokens it can use when generating a response. A greater number
        of tokens is typically associated with more detailed thinking, which is
        needed for solving more complex tasks. `thinkingBudget` must be an
        integer in the range 0 to 24576. Setting the thinking budget to 0
        disables thinking.


        Depending on the prompt, the model might overflow or underflow the token
        budget.
      tags:
        - Model Capabilities/Gemini thinking
      parameters: []
      requestBody:
        content:
          text/plain:
            schema:
              type: string
            example: |-
              {
                "contents": [
                  {
                    "parts": [
                      {
                        "text": "Explain the Occam\s
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
                x-apidog-orders: []
          headers: {}
          x-apidog-name: 成功
      security:
        - apikey-header-x-goog-api-key: []
      x-apidog-folder: Model Capabilities/Gemini thinking
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/892755/apis/api-16240710-run
components:
  schemas: {}
  securitySchemes:
    apikey-header-x-goog-api-key:
      type: apiKey
      in: header
      name: x-goog-api-key
servers:
  - url: https://generativelanguage.googleapis.com
    description: Prod Env
security:
  - apikey-header-x-goog-api-key: []

```
