Thinking Mode 111

TODO: main_point is empty for this article.

TODO: Cover image

DeepSeek models support a thinking mode: before outputting the final answer, the model first outputs a chain-of-thought content to improve the accuracy of the final answer.

Thinking Mode Switch and Thinking Effort Control

Control Parameter (OpenAI Format) Control Parameter (Anthropic Format) Thinking Mode Switch (1) {"thinking": {"type": "enabled/disabled"}} Thinking Effort Control (2)(3) {"reasoning_effort": "high/max"} {"output_config": {"effort": "high/max"}} (1) The default thinking switch is enabled (2) In thinking mode, for general requests, the default effort is high; for some complex Agent-type requests (such as Claude Code, OpenCode), the effort is automatically set to max (3) In thinking mode, for compatibility reasons, low and medium are mapped to high, and xhigh is mapped to max

When using the OpenAI SDK to set the thinking parameter, you need to pass the thinking parameter into extra_body:

response = client.chat.completions.create(
  model="deepseek-v4-pro",
  reasoning_effort="high",
  extra_body={"thinking": {"type": "enabled"}}
)

{{ASIN:1234567890}}

{{ASIN:0987654321}}

Input and Output Parameters

Thinking mode does not support the temperature, top_p, presence_penalty, and frequency_penalty parameters. Note that for compatibility with existing software, setting these parameters will not cause errors, but they will not take effect.

In thinking mode, the chain-of-thought content is returned via the reasoning_content parameter, at the same level as content. In subsequent turns of concatenation, you can optionally return reasoning_content to the API:

Between two user messages, if the model has not made any tool calls, the assistant's reasoning_content in between does not need to be included in the context concatenation, and passing it to the API in subsequent rounds will be ignored. See Multi-turn Dialogue Concatenation for details. Between two user messages, if the model has made tool calls, the assistant's reasoning_content must be included in the context concatenation and must be passed back to the API in all subsequent user interaction rounds. See Tool Calling for details.