Skip to content
docs

Reasoning

Reasoning models “think” before they answer: they generate internal reasoning that is not part of the main text but is billed as output. The depth of reasoning is set by the effort level: a higher level gives more accurate answers on hard tasks, at the cost of a longer wait and a more expensive request.

To check whether a model reasons, look in GET /v1/models: its capabilities.features includes reasoning. See Models.

Set the level with the reasoning_effort field.

reasoning.sh
curl https://api.waibee.com/v1/chat/completions \
-H "Authorization: Bearer $WAIBEE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-5.4-mini",
"reasoning_effort": "high",
"messages": [{ "role": "user", "content": "What is 17*23? Answer with a number." }]
}'
ValueMeaning
noneReasoning is off
minimalThe minimum, for simple tasks
lowA little
mediumA reasonable trade-off
highA lot, for hard tasks
xhighA great deal
maxThe highest level, on models that support it

The available levels depend on the model. The router passes the value to the model as is; some models reject a level outside their list with 400 feature_not_supported and name the levels they accept. If the field is not passed, the model’s default behavior applies.

The levels a model accepts are listed in the catalog: models with reasoning in capabilities.features have a reasoning field.

  • efforts: the levels the model accepts, from weakest to strongest. none in the list means reasoning can be turned off. An empty list means the model always reasons and accepts no level.
  • default: the level to pick by default. It is none if the model does not reason without a level, and null if the provider does not say.

The provider may reject a level that is not in efforts with 400. For models without reasoning and for waibee/auto, the field is null.

Clients that send a reasoning object instead of a string also work: the router takes effort from it. The object’s other fields may not be applied, so reasoning_effort is more predictable.

On POST /v1/messages, set the level with the effort field inside output_config.

Terminal window
curl https://api.waibee.com/v1/messages \
-H "x-api-key: $WAIBEE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-5",
"max_tokens": 2048,
"output_config": { "effort": "high" },
"messages": [{ "role": "user", "content": "What is the probability of drawing two red balls in a row without replacement from 5 red, 3 blue, and 2 white?" }]
}'

The reasoning arrives in a separate thinking block before the response text:

{
"type": "message",
"content": [
{ "type": "thinking", "thinking": "..." },
{ "type": "text", "text": "..." }
]
}

The thinking field in the request (Anthropic’s extended thinking configuration) is also passed to the model unchanged, but on newer Claude models output_config.effort is preferred.

On POST /v1/responses, set the level with the effort field inside the reasoning object. The request goes to the model as is, and the router does not check the value. The reasoning arrives as a separate item in output; see Responses API.

The format depends on the model, so the response can contain two fields:

FieldContents
reasoningThe reasoning text as a string, if the model exposes it
reasoning_detailsAn array of blocks in the model’s format: reasoning.text with the text, reasoning.summary with a summary of the reasoning, or reasoning.encrypted with an encrypted blob

If the provider omits reasoning or sends an empty string, the router fills it by concatenating the text of reasoning.text blocks and the summary of reasoning.summary blocks in reasoning_details, without a separator. Encrypted blocks contribute no text. This also applies to streaming deltas.

Some model families do not expose their reasoning and send only encrypted blocks. You cannot read them, but you can pass them back in the next request if your client supports it. Plain text looks like this:

{
"message": {
"role": "assistant",
"content": "391",
"reasoning": "17 * 20 = 340, plus 17 * 3 = 51, total 391.",
"reasoning_details": [{ "type": "reasoning.text", "text": "...", "index": 0 }]
}
}

When streaming, these fields arrive in fragments inside delta, like ordinary text.

With DLP in mask mode, reasoning keeps the provider’s placeholders, including in streaming responses. Send signed reasoning back unchanged: editing it can invalidate its signature. DLP scans the readable reasoning you send back.

Reasoning is billed as output and counts toward output tokens. Which usage field shows the amount on each endpoint: Tokens and usage.

  • The first token arrives later. At high levels the model is silent while it thinks: on hard requests that is tens of seconds or more. In interactive interfaces, turn on streaming so the connection does not look stuck, and do not set client timeouts too low.
  • Pick the level for the task, not “just in case”. Data extraction, short answers, and tool calls usually do not improve with high effort, but they cost more.
  • max_tokens includes the reasoning. A limit that is too tight cuts the response off before the model gets to the text.
  • Reasoning does not replace instructions. If the answer is consistently wrong, a more precise prompt helps more than a higher level.