# Reasoning

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/chat/completions:
    post:
      summary: Reasoning
      deprecated: false
      description: >-
        Grok 3 Mini is a lightweight, smaller thinking model. Unlike traditional
        models that generate answers immediately, Grok 3 Mini thinks before
        responding. It’s ideal for reasoning-heavy tasks that don’t demand
        extensive domain knowledge, and shines in math-specific and quantitative
        use cases, such as solving challenging puzzles or math problems.


        Reasoning is only supported by `grok-3-mini-beta` and
        `grok-3-mini-fast-beta`.

        The Grok 3 models `grok-3-beta` and `grok-3-fast-beta` do not support
        reasoning.


        ## [Key Features](https://docs.x.ai/docs/guides/reasoning#key-features)


        - **Think Before Responding**: Thinks through problems step-by-step
        before delivering an answer.

        - **Math & Quantitative Strength**: Excels at numerical challenges and
        logic puzzles.

        - **Reasoning Trace**: The model's thoughts are available via the
        `reasoning_content` field in the response completion object (see example
        below).


        You can access the model's raw thinking trace via the
        `message.reasoning_content` of the chat completion response.


        ## [Control how hard the model
        thinks](https://docs.x.ai/docs/guides/reasoning#control-how-hard-the-model-thinks)


        The `reasoning_effort` parameter controls how much time the model spends
        thinking before responding. It must be set to one of these values:


        - **`low`**: Minimal thinking time, using fewer tokens for quick
        responses.

        - **`high`**: Maximum thinking time, leveraging more tokens for complex
        problems.


        Choosing the right level depends on your task: use `low` for simple
        queries that should complete quickly, and `high` for harder problems
        where response latency is less important.


        ## [Usage
        Example](https://docs.x.ai/docs/guides/reasoning#usage-example)


        Here’s a simple example using Grok 3 Mini to multiply 101 by 3. Notice
        that we can access both the reasoning content and final response.


        ```bash

        curl https://api.x.ai/v1/chat/completions \
            -H "Content-Type: application/json" \
            -H "Authorization: Bearer $XAI_API_KEY" \
            -d '{
                "messages": [
                    {
                    "role": "system",
                    "content": "You are a highly intelligent AI assistant."
                    },
                    {
                    "role": "user",
                    "content": "What is 101*3?"
                    }
                ],
                "model": "grok-3-mini-latest",
                "stream": false,
                "temperature": 0.7,
                "reasoning_effort":"high"
            }'
        ```


        ### [Sample
        Output](https://docs.x.ai/docs/guides/reasoning#sample-output)


        ```outputReasoning Content:

        Let me calculate 101 multiplied by 3:

        101 * 3 = 303.

        I can double-check that: 100 * 3 is 300, and 1 * 3 is 3, so 300 + 3 =
        303. Yes, that's correct.


        Final Response:

        The result of 101 multiplied by 3 is 303.


        Number of completion tokens (input):

        14


        Number of reasoning tokens (input):

        310

        ```


        ## [When to Use
        Reasoning](https://docs.x.ai/docs/guides/reasoning#when-to-use-reasoning)


        - **Use `grok-3-mini-beta` or `grok-3-mini-fast-beta`**: For tasks that
        can benefit from logical reasoning (such as meeting scheduling or math
        problems). Also great for tasks that don't require deep domain knowledge
        about a specific subject (eg basic customer support bot).

        - **Use `grok-3-beta` or `grok-3-fast-beta`**: For queries requiring
        deep domain expertise or world knowledge (eg healthcare, legal,
        finance).
      tags:
        - Guides
      parameters:
        - name: Content-Type
          in: header
          description: ''
          required: true
          example: application/json
          schema:
            type: string
        - name: Authorization
          in: header
          description: ''
          required: true
          example: Bearer {{XAI_API_KEY}}
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                messages:
                  type: array
                  items:
                    type: object
                    properties:
                      role:
                        type: string
                      content:
                        type: string
                    required:
                      - role
                      - content
                model:
                  type: string
                stream:
                  type: boolean
                temperature:
                  type: number
                reasoning_effort:
                  type: string
              required:
                - messages
                - model
                - stream
                - temperature
                - reasoning_effort
            example:
              messages:
                - role: system
                  content: You are a highly intelligent AI assistant.
                - role: user
                  content: What is 101*3?
              model: grok-3-mini-latest
              stream: false
              temperature: 0.7
              reasoning_effort: high
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
                x-apidog-orders: []
          headers: {}
          x-apidog-name: Success
      security: []
      x-apidog-folder: Guides
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/875787/apis/api-15799160-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api.x.ai/v1/
    description: Prod Env
security: []

```
