Build
Thinking and reasoning
Choose reasoning effort or a thinking budget, and understand the token and cost impact.
Choose a control
Check the model's reasoning_options in the
public catalog. It describes an effort
list, a token budget, or a toggle. Use the model's listed values and limits.
| Control | Chat Completions field |
|---|---|
| Effort level | reasoning: {"effort":"high"} using one of the model's listed levels |
| Alternative effort syntax | reasoning_effort: "high"; do not also send reasoning |
| Reasoning token budget | reasoning: {"max_tokens":2048} for a budget-based model |
| Disable reasoning | reasoning: {"effort":"none"} only when the model supports disabling it |
| Hide returned reasoning | reasoning: {"effort":"high","exclude":true} where supported; this does not disable reasoning or its cost |
| Model default | Omit the reasoning fields |
Effort names can include none, minimal, low, medium, high,
xhigh, and max. Each model supports its own subset. More effort can
increase latency and cost; it does not guarantee a better answer.
Set your key
Create an API key, save its recovery link, and add credits. Replace the placeholder below and run it in your terminal before running the examples on this page.
export MINIROUTER_KEY='paste-your-api-key-here'Examples use paid models. For free requests, follow the Auto Free guide.
The model IDs below are examples. To use another model, check its supported APIs and reasoning controls in the catalog.
Chat Completions
Set effort with reasoning.effort and leave room in
max_completion_tokens for thinking and the answer.
curl https://api.minirouter.sh/v1/chat/completions \
-H "Authorization: Bearer $MINIROUTER_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-6-astra",
"messages": [
{
"role": "user",
"content": "What is the smallest positive integer divisible by every integer from 1 through 10? Explain briefly."
}
],
"max_completion_tokens": 4096,
"reasoning": {
"effort": "high"
}
}'The final answer is in choices[0].message.content. Reasoning text, when
returned, is separate from the answer and varies by model.
Responses
Use input, reasoning.effort, and max_output_tokens.
curl https://api.minirouter.sh/v1/responses \
-H "Authorization: Bearer $MINIROUTER_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-6-astra",
"store": false,
"input": "What is the smallest positive integer divisible by every integer from 1 through 10? Explain briefly.",
"max_output_tokens": 4096,
"reasoning": {
"effort": "high"
}
}'Read the answer from output message items with output_text content.
This example returns JSON. Use Chat Completions or Messages for streaming.
Messages
For adaptive thinking, use thinking.type: "adaptive" and
output_config.effort. Include the Messages version header.
curl https://api.minirouter.sh/v1/messages \
-H "Authorization: Bearer $MINIROUTER_KEY" \
-H "Content-Type: application/json" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "anthropic/claude-haiku-5.5",
"max_tokens": 4096,
"thinking": {
"type": "adaptive"
},
"output_config": {
"effort": "high"
},
"messages": [
{
"role": "user",
"content": "Compare two approaches to caching API responses."
}
]
}'Read text blocks in content for the answer; thinking blocks are separate.
For a model with a fixed thinking budget, use
thinking: {"type":"enabled","budget_tokens":2048} instead of adaptive
thinking. The budget must be below max_tokens and within the model's supported
range. Do not add budget_tokens to adaptive thinking.
To disable thinking where supported, use thinking: {"type":"disabled"}
and omit output_config.effort. Messages does not accept none as an effort.
Read streamed reasoning
On Chat Completions streams, a model may return delta.reasoning_content,
delta.reasoning, or delta.reasoning_details separately from
delta.content. Messages streams can include thinking blocks and
thinking_delta events. Not every model exposes its reasoning.
Preserve provider-issued thinking blocks and signatures when continuing a Messages conversation. Do not replace them with a reconstruction of the text. See streaming for event handling and cost.
Troubleshooting
| Symptom | What to check |
|---|---|
| No thinking control in your client | Refresh its model list, check its setup guide, or send an API example above. Some clients need reasoning enabled in their model configuration. |
| No visible thinking text | Thinking can be hidden by the model or client. Check reasoning-token usage when returned; an absent thinking panel does not establish whether thinking ran. |
| Empty or cut-off answer | Increase the endpoint's output-token limit. Thinking and the answer share that allowance. Check for Chat Completions finish_reason: "length", Responses status: "incomplete", or Messages stop_reason: "max_tokens". |
| Unsupported effort or budget | Check the model's reasoning_options for allowed effort values, token budgets, and support for disabling reasoning. |
| Spend-limit or balance error | Check available credits and the key's spend limit. Admission reserves a worst-case hold before sending the request, which can exceed its eventual charge. |
Tokens and cost
Reasoning tokens can count toward billed output even when hidden. Allow room
for both reasoning and the visible answer. Reasoning requests may require a
larger temporary balance hold than a request without reasoning; reducing the
visible output limit alone may not reduce that hold. Check the final cost in
usage.cost or Request logs.