Background: Making “Thinking Longer” a Governable Resource
Reasoning models don’t just generate more text. They consume additional internal computation before producing a final answer—to decompose problems, compare paths, check constraints, or continue planning between tool calls. This capability is ideal for complex code generation, mathematical reasoning, long-document analysis, strategic planning, and high-risk decisions. However, it introduces a new challenge for production systems: users see short outputs, but bills and latency can be high.
OpenAI’s Reasoning documentation clearly distinguishes between input tokens, visible output tokens, and reasoning tokens. These reasoning tokens are not directly exposed as a full raw thought process via the API, but they consume context window space and are billed as output tokens. Google Gemini’s thinking documentation also states that enabling thinking means pricing is based on both output tokens and thinking tokens, with thought token fields readable from usage. Anthropic’s extended thinking provides budget_tokens or, on newer models, an adaptive thinking/effort mechanism to limit the budget available for internal reasoning.
This means production systems cannot estimate costs using just “model price per token × output length.” Reasoning models require a dedicated Reasoning Budget that integrates task classification, reasoning toggles, effort levels, token caps, timeouts, fallbacks, and observability into the call chain.
Core Principle: The Reasoning Budget is Not a Single Parameter, but a Set of Runtime Boundaries
1. Internal Reasoning Tokens are Hidden but Real Costs
For standard chat models, cost governance typically revolves around input length, output length, model selection, and cache hit rate. Reasoning models add a layer: the model may generate invisible reasoning tokens before producing the final answer.
Therefore, a single call should track at least four categories of data:
| Metric | Meaning |
|---|---|
input_tokens | User input, system prompts, context, tool results, etc. |
visible_output_tokens | The final answer visible to the user |
reasoning_tokens / thought_tokens | Internal reasoning consumption by the model |
finish_status / incomplete_reason | Whether the response ended early due to token limits, context window, timeout, or safety policies |
If a system only records visible output, it will mistakenly think “this call was cheap.” If it only limits the final answer length, the model might exhaust its budget during internal reasoning and fail to produce a valid visible answer.
2. Effort / Thinking Level Determines Reasoning Depth, But Doesn’t Replace Business Strategy
Different platforms have different controls. OpenAI’s Responses API uses reasoning: { effort: "medium" } to control reasoning intensity and max_output_tokens to limit the total generation space. Azure OpenAI’s Chat Completions examples also provide reasoning_effort and max_completion_tokens. Anthropic’s extended thinking uses the thinking configuration to control whether it’s enabled and the budget cap. Google Gemini provides thinking_level, thought summaries, and thought token statistics in usage.
However, from an engineering perspective, these parameters should not be directly exposed to business teams to fill in arbitrarily. A safer approach is to wrap platform differences into a unified business policy:
{
"task_type": "contract_risk_review",
"risk_level": "high",
"latency_class": "async_or_slow_ok",
"reasoning_policy": {
"enabled": true,
"effort": "high",
"max_generated_tokens": 12000,
"timeout_ms": 90000,
"fallback": "medium_effort_retry_then_manual_review"
}
}
In this model, the business only describes the task type and risk level. The platform layer is responsible for translating the policy into specific parameters for OpenAI, Anthropic, Gemini, or Azure.
3. The Reasoning Budget Must Constrain Quality, Latency, and Cost Simultaneously
If the reasoning budget is too low, complex tasks may be interrupted prematurely, output empty results, miss constraints, or provide answers without sufficient verification. If the budget is too high, it leads to longer latency, higher bills, and more unpredictable queuing pressure.
Therefore, the goal of a Reasoning Budget is not “the cheaper, the better,” but to give every task type an explainable boundary:
| Task Type | Recommended Strategy |
|---|---|
| Simple classification, field rewriting, short text summarization | Default to no reasoning model, or use low thinking |
| Multi-constraint judgment, complex code, mathematical derivation, contract clause analysis | Allow medium / high |
| Low-value batch tasks | Prioritize standard models, low effort, or async batch processing |
| High-value but non-real-time tasks | Allow higher reasoning budget, with queues and manual review as a safety net |
| User-facing real-time interactive tasks | Prioritize controlling timeout and streaming feedback; don’t let the reasoning phase indefinitely extend the time to first token |
Engineering Implementation: Upgrading from “Tuning Parameters Per Call” to a Budget Policy Layer
Task Classification: First Determine if Reasoning is Worth It
Before deploying reasoning models, classify business requests into four categories:
First is the routine task, such as translation, format conversion, label classification, and short Q&A. These tasks can use standard models or a low reasoning budget.
Second is the ambiguous task, such as “help me determine if this complaint needs escalation” or “find anomalies in these materials.” These tasks can use a low to medium reasoning budget and require the model to output its reasoning.
Third is the constraint-heavy task, such as code fixing, insurance rule judgment, contract risk clause identification, and financial definition interpretation. These tasks are suitable for a medium to high reasoning budget because the cost of errors is high and multiple constraints need to be handled.
Fourth is the open-ended planning task, such as complex agent planning, migration plan decomposition, and multi-step troubleshooting. These tasks should be executed asynchronously by default, allowing a higher budget, but must be paired with timeouts, auditing, and human confirmation.
Unified Policy Table: Don’t Scatter Provider Parameters in Business Code
It is recommended to create an llm_reasoning_policy configuration table or an equivalent configuration file, containing at least the following fields:
CREATE TABLE llm_reasoning_policy (
id VARCHAR(64) PRIMARY KEY,
task_type VARCHAR(128) NOT NULL,
enabled BOOLEAN NOT NULL,
default_effort VARCHAR(32) NOT NULL,
max_generated_tokens INTEGER NOT NULL,
timeout_ms INTEGER NOT NULL,
fallback_policy VARCHAR(128) NOT NULL,
max_cost_usd NUMERIC(10, 4),
require_human_review BOOLEAN DEFAULT FALSE,
updated_at TIMESTAMP NOT NULL
);
Business code only passes in task_type. The gateway or SDK middleware layer generates the provider-specific request based on the policy.
OpenAI Example: Logging Reasoning Tokens and Incomplete Status
The OpenAI documentation warns that if generated tokens reach max_output_tokens or the context window limit, the response may return status: "incomplete", and may have consumed input and reasoning tokens before any visible output. Therefore, production code must explicitly handle incomplete status, not just check for HTTP 200.
import OpenAI from "openai";
const openai = new OpenAI();
async function runReasoningTask(input: string) {
const response = await openai.responses.create({
model: "gpt-5.5",
reasoning: { effort: "medium" },
input,
max_output_tokens: 4000,
});
const usage = response.usage;
const reasoningTokens = usage?.output_tokens_details?.reasoning_tokens ?? 0;
if (response.status === "incomplete") {
return {
ok: false,
reason: response.incomplete_details?.reason,
reasoningTokens,
partialText: response.output_text ?? "",
};
}
return {
ok: true,
text: response.output_text,
inputTokens: usage?.input_tokens,
outputTokens: usage?.output_tokens,
reasoningTokens,
};
}
Anthropic Example: Placing the Thinking Budget in the Policy Layer
Anthropic’s extended thinking documentation states that budget_tokens controls the maximum number of tokens Claude can use for its internal reasoning process and must be less than max_tokens. Such constraints are best validated by the platform layer.
{
"model": "claude-sonnet-4-6",
"max_tokens": 16000,
"thinking": {
"type": "enabled",
"budget_tokens": 10000,
"display": "omitted"
},
"messages": [
{
"role": "user",
"content": "Review this migration plan and identify blocking risks."
}
]
}
For most business systems, display: "omitted" is more appropriate: don’t expose the thinking summary to the end-user; only write the final answer, evidence, and structured judgment results into the business pipeline.
Gemini Example: Incorporating Thought Tokens into the Billing Metric
The Gemini thinking documentation explains that when thinking is enabled, thought token fields can be read from usage, and it is recommended to control the thinking level based on task complexity. Production systems should record total_thought_tokens separately from regular output tokens.
{
"task_id": "risk-review-20260703-001",
"provider": "gemini",
"model": "gemini-3.5-flash",
"thinking_level": "low",
"usage": {
"input_tokens": 3280,
"output_tokens": 420,
"thought_tokens": 860
},
"latency_ms": 4810,
"finish_status": "stop"
}
Key Metrics for Budget Governance
After deploying a Reasoning Budget, at least the following metrics should be monitored:
| Metric | Meaning and Suggested Action |
|---|---|
reasoning_token_ratio | reasoning tokens / total generated tokens. A high ratio indicates a large portion of the budget is spent on internal reasoning; assess if the task truly needs it |
empty_visible_output_rate | Proportion of calls with no visible output but incurred reasoning costs. Usually indicates max_output_tokens is too low, context is too long, or task difficulty exceeds the budget |
incomplete_rate_by_policy | Incomplete rate grouped by policy. If a task is consistently incomplete, don’t just increase the budget; check the prompt, input length, and task decomposition |
p95_latency_by_effort | P95 latency for different effort levels. High effort should not be mixed into real-time, low-latency pipelines |
cost_per_successful_task | Total cost to successfully complete one business task. A high reasoning budget might still be worthwhile if it significantly reduces retries and manual review |
Common Pitfalls
Pitfall 1: Only Limiting Visible Output
Simply requiring “the answer must not exceed 200 words” does not mean low cost. A reasoning model might spend a large number of internal tokens on analysis before outputting a 200-word conclusion. Production systems must set a total generation cap, reasoning budget, and timeout simultaneously.
Pitfall 2: Using High Effort for All Complex Tasks
High reasoning intensity does not always lead to a proportional quality improvement. The main bottleneck for many tasks is input quality, rule definition, insufficient evidence, or unclear output format, not an insufficient reasoning budget. First, measure the marginal benefit of different effort levels using offline samples.
Pitfall 3: Treating Thought Summaries as Auditable Evidence
Thinking summaries can help with debugging, but they should not be used directly as evidence for legal, financial, medical, or compliance audits. What is truly auditable is the input material, cited snippets, business rules, the model’s final output, human review comments, and version information.
Pitfall 4: Simply Retrying the Same High-Effort Request After a Timeout
If a high-effort request times out, simply retrying it is likely just burning money. A better strategy is: shorten the input, lower the effort, decompose the task, move it to an async queue, or route it to manual review.
Pitfall 5: Comparing Models Without a Fixed Budget
When comparing reasoning models, if one model allows 30k thinking tokens and another only allows 2k, you cannot just compare final accuracy. You need to fix the task, input, output format, budget, timeout, and retry strategy.
Production Checklist
Strategy and Permissions
- Have you defined which tasks are allowed to enable reasoning?
- Are different budgets set based on user tier, business value, and risk level?
- Is it forbidden for business teams to bypass the platform layer and pass high effort directly?
- Are there approvals, quotas, or async queues set for high-budget tasks?
Parameters and Fallbacks
- Are
max_output_tokens,max_completion_tokens, or equivalent limits set? - Is a timeout configured for each task type?
- Are incomplete, empty, and partial outputs handled?
- Are strategies defined for low-effort retries, standard model fallback, task decomposition, and manual review?
Observability
- Are input tokens, output tokens, and reasoning/thought tokens logged?
- Are effort, thinking_level, budget_tokens, model version, and policy version logged?
- Are success rates, timeout rates, human review rates, and cost per successful task tracked by task type?
- Can you trace multiple model calls within a single business task, rather than just looking at a single API call?
Quality Validation
- Have you created offline replay sets for different budget tiers?
- Have you compared the marginal benefit of low / medium / high?
- Have you verified the types of failures for complex tasks under a low budget?
- Is “more expensive reasoning” evaluated together with “fewer retries / less manual review”?
Applicable Scenarios
The Reasoning Budget is most suitable for the following production scenarios:
- Multi-constraint judgment: Contract, claims, audit, financial analysis, etc., requiring the model to reason across multiple clauses, fields, and contexts.
- Technical reasoning: Code generation, code review, SQL generation, migration script analysis, etc., requiring the model to repeatedly check constraints.
- Multi-step planning: Agent planning, complex ticket troubleshooting, data migration plan decomposition, etc., requiring the model to decide on steps first, then delegate execution.
- Final adjudication: After complex document extraction, judging conflicts, omissions, and risk levels from multiple extraction results.
Scenarios where it is not suitable are also clear: standard classification, templated replies, short text rewriting, large-scale low-value batch processing, and strict low-latency entry points should not enable a high reasoning budget by default.
Summary
The essence of the Reasoning Budget is the fine-grained governance of the resource “model internal thinking.” It is not a single toggle or parameter, but a complete system covering task classification, budget strategy, platform adaptation, timeout fallbacks, and observability. A good budget strategy lets simple tasks think less, complex tasks think thoroughly, and high-risk tasks be auditable, ultimately finding an explainable balance between quality, latency, and cost.