Skip to main content
GLM-5.2 is a controllable reasoning model. You can control its reasoning with the following parameters: If you don’t set a parameter, the model uses its default. You can edit a parameter to control how the model reasons.

Control Reasoning

To learn how to control the model’s reasoning, see the following sections:

Turn Reasoning On

The enable_thinking parameter controls whether the model reasons before it generates a response. By default, reasoning’s on.For complex tasks, where response quality matters, leave reasoning on. For simpler tasks, you can try turning it off, save tokens, and reduce the response time.You can turn reasoning on or off by setting enable_thinking to true or false, respectively. For example, to turn reasoning off, use the following code:

Include Reasoning

The include_reasoning parameter controls whether reasoning’s included in the response. By default, reasoning’s included.If you need reasoning content (for example, to display to users), include it in the response. If you don’t, exclude it. Note that your choice doesn’t change the number of tokens used to generate a response. It’s the same, whether or not you include reasoning.You can include or exclude reasoning by setting include_reasoning to true or false, respectively. For example, to exclude reasoning, use the following code:

Parse Reasoning

The parse_reasoning parameter controls whether reasoning’s parsed in the response. By default, reasoning’s parsed.If you want to turn parsing off (for example, you use your own parser), you can turn it off. Otherwise, reasoning’s parsed into reasoning and reasoning_content, separate from content.You can parse reasoning or turn it off by setting parse_reasoning to true or false, respectively. For example, to turn parsing off, use the following code:

Set the Reasoning Effort

The reasoning_effort parameter controls the model’s reasoning effort for each response. By default, reasoning’s set to max.When you set a greater reasoning effort (max > high), the model generates longer chains of thought. That thinking improves response quality on complex tasks. Note that it also increases completion tokens and response times.You can set the effort by setting reasoning_effort to high or max. For example, to set it to high, use the following code:

Set a Reasoning Budget

The reasoning_budget parameter sets a reasoning budget for each response. By default, there’s no budget.When you set a reasoning budget, you set the maximum number of reasoning tokens the model can use to generate a response. When the model reaches the budget, it’ll stop thinking, sometimes mid-thought. For that reason, choose your budget amount carefully.You can set a budget by setting reasoning_budget to an integer. For example, to set it to 1,000 tokens, use the following code:

Clear Reasoning

The clear_thinking parameter controls whether reasoning’s cleared after each response. By default, reasoning’s cleared.If reasoning matters to your workflow or use case, you can preserve it and add it to the model’s context window. Note that preserving reasoning increases token usage.You can clear or preserve reasoning by setting clear_thinking to true or false, respectively. For example, to preserve it, use the following code:
To learn more, see Reasoning.
Last modified on July 19, 2026