# DeepSeek Model Thinking Enable/Disable Guide

## Overview

The `thinking` parameter is used to control whether the model displays its reasoning process before generating a response. This feature is suitable for scenarios where observing the model's reasoning is required.

---

## DeepSeek V3.1 Thinking Configuration

### Parameter Description

The `thinking` parameter is a structured object used to configure the model's thinking behavior.

**Object Structure:**

| Field            | Type   | Required | Description                                      |
| :--------------- | :----- | :------- | :----------------------------------------------- |
| `thinking.type`  | String | Yes      | Controls whether to display the thinking process |

**Available values for `type`:**

- `enabled`: Force enable the thinking process  
- `disabled`: Force disable the thinking process  

JSON Example
```json
{
    "model": "deepseek-ai/DeepSeek-V3.1-Terminus",
    ...
    "thinking": {
        "type": "enabled"s
    }
}
```

Model support
- deepseek-ai/DeepSeek-V3.1
- deepseek-ai/DeepSeek-V3.1-Terminus

### API Example

```python
import json
import requests

# Configure API key
api_key = "******"  # Replace with your API key
url = "https://api-us-ca.umodelverse.ai/v1/chat/completions"

headers = {"Authorization": f"Bearer {api_key}", "Content-Type": "application/json"}
data = {
    "model": "deepseek-ai/DeepSeek-V3.1-Terminus",  # Specify model
    "messages": [
        {
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": "Which is larger, 9.9 or 9.11?",  # User query
                }
            ],
        }
    ],
    "thinking": {"type": "enabled"},  # Enable thinking feature, optional: enabled / disabled / auto
}

try:
    response = requests.post(url, headers=headers, json=data)
    response.raise_for_status() 

    print("Request successful!")
    print(json.dumps(response.json(), indent=2, ensure_ascii=False))

except requests.exceptions.RequestException as e:
    print(f"Request failed: {e}")

```

## DeepSeek V3.2 Thinking Feature Configuration

### Parameter Description

The `chat_template_kwargs` parameter is a structure used to configure the model's thinking process.

**Object Structure:**

| Field                          | Type    | Required | Description                                      |
| :----------------------------- | :------ | :------- | :----------------------------------------------- |
| `chat_template_kwargs.thinking` | Boolean | Yes      | Controls whether to display the thinking process |

**Possible values for `chat_template_kwargs`:**

- `true`: Force enable the thinking process.
- `false`: Force disable the thinking process.

JSON example
```json
{
    "model": "deepseek-ai/DeepSeek-V3.2",
    ...
    "chat_template_kwargs": {
        "thinking": true
    }
}
```

Model support
- deepseek-ai/DeepSeek-V3.2

### API Example
```python
import json
import requests


# Configure API key
api_key = "******"  # Replace with your API key
url = "https://api-us-ca.umodelverse.ai/v1/chat/completions"

headers = {"Authorization": f"Bearer {api_key}", "Content-Type": "application/json"}
data = {
    "model": "deepseek-ai/DeepSeek-V3.2",  # Specify model
    "messages": [
        {
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": "Which is larger, 9.9 or 9.11",  # User query
                }
            ],
        }
    ],
    "chat_template_kwargs": {
        "thinking": true
    }
}

try:
    response = requests.post(url, headers=headers, json=data)
    response.raise_for_status()

    print("Request successful!")
    print(json.dumps(response.json(), indent=2, ensure_ascii=False))

except requests.exceptions.RequestException as e:
    print(f"Request failed: {e}")

```

