Deep Thinking
Deep thinking models bring complex reasoning to demanding problems: they split a task into multiple logical steps, examine their own intermediate results, and reason through an explicit chain of thought. This guide walks through calling the models that support deep thinking, such as GLM, DeepSeek, and MiniMax.
Before picking a model, note how each family handles reasoning:
GLM series — these run a hybrid (mixed) thinking mode with reasoning enabled out of the box: GLM-5.1, GLM-5, GLM-4.7
MiniMax series — these are offered exclusively in thinking mode: MiniMax-M2.5, MiniMax-M2.1
1. Deep thinking via cURL
curl --request POST \
--url https://api.watt-cloud.com/v1/chat/completions \
--header 'Authorization: Bearer ${API_KEY}' \
--header 'Content-Type: application/json' \
--data '{
"model": "${MODEL_NAME}",
"messages": [{
"role": "user",
"content": "Who are you"
}],
"stream": true,
"stream_options":{"include_usage": true},
"chat_template_kwargs": {"thinking": true}
}'
2. Deep thinking via Python
import requests
url = "https://api.watt-cloud.com/v1/chat/completions"
payload = {
"model": "${MODEL_NAME}",
"messages": [
{
"role": "user",
"content": "Please give a travel plan"
}
],
"stream": True,
"stream_options":{"include_usage": True},
"chat_template_kwargs": {"thinking": True}
}
headers = {
"Authorization": "Bearer ${API_KEY}",
"Content-Type": "application/json"
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.text)
3. Deep thinking via JavaScript
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer ${API_KEY}");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"messages": [
{
"role": "user",
"content": "Please give a travel plan"
}
],
"model": "${MODEL_NAME}",
"stream": true,
"chat_template_kwargs": {"thinking": true}
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.watt-cloud.com/v1/chat/completions", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
4. Deep thinking via Golang
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
url := "https://api.watt-cloud.com/v1/chat/completions"
payload := map[string]interface{} {
"model": "${MODEL_NAME}",
"messages": []map[string]string{
{"role": "user", "content": "Please give a travel plan"},
},
"stream": true,
"chat_template_kwargs": {"thinking": true}
}
body, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer ${API_KEY}")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}