fix(provider/minimax): JCODE_MINIMAX_REGION override for global sk-cp- keys#237
Merged
Merged
Conversation
…- keys MiniMax's global console started issuing sk-cp-prefixed API keys in 2026 Q2, but jcode auto-routes any sk-cp- key to the China endpoint (api.minimaxi.com) per the heuristic added in commit 1f66945. Result: global users get 'invalid api key (2049)' 401s. Adds JCODE_MINIMAX_REGION env var override: JCODE_MINIMAX_REGION=global → force api.minimax.io (catalog default) JCODE_MINIMAX_REGION=china → force api.minimaxi.com Aliases: international/io/cn/minimaxi (case-insensitive, trimmed) Invalid value → falls through to prefix heuristic (warning logged) Unset → existing prefix heuristic (no behavior change) Verified with a real global sk-cp- key: $ JCODE_MINIMAX_REGION=global jcode --provider minimax run "..." → real model response, no 401. 5 new tests covering global override, china override, invalid value fall-through, and case-insensitive alias matching. Refs upstream issue #176 follow-up.
This was referenced May 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
MiniMax's global console started issuing
sk-cp--prefixed API keys in 2026 Q2, but jcode auto-routes anysk-cp-key to the China endpoint (api.minimaxi.com) per the heuristic added in commit1f66945c. Result: global users getinvalid api key (2049)401s.Fix
Adds
JCODE_MINIMAX_REGIONenv var override:global/international/ioapi.minimax.io(catalog default)china/cn/minimaxiapi.minimaxi.comAliases are case-insensitive + whitespace-trimmed.
Verified live
Tests
5 new tests:
Refs upstream issue #176 follow-up.