#4734: fix: auto-detect China region for MiniMax API endpoint selection
docs
commands
agents
Cluster:
MiniMax API Fixes
### Summary
Fixes #4647 - MiniMax provider now automatically uses the domestic endpoint (`api.minimaxi.com`) for China mainland users based on timezone detection.
### Changes
- Add [isChinaRegion()](cci:1://file:///home/akram/openclaw/src/infra/region-utils.ts:26:0-51:1) utility for timezone-based region detection
- Add [getMinimaxBaseUrl()](cci:1://file:///home/akram/openclaw/src/commands/onboard-auth.models.ts:8:0-23:1) helper for region-aware URL selection
- Update MiniMax provider configs to auto-select appropriate endpoints
- Update documentation with China mainland user guidance
### How it works
- Detects China/Greater China timezones: `Asia/Shanghai`, `Asia/Hong_Kong`, `Asia/Taipei`, etc.
- China users → `https://api.minimaxi.com/anthropic`
- Overseas users → `https://api.minimax.io/anthropic`
- Manual override still available via `openclaw config set`
### Files Changed
- [src/infra/region-utils.ts](cci:7://file:///home/akram/openclaw/src/infra/region-utils.ts:0:0-0:0) (new)
- [src/commands/onboard-auth.models.ts](cci:7://file:///home/akram/openclaw/src/commands/onboard-auth.models.ts:0:0-0:0)
- [src/commands/onboard-auth.config-minimax.ts](cci:7://file:///home/akram/openclaw/src/commands/onboard-auth.config-minimax.ts:0:0-0:0)
- [src/agents/minimax-vlm.ts](cci:7://file:///home/akram/openclaw/src/agents/minimax-vlm.ts:0:0-0:0)
- [src/agents/models-config.providers.ts](cci:7://file:///home/akram/openclaw/src/agents/models-config.providers.ts:0:0-0:0)
- [docs/providers/minimax.md](cci:7://file:///home/akram/openclaw/docs/providers/minimax.md:0:0-0:0)
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR adds timezone-based region detection (`isChinaRegion`) and uses it to choose a MiniMax base URL automatically, preferring the domestic `api.minimaxi.com` endpoint for China/HK/TW timezones. The logic is wired into MiniMax-related onboarding/config defaults, plus the MiniMax VLM helper, and the MiniMax provider docs are updated with China-specific guidance and override instructions.
The main risk is endpoint inconsistency: different parts of the code now default to different overseas domains (`api.minimax.io`, `api.minimax.chat`) and different API variants (`/v1` vs `/anthropic`), which can lead to surprising behavior or broken requests depending on which path constructs the provider config.
<h3>Confidence Score: 3/5</h3>
- Mostly safe to merge, but endpoint/domain inconsistencies could cause MiniMax to break or behave differently across code paths.
- Changes are small and localized, but MiniMax base URL selection now varies between implicit providers, onboarding defaults, and VLM host coercion (`.io` vs `.chat`), which is easy to miss and could impact real users.
- src/agents/models-config.providers.ts; src/commands/onboard-auth.config-minimax.ts; src/agents/minimax-vlm.ts
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#20779: fix(providers): rename MiniMax M2.5 Lightning to M2.5 highspeed
by ccclyt · 2026-02-19
77.7%
#19351: fix: enable tool_use/result pairing repair for MiniMax models
by thebtf · 2026-02-17
76.1%
#17602: fix: correct MiniMax M2.5 pricing constants (75x overcharge)
by ghostllm · 2026-02-15
73.9%
#20675: fix(minimax): enable tool-use/result repair and drop malformed assi...
by jamesbuddy-claw · 2026-02-19
72.9%
#17179: fix: validateAnthropicTurns handles consecutive system messages for...
by Limitless2023 · 2026-02-15
72.3%
#20962: Fix/context window size for custom api provider
by r4jiv007 · 2026-02-19
70.6%
#8660: fix: respect agents.defaults.models.*.params.maxTokens in image tool
by dbottme · 2026-02-04
70.3%
#10430: fix: remove Minimax from isReasoningTagProvider
by echoedinvoker · 2026-02-06
69.8%
#9337: fix: correct GLM MCP web-search-prime API parameter name and respon...
by shoa-lin · 2026-02-05
69.4%
#6968: Add LM Studio onboarding option
by i3T4AN · 2026-02-02
69.1%