Skip to main content

Controlling reasoning

Most models in the catalogue think before they answer. The thinking is billed as output tokens and counts against your max_tokens, so it is worth knowing how to turn it up when you want a better answer and off when you want a cheap one.

You control it with one parameter, in the naming you already use. Tokligence translates it into whatever the model behind your request actually understands — so the same request keeps working if the model moves to a different upstream.

Not sure you need this page?

You don't, to make your first call — see the Quickstart. Come back when an answer arrives empty, slower than you expected, or costs more than you expected.

The parameter

Two spellings are accepted. Use whichever your SDK already speaks.

OpenRouter-style (recommended)
{
"model": "glm-5.2",
"messages": [{ "role": "user", "content": "..." }],
"reasoning": { "enabled": false }
}
OpenAI-style
{
"model": "glm-5.2",
"messages": [{ "role": "user", "content": "..." }],
"reasoning_effort": "low"
}
FieldTypeMeaning
reasoning.enabledbooleanThink, or don't. The one that matters most.
reasoning.effort"minimal" | "low" | "medium" | "high"How hard, where the model has levels.
reasoning.max_tokensintegerToken budget for the thinking itself.
reasoning_effortstringThe same as reasoning.effort, OpenAI's spelling. Implies enabled: true.

Sending both is allowed; the reasoning object wins, because it is the more specific statement.

Saying nothing leaves the model's own default in place. We never flip it for you: a model's default thinking behaviour is part of its answers and its price, and changing it silently would change both.

Why you would turn it off

Thinking tokens are output tokens. On the same question, with the reply capped at 200 tokens:

Output tokens billedTime
Default (thinking on)134523.9 s
"reasoning": {"enabled": false}552.8 s

Same answer, in the same amount of prose. The difference is entirely the model thinking out loud on your budget.

An empty answer usually means this

If a response comes back with content: "" and finish_reason: "length", the model spent your whole max_tokens on reasoning and never reached the answer. Either raise max_tokens well above the thinking budget, or set "reasoning": {"enabled": false}. A small max_tokens and a thinking model are a bad pair.

What we send upstream

You do not need this table — it is here so you can see there is no magic, and so you can predict what a model will do.

Model familyWhat your reasoning becomes
GLM (Zhipu), DeepSeek, Kimi (Moonshot)thinking: {"type": "enabled" / "disabled"}
Qwenenable_thinking: true / false, plus thinking_budget from reasoning.max_tokens
GPT (OpenAI)reasoning_effort
Claude (Anthropic), Geminithinking: {"type": "enabled", "budget_tokens": …}

Two honest notes about the edges:

  • effort only reaches models that have levels. GLM and Qwen have no notion of effort — they get "think" or "don't". We do not invent a level for them.
  • OpenAI has no off switch. "enabled": false becomes reasoning_effort: "minimal", the least that API offers. It is the closest thing available, not a true disable, and you will still be billed for the little it does.
  • Claude needs a budget to think. If you enable reasoning for a Claude model without reasoning.max_tokens, we leave the model's own default alone rather than picking a number — that number is billed, and it is your money.

Vendor-native parameters still work

If you already send a model's own field — thinking, enable_thinking, thinking_budget, reasoning_effort — it is forwarded untouched, as are any other parameters we have not modelled. That escape hatch exists so a new upstream feature is usable through Tokligence the day it ships, before we have wrapped it.

The trade-off is the reason this page recommends the normalized parameter: a vendor-native field is a bet on which vendor is behind the model name today. The normalized one keeps working if that changes.

Reading the thinking

Models that expose their reasoning return it alongside the answer, in the field the upstream uses (commonly reasoning_content on the message). It is billed whether or not you read it — the token count is in usage.completion_tokens, and usage.completion_tokens_details.reasoning_tokens breaks out how much of it was thinking.

curl https://llm-api.tokligence.ai/v1/chat/completions \
-H "Authorization: Bearer $TOKLIGENCE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.2",
"messages": [{"role": "user", "content": "In one sentence: what is a B-tree?"}],
"max_tokens": 200,
"reasoning": {"enabled": false}
}'