Z.AI Thinking Control
Z.AI GLM models can generate an internal reasoning chain (reasoning_content) before producing a response.
This improves answer quality, but reasoning tokens are billed as output, consume the shared max_tokens
budget, and increase latency.
Thinking is OFF by default (opt-in) on thinking-capable GLM models other than GLM-5.3 and GLM-5.3-Flash. A plain request to those models spends no reasoning tokens. Thinking only runs when you explicitly ask for it:
- Model slug suffix —
zai/glm-5.1:think(enable) /zai/glm-5.1:fast(disable) - Body field —
{ "reasoning": true }(enable) /{ "reasoning": false }(disable)
For models other than those two exceptions, the gateway forwards thinking: { "type": "disabled" }
when neither suffix nor body is given.
Which models support thinking control?
Section titled “Which models support thinking control?”| Model | LLMTR default | Explicitly enableable? |
|---|---|---|
| GLM-5.3-Flash | Always on, at low | Cannot be disabled; pick a level |
| GLM-5.3 | Always on, at low | Cannot be disabled; pick a level |
| GLM-5.2 | Off (opt-in) | Yes, via reasoning_effort |
| GLM-5.1, GLM-5, GLM-5-Turbo | Off (opt-in) | Yes |
| GLM-5V-Turbo | Off (opt-in) | Yes |
| GLM-4.7, GLM-4.7-FlashX | Off (opt-in) | Yes |
| GLM-4.6, GLM-4.6V, GLM-4.6V-FlashX | Off (opt-in) | Yes |
| GLM-4.5, GLM-4.5-X, GLM-4.5-Air, GLM-4.5-AirX, GLM-4.5V | Off (opt-in) | Yes |
| GLM-OCR, GLM-4-32B-0414-128K | — | No |
Behaviour is identical across every thinking-capable GLM model except GLM-5.3 and GLM-5.3-Flash: the model produces a
reasoning chain when :think or reasoning: true is sent, and answers directly otherwise.
GLM-5.3 family: reasoning is always on
Section titled “GLM-5.3 family: reasoning is always on”Reasoning cannot be switched off on GLM-5.3 or GLM-5.3-Flash. Any request that tries to disable it is refused with a 400. LLMTR stops such a request before it reaches the provider and names the levels you can choose instead.
| Request | Result |
|---|---|
zai/glm-5.3 (plain) | Works. LLMTR sends the low level. |
zai/glm-5.3:low, :high, :max | Works. The chosen level is sent. |
zai/glm-5.3:think | Works. Reasoning is already on, so the level stays low. |
zai/glm-5.3:fast | 400 — reasoning cannot be disabled. |
"reasoning": false | 400 — reasoning cannot be disabled. |
"thinking": { "type": "disabled" } | 400 — reasoning cannot be disabled. |
:none, :minimal, :medium, :xhigh | 400 — this model accepts only low, high, max. |
The table applies to zai/glm-5.3-flash as well. The Flash model also accepts image input; see
GLM-5.3-Flash for examples and its time-windowed pricing.
Why does LLMTR default to low? The model's own default is max, the deepest and most expensive
level. Even a short prompt then produces dozens of reasoning tokens, and those are billed as output.
Sending plain requests at low keeps simple calls cheap and leaves the decision to raise the level
with you.
curl https://llmtr.com/v1/chat/completions -H "Authorization: Bearer llmtr-your_key" -H "Content-Type: application/json" -d '{ "model": "zai/glm-5.3:max", "messages": [ {"role": "user", "content": "Find and fix the race condition in this service"} ], "max_tokens": 8000 }'You can also pass the level in the body. When suffix and body are both present, the body wins.
from openai import OpenAI
client = OpenAI(base_url="https://llmtr.com/v1", api_key="llmtr-your_key")
response = client.chat.completions.create( model="zai/glm-5.3", messages=[{"role": "user", "content": "Optimize this function"}], reasoning_effort="high", max_tokens=8000,)print(response.choices[0].message.content)Migrating from GLM-5.2: replace calls that used :fast or reasoning: false with plain
zai/glm-5.3. The low default LLMTR applies is the level Z.AI itself recommends for that
migration. GLM-5.3 accepts text input only; requests carrying an image return 400.
Disabling thinking via slug suffix
Section titled “Disabling thinking via slug suffix”The :fast suffix disables thinking. Use it for latency-sensitive requests or when max_tokens is constrained.
curl https://llmtr.com/v1/chat/completions \ -H "Authorization: Bearer llmtr-your_key" \ -H "Content-Type: application/json" \ -d '{ "model": "zai/glm-5.1:fast", "messages": [ {"role": "user", "content": "Hello"} ] }'The :think suffix explicitly enables thinking (required for deep analysis, since the default is off):
"model": "zai/glm-4.5-air:think"Controlling via body field
Section titled “Controlling via body field”reasoning: false disables thinking, reasoning: true enables it.
When both suffix and body field are provided, the body field takes precedence.
curl https://llmtr.com/v1/chat/completions \ -H "Authorization: Bearer llmtr-your_key" \ -H "Content-Type: application/json" \ -d '{ "model": "zai/glm-5.1", "reasoning": false, "messages": [ {"role": "user", "content": "Quick response please"} ] }'Python (OpenAI SDK)
Section titled “Python (OpenAI SDK)”from openai import OpenAI
client = OpenAI( base_url="https://llmtr.com/v1", api_key="llmtr-your_key",)
# Thinking off — fast moderesponse = client.chat.completions.create( model="zai/glm-5.1:fast", messages=[{"role": "user", "content": "Write a short greeting"}],)print(response.choices[0].message.content)
# Thinking on — deep analysisresponse = client.chat.completions.create( model="zai/glm-5.1:think", messages=[{"role": "user", "content": "Explain the time complexity of this algorithm"}], max_tokens=4000,)print(response.choices[0].message.content)JavaScript (OpenAI SDK)
Section titled “JavaScript (OpenAI SDK)”import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://llmtr.com/v1", apiKey: process.env.LLMTR_API_KEY,});
// Thinking disabledconst fast = await client.chat.completions.create({ model: "zai/glm-4.7:fast", messages: [{ role: "user", content: "Hello" }],});
// Thinking enabled via body fieldconst deep = await client.chat.completions.create({ model: "zai/glm-4.5-air", messages: [{ role: "user", content: "Review this code and list any bugs" }], extra_body: { reasoning: true }, max_tokens: 4000,});max_tokens and thinking
Section titled “max_tokens and thinking”Thinking tokens count against the max_tokens budget. With thinking enabled and a low max_tokens value,
the model may exhaust the budget during its reasoning chain and return an empty response.
Recommended minimum max_tokens values:
| Scenario | Recommended minimum |
|---|---|
| Thinking on, simple question | 1 500 |
| Thinking on, complex question | 4 000+ |
Thinking off (:fast) | 256 |
With thinking disabled no reasoning tokens are spent; standard token counts are sufficient.
Billing
Section titled “Billing”Reasoning tokens are billed as output tokens.
On models where thinking is optional, reduce cost by disabling it with the :fast suffix.
On GLM-5.3 and GLM-5.3-Flash, use the low level instead.
See the Billing page for details.