Deep Thinking
Deep thinking models are AI systems with complex reasoning capabilities that solve problems requiring deep cognitive processing through multi-step logical analysis, self-reflection, and chain-of-thought reasoning. This document describes how to call models that support deep thinking, including GLM, Deepseek, and Minimax.
GLM Models - Mixed thinking mode, thinking enabled by default: GLM-5.1, GLM-5, GLM-4.7
MiniMax Models - Thinking mode only: MiniMax-M2.5, MiniMax-M2.1
1. Using Deep Thinking in curl
curl --request POST \
--url https://api.jalapeno-cloud.ai/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. Using Deep Thinking in Python
import requests
url = "https://api.jalapeno-cloud.ai/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. Using Deep Thinking in 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.jalapeno-cloud.ai/v1/chat/completions", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
4. Using Deep Thinking in Golang
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
url := "https://api.jalapeno-cloud.ai/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()
}