Overview
Reasoning lets the model spend more compute on internal chain-of-thought or extended thinking before producing the final answer. Maitai exposes onereasoning object on chat requests. The platform maps it to each provider’s native interface (for example reasoning controls on OpenAI reasoning models, thinking blocks on Anthropic, or extracted reasoning content where the model exposes it). You do not need to branch your integration by vendor.
Request parameters
Passreasoning inside the same argument list as your chat completion (SDK) or inside the request body’s params object (REST). It has two fields:
How much the model should think before answering. Typical values:
"low", "medium", "high". Exact behavior depends on the model; Maitai forwards this through the unified config.When
true, the response can include the model’s reasoning text in the top-level reasoning field (see Response fields).SDK examples
Basic usage (effort only)
Returning reasoning in the response
Setsummary: true (Python: True) so the completion may include the model’s reasoning text on the response object.
API example
Server-side chat completions are sent to Maitai withapplication_ref_name, session_id, action_type (intent), and a params object that mirrors SDK parameters. Include reasoning inside params:
model and message content to match your environment.
Response fields
Whenreasoning.summary is enabled and the model returns thinking content, the completion may include:
The model’s chain-of-thought or thinking text. Omitted or
null when summaries are off or the model does not expose reasoning in the response.Number of completion tokens attributed to reasoning, when the provider supplies this breakdown.
choices[0].message.content still holds the final assistant message.
Portal configuration
In the Maitai Portal, you can set a default reasoning effort at the intent or intent group level as part of model / request configuration (the UI uses the legacyreasoning_effort field for that default). Per-request reasoning from the SDK or API overrides those defaults when both are present.
Related
- Model Request — full chat parameters and Maitai-specific fields