Reasoning
Configure reasoning effort and reasoning output only on models that expose those controls.
Overview
Reasoning (or "thinking") models spend extra internal tokens working through a problem before they answer, which improves accuracy on hard maths, coding, and multi-step tasks. You control how much effort the model spends; the thinking itself may be summarized or hidden depending on the model. Reasoning is opt-in and only applies to models that support it.
Common controls
| Parameter | Type | Required | Description | Values |
|---|---|---|---|---|
| reasoning_effort | Chat | optional | OpenAI-style reasoning effort field: `low`, `medium`, or `high`. | lowmediumhigh |
| reasoning.effort | Responses | optional | Same control on the Responses API, nested under `reasoning`. | |
| thinking | Claude | optional | Claude extended-thinking config, e.g. `{"type":"enabled","budget_tokens":2048}`. | |
| thinkingConfig | Gemini | optional | Gemini native thinking configuration when supported. |
Example
from openai import OpenAI
client = OpenAI(base_url="https://onerouter.com/v1", api_key="YOUR_API_KEY")
completion = client.chat.completions.create(
model="openai/gpt-5.2",
reasoning_effort="high",
messages=[{"role": "user", "content": "If 3 painters paint 3 fences in 3 hours, how many painters paint 9 fences in 9 hours?"}],
)
print(completion.choices[0].message.content)Reasoning tokens in usage
When a model reasons, the work shows up in usage as reasoning/thinking tokens, billed separately from visible output. Watch these to keep cost predictable.
{
"usage": {
"prompt_tokens": 32,
"completion_tokens": 180,
"completion_tokens_details": { "reasoning_tokens": 140 },
"total_tokens": 212
}
}Billing impact
Reasoning models may bill reasoning tokens or internal computation separately from visible output tokens. Review the model pricing before increasing reasoning effort by default.