Skip to main content
Menu
Build / Reasoning
Build

Reasoning

One way to control and read a model's reasoning, whichever model serves the request.

4 minute readUpdated 13 November 2026curl · Python · TypeScript

The reasoning control#

reasoning.effort is none, low, medium or high, and reasoning.enabled switches reasoning on or off on models where it is optional. none is the same as enabled: false. Without either, the model's default applies. The gateway translates the control for the model that serves the request.

The samples read the model id from PANWARD_REASONING_MODEL: set it to a chat model with the reasoning capability from the model catalog. A model without it refuses the request with 400 unsupported_parameter before any upstream call, so nothing is billed.

cat > body.json <<EOF
{
  "model": "$PANWARD_REASONING_MODEL",
  "messages": [{"role": "user", "content": "Which of these three dosing schedules gives the lowest daily total?"}],
  "reasoning": {"effort": "low"},
  "max_completion_tokens": 4000
}
EOF

curl https://api.panward.ai/v1/chat/completions \
  -H "Authorization: Bearer $PANWARD_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @body.json

The OpenAI-style shorthand#

reasoning_effort takes the same four values as reasoning.effort. If you send both they must agree; otherwise the request is refused with 400 invalid_request.

Read the reasoning#

When the model returns its reasoning, it is in message.reasoning_content, and in delta.reasoning_content in a stream, always under this name whichever model answered.

Tokens and cost#

Reasoning tokens count in completion_tokens, are reported in completion_tokens_details.reasoning_tokens, are billed as output, and count toward max_completion_tokens. Leave room for them when you set the limit.

Models without reasoning#

reasoning or reasoning_effort sent to a model without the reasoning capability is refused with 400 unsupported_parameter.

Reasoning in the conversation history#

An earlier assistant turn may carry its reasoning_content, and you can pass it back. Leaving it out keeps the input, and so the input cost, smaller.

Was this page helpful?Suggest an edit