Skip to content

Reasoning

Control how long reasoning models think, turn thinking off, and read reasoning output.

This page explains how to control the reasoning effort of models that think before they answer, and where the reasoning appears in the response. It is intended for developers who want to balance answer quality, latency, and cost.

Set the reasoning effort

On /v1/chat/completions, set reasoning_effort to one of the effort levels:

curl https://api.engy.ai/v1/chat/completions \
  -H "Authorization: Bearer $ENGY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "glm-5.2",
    "reasoning_effort": "high",
    "messages": [{"role": "user", "content": "Prove that the square root of 2 is irrational."}]
  }'

The reasoning object is an equivalent form: "reasoning": {"effort": "high"}.

Effort levels

The accepted levels, from lowest to highest, are none, minimal, low, medium, high, xhigh, and max. The values are not case-sensitive. Both none and minimal turn thinking off.

A value outside this list is passed to the model unchanged. Depending on the model, the request then fails with HTTP status 400, or the value is ignored.

How each model interprets the effort level

Each model supports its own set of reasoning levels. Engy translates your level into the closest level that the model supports:

You sendglm-5.2glm-5.3, glm-5.3-flashqwen3.8-27bkimi-k3, deepseek-v4-flash-0731deepseek-v4.1-flash
lowhighlowlowlowlow
mediumhighlowmediumlowhigh
highhighhighxhighhighhigh
xhighmaxmaxxhighmaxxhigh
maxmaxmaxxhighmaxmax

Note the following:

  • For glm-5.2, low, medium, and high select the same level. Below xhigh, there are only two distinct settings.
  • For qwen3.8-27b, the highest level is xhigh, which is also its default. The level max has no additional effect.
  • Models that are not listed, such as qwen3.6-35b-a3b, follow the glm-5.2 column.

Turn thinking off

To turn thinking off, use one of the following forms:

  • "reasoning_effort": "none"
  • "reasoning_effort": "minimal"
  • "reasoning": {"enabled": false}

Engy sets the model's own switch for thinking. If your client does not forward reasoning_effort for models that it does not recognize, set the switch directly in chat_template_kwargs:

response = client.chat.completions.create(
    model="glm-5.2",
    messages=[{"role": "user", "content": "Hello"}],
    extra_body={"chat_template_kwargs": {"enable_thinking": False}},
)

For kimi-k3 and deepseek-v4.1-flash, the switch is named thinking. Engy also accepts enable_thinking for these models and renames it. If you set the switch in chat_template_kwargs, your value takes precedence over reasoning_effort.

glm-5.3 and glm-5.3-flash cannot turn thinking off. When you request no thinking, Engy runs them at the low level. Leave room for reasoning tokens in max_tokens.

Read the reasoning output

On /v1/chat/completions, the reasoning appears separately from the answer:

LocationField
Non-streaming responsechoices[0].message.reasoning_content
Streaming responsechoices[0].delta.reasoning_content
Usageusage.completion_tokens_details.reasoning_tokens

Reasoning tokens are billed as output tokens.

Reasoning on other endpoints

EndpointControlOutput
/v1/messages"thinking": {"type": "enabled"} or "thinking": {"type": "disabled"}. The budget_tokens value is ignored, and the model thinks at its default level.thinking blocks in streaming responses only
/v1/responsesNot supported. The reasoning object has no effect.Not returned

On /v1/messages, a disabled thinking setting follows the same rules as on /v1/chat/completions, including the exception for glm-5.3 and glm-5.3-flash.

Continue a partial answer

If the last message in the request has the assistant role, the model continues that message instead of starting a new one. Thinking is turned off for these requests.