Reasoning & Thinking
For models that support it, the SIRAYA Model Router API can return Reasoning Tokens, also known as Thinking Tokens. SIRAYA Model Router normalizes the different ways of customizing the amount of reasoning tokens that the model will use, providing a unified reasoning & thinking interface across different providers.
Reasoning tokens provide a transparent look into the reasoning steps taken by a model. Reasoning tokens are considered output tokens and charged accordingly.
SIRAYA Model Router provides a unified parameter wrapper for Reasoning & Thinking.
- If the "reasoning" field is not included in the request, SIRAYA Model Router follows the model's own default. Two groups are the exception: models whose default is no reasoning (GPT-5.1, 5.2, 5.4 and 5.5, and DeepSeek V4) and Claude models with thinking support may have reasoning turned on for you — at
mediumeffort, orhighfor DeepSeek V4. Send"effort": "none"to turn it off. Gemini models always follow Google's default. - If the "reasoning" field is included in the request, SIRAYA Model Router will uniformly perform parameter conversion to adapt to the Reasoning & Thinking parameter formats of different providers.
Reasoning tokens are included in the response by default if the model decides to output them. Reasoning tokens will appear in the reasoning field of each message. GPT models do not return their reasoning text on Chat Completions — only the reasoning_tokens count in usage.
Controlling Reasoning Tokens in OpenAI Chat Completions
You can control reasoning tokens in your requests using the reasoning parameter:
The reasoning config object consolidates settings for controlling reasoning strength across different models. Set effort (a named level), max_tokens (a specific token budget), or both. The same request can also use enabled (false is equivalent to "effort": "none") and exclude (reason internally but do not return the reasoning). If you send both reasoning and reasoning_effort, reasoning.effort takes precedence.
The effort can be one of below list:
"effort": "max"- The highest level, on models that have one abovexhigh; other models map it to their highest level or reject it"effort": "xhigh"- Allocates the largest reasoning budget"effort": "high"- Allocates a large reasoning budget"effort": "medium"- Allocates a moderate reasoning budget"effort": "low"- Allocates a smaller reasoning budget"effort": "minimal"- Allocates a minimal reasoning budget"effort": "none"- Disables reasoning entirely. Not every model can turn reasoning off:gemini-2.5-proreturns 400 fornone, and Gemini 3.x models have no "off" tier, sononesends their lowest tier instead (see Per-Model Details).
Not every model accepts every level. On models that use a token budget (Claude models without adaptive thinking, Gemini 2.5), the router maps each level to a fixed budget; xhigh and max are ignored on Gemini 2.5. Gemini 3.x forwards the level unchanged as its thinking_level tier, so a tier the model does not take returns 400. For models that only support reasoning.max_tokens, set the budget directly.
Examples
Basic Usage with Reasoning Tokens
from openai import OpenAI
client = OpenAI(
base_url="https://llm.siraya.ai/v1",
api_key="<API_KEY>",
)
response = client.chat.completions.create(
model="gemini-2.5-pro",
messages=[
{"role": "user", "content": "What is 25 * 37?"}
],
extra_body={
"reasoning": {
"effort": "high"
}
},
)
print(response.model_dump_json())
Using Max Tokens for Reasoning
You can specify the exact number of tokens to use for reasoning:
from openai import OpenAI
client = OpenAI(
base_url="https://llm.siraya.ai/v1",
api_key="<API_KEY>",
)
response = client.chat.completions.create(
model="gemini-2.5-pro",
messages=[
{"role": "user", "content": "What is 25 * 37?"}
],
extra_body={
"reasoning": {
"max_tokens": 200
}
},
)
print(response.model_dump_json())
Disables reasoning entirely
Use a model that can turn reasoning off, such as gemini-2.5-flash. gemini-2.5-pro always reasons and returns 400 for "effort": "none".
from openai import OpenAI
client = OpenAI(
base_url="https://llm.siraya.ai/v1",
api_key="<API_KEY>",
)
response = client.chat.completions.create(
model="gemini-2.5-flash",
messages=[
{"role": "user", "content": "What is 25 * 37?"}
],
extra_body={
"reasoning": {
"effort": "none"
}
},
)
print(response.model_dump_json())
Streaming mode with reasoning tokens
from openai import OpenAI
client = OpenAI(
base_url="https://llm.siraya.ai/v1",
api_key="<API_KEY>",
)
def chat_completion_with_reasoning(messages):
response = client.chat.completions.create(
model="gemini-2.5-pro",
messages=messages,
max_tokens=10000,
extra_body={
"reasoning": {
"effort": "high"
}
},
stream=True
)
return response
for chunk in chat_completion_with_reasoning([
{"role": "user", "content": "What is 25 * 37?"}
]):
if not chunk.choices:
continue
delta = chunk.choices[0].delta
if getattr(delta, 'reasoning_content', None):
print(f"REASONING: {delta.reasoning_content}")
elif getattr(delta, 'content', None):
print(f"CONTENT: {delta.content}")
Response Shape
When reasoning models generate responses, the reasoning text is returned in the message's reasoning and reasoning_content fields, with a structured copy in reasoning_details. The usage object reports the reasoning token count.
{
"id": "chatcmpl-abcdefghijklmnopqrstuvwx",
"object": "chat.completion",
"model": "gemini-2.5-pro",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "25 * 37 = **925**",
"reasoning": "Alright, the user wants the product of 25 and 37. Let's break it down: 25 times 30 is 750, and 25 times 7 is 175. Add those together, 750 plus 175, that's 925...",
"reasoning_content": "Alright, the user wants the product of 25 and 37. Let's break it down: 25 times 30 is 750, and 25 times 7 is 175. Add those together, 750 plus 175, that's 925...",
"reasoning_details": [
{
"type": "reasoning.text",
"text": "Alright, the user wants the product of 25 and 37...",
"id": "reasoning-text-0",
"format": "google-gemini-v1",
"index": 0
}
]
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 685,
"total_tokens": 695,
"completion_tokens_details": {
"reasoning_tokens": 673
}
}
}