Reasoning
Turn thinking on or off, set the effort, and handle reasoning output on each protocol.
Every XField model can think before it answers. Thinking makes answers better on hard problems such as exploit analysis, multi-step planning, and debugging, and costs output tokens and time on easy ones. You control it per request with the parameters your protocol already uses.
Controls per protocol
| Protocol | Turn on and set effort | Turn off | Where reasoning appears |
|---|---|---|---|
| Chat Completions | reasoning_effort: "high" or reasoning: { enabled: true, effort: "high" } | reasoning_effort: "none" or reasoning: { enabled: false } | message.reasoning, or delta.reasoning when streaming |
| Responses | reasoning: { effort: "high" } | reasoning: { effort: "none" } | reasoning items in output |
| Messages | thinking: { type: "enabled" } or "adaptive", plus output_config: { effort: "high" } | thinking: { type: "disabled" } | thinking content blocks |
Accepted effort words are none, minimal, low, medium, high, xhigh, and max. Each model maps them to the levels it actually has, rounding to the nearest one. Asking for any effort other than none keeps thinking on.
response = client.chat.completions.create(
model="glm-5.3-uncensored",
messages=[{"role": "user", "content": "Walk through how this SQL injection payload bypasses the filter."}],
reasoning_effort="max",
)
print(response.choices[0].message.reasoning) # the thinking
print(response.choices[0].message.content) # the answerPer-model defaults
| Model | Default | Levels |
|---|---|---|
deepseek-v4.1-flash-1017-uncensored | On, at high | low, high, xhigh, max |
kimi-k3.1-pro-uncensored | On, at high | low, high, max |
glm-5.3-uncensored | On, at high | low, high, max |
glm-5.3-flash-uncensored | On, at high | low, high, max |
qwen-3.8-27b-uncensored | Off | On or off only |
Qwen 3.8 27B has a switch, not levels. Any effort other than none turns thinking on; the exact level makes no difference. GET /api/v1/models reports the same information in each model's reasoning block, so tools can discover it.
For coding agents, DeepSeek V4.1 Flash at the default high is a good balance. Drop to low for quick edits, and save max for problems where a wrong answer costs more than the wait.
Hiding reasoning
If you want the benefit of thinking without receiving the text, set reasoning: { exclude: true } on Chat Completions. The model still thinks, but reasoning is left out of the response and the stream. Reasoning tokens still count toward usage.
To skip thinking altogether, turn it off with none or disabled. That is faster and cheaper, and fine for chat, extraction, and labeling.
Preserving reasoning across tool turns
In an agent loop, the model often thinks, calls a tool, and then continues. It does better when it can see its earlier thinking. Send the assistant turn back exactly as you received it:
- Chat Completions: keep the assistant message with its
reasoningandtool_callsfields, then append yourtoolmessages. - Responses: pass the
reasoningitems fromoutputback in the nextinput, alongside the function call and its output. - Messages: keep the
thinkingblocks in the assistant content, unmodified and in order, ahead of thetool_useblocks.
Most SDK helpers and coding agents already do this. If you build history by hand, do not strip reasoning out of the turn that made the tool call. You can drop it from older, finished turns to save context.
A note on budget_tokens
On Messages, thinking.budget_tokens is accepted so that existing Anthropic code keeps working, but it is not enforced as a separate budget. It simply turns thinking on. Use output_config.effort to control how much the model thinks, and max_tokens to cap the whole response.
On Chat Completions, reasoning.max_tokens is rejected with a 400 for the same reason. Use an effort level instead.