Model Advanced Parameters
Each model in model_config.toml can set the extra_params field, allowing you to pass provider-specific additional parameters during API calls.
💡 Tip: Except for the three special keys (
headers,query,body), all other keys are merged into the request body (i.e., OpenAI SDK'sextra_bodyparameter).
API Provider Advanced Config
Advanced Auth Configuration
auth_header_name— Header auth name. Default:Authorizationauth_header_prefix— Header auth prefix. Default:Bearerauth_query_name— Query auth param name. Default:api_key
Advanced Parameters
default_headers— Default HTTP headers. Default: emptydefault_query— Default query params. Default: emptyorganization— OpenAI org (optional). Default: noneproject— OpenAI project (optional). Default: nonemodel_list_endpoint— Model list endpoint. Default:/modelsreasoning_parse_mode— Reasoning parse mode. Default:autotool_argument_parse_mode— Tool argument parse mode. Default:auto
Runtime Configuration
timeout— Timeout. Recommended: 10 secondsmax_retry— Max retries. Recommended: 2 timesretry_interval— Retry interval. Recommended: 10 seconds
Internal Translation Mechanism
extra_params is an internal MaiBot configuration field. It is not sent as-is to the model provider. Before the request is sent, the client converts it into the extra arguments supported by the corresponding SDK.
The OpenAI-compatible client (client_type = "openai") splits extra_params using these rules:
headers— Sent as request headersquery— Sent as URL query parametersbody— Merged into the request body- Other plain keys — Sent as extra request body fields
For example:
extra_params = {
headers = {"X-Trace-Id" = "test-001"},
query = {version = "2024-01-01"},
body = {metadata = {source = "maibot"}},
enable_thinking = "false"
}This is converted to request extras similar to:
extra_headers = {"X-Trace-Id": "test-001"}
extra_query = {"version": "2024-01-01"}
extra_body = {
"metadata": {"source": "maibot"},
"enable_thinking": "false",
}A common configuration like extra_params = {enable_thinking = "false"} sends enable_thinking as a request body field to the provider, not as a nested {"extra_params": {"enable_thinking": "false"}}.
Model Advanced Parameters
Parameter Overrides
temperature— Model-level temperature, overrides task config temp. Optionalmax_tokens— Model-level max tokens, overrides task config max_tokens. Optional
Other Advanced Parameters
force_stream_mode— Force streaming, settrueif non-streaming unsupported. Default: disabledextra_params— Extra parameters, custom API params, see scenarios below. Default: empty
Priority Rules
temperature and max_tokens can be written in extra_params as model-level defaults, but the dedicated model fields are recommended:
temperature = 0.7
max_tokens = 4096This keeps the configuration clearer and avoids confusion with provider-specific request body fields that may use the same names.
When the same parameter exists in multiple places, the priority order is:
- Values explicitly passed by the current request
- Dedicated fields in the current model config, such as
temperatureandmax_tokens - Same-name fields in the current model's
extra_params - Defaults from the current task config
Enabling Thinking Mode
Many large models support "thinking mode" — letting the model perform deep reasoning before answering, improving response quality for complex questions.
DeepSeek
[[models]]
name = "deepseek-r1"
model_identifier = "deepseek-reasoner"
api_provider = "deepseek"
visual = false
extra_params = {enable_thinking = true} # Enable thinking modeenable_thinking—trueto enable thinking,falseto disable
Adjusting Reasoning Depth
OpenAI's reasoning models use the reasoning_effort parameter to control reasoning depth.
none— Simple Q&A, information retrieval. Fastest, no reasoningminimal— Minimal reasoning. Almost no added latencylow— Tool calls, search, multi-step decisions. Light reasoningmedium— Planning, complex reasoning (default). Balance of quality and speedhigh— Complex debugging, deep planning. Quality prioritizedxhigh— Deep research, async tasks. Highest quality, maximum latency
[[models]]
name = "gpt-5"
model_identifier = "gpt-5.5"
api_provider = "openai"
visual = false
extra_params = {reasoning_effort = "medium"}💡 Recommendation: Use
mediumfor daily use,lowfor speed-sensitive tasks,highfor deep analysis.
About client_type and Gemini
client_type determines which client MaiBot uses to communicate with the API:
openai— OpenAI-compatible interface (default), works with DeepSeek, Alibaba Bailian, OpenAI, etc.google— Google Gemini native interface, supports thinking budget control
Gemini Thinking Configuration
Gemini models use thinking_config in extra_params to control thinking:
[[models]]
name = "gemini-2.5-flash"
model_identifier = "gemini-2.5-flash"
api_provider = "google-gemini"
visual = true
client_type = "google"
extra_params = {thinking_config = {thinking_budget = 4096}}⚠️ Google API is not directly accessible in China. You'll need a proxy.
Gemini Extra Parameter Fields
When client_type = "google", extra_params does not follow the OpenAI-compatible headers/query/body splitting rules. The Gemini client filters and maps fields according to what it supports:
Content generation: mapped to supported
GenerateContentConfigfieldsEmbeddings: mapped to supported
EmbedContentConfigfieldsthinking_budget— Thinking budget (token count)include_thoughts— Whether to include thinking process in responsesenable_google_search— Enable Google search capabilitytask_type— Embedding task typeoutput_dimensionality— Embedding output dimensionalityaudio_mime_type— MIME type for audio requests
Custom HTTP Requests
extra_params supports three special keys for precise API request control:
headers— Add HTTP request headers, e.g.{headers: {"X-Custom": "value"}}query— Add URL query parameters, e.g.{query: {"key": "value"}}body— Override request body fields, e.g.{body: {"field": "value"}}
[[models]]
name = "custom-model"
model_identifier = "custom-model-v1"
api_provider = "custom"
visual = false
extra_params = {headers = {"X-API-Version" = "2024-06", "X-Priority" = "high"}}Combining Parameters
You can use multiple parameters together:
[[models]]
name = "gpt-5-advanced"
model_identifier = "gpt-5.5"
api_provider = "openai"
visual = true
extra_params = {
reasoning_effort = "high",
headers = {"X-Request-ID" = "custom-id", "X-Priority" = "high"}
}Quick Parameter Reference
enable_thinking— Enable thinking mode. Providers: DeepSeekreasoning_effort— Reasoning depth level. Providers: OpenAIheaders— Custom HTTP request headers. Providers: Allquery— Custom URL query parameters. Providers: Allbody— Custom request body fields. Providers: Allthinking_config— Thinking budget config. Providers: Gemini
⚠️ Note: Parameters are passed directly to the LLM API. Ensure parameter names and value formats match your provider's documentation, otherwise API calls may fail.