docs(provider): MiniMax dual-endpoint auto-switch + regression (#141)#176
Open
quangdang46 wants to merge 1 commit into
Open
docs(provider): MiniMax dual-endpoint auto-switch + regression (#141)#176quangdang46 wants to merge 1 commit into
quangdang46 wants to merge 1 commit into
Conversation
…n test Issue #141 (upstream PR #188) reports that MiniMax China Token Plan users get 401 authorized_error because the international endpoint is hit with a Token Plan key. Upstream's fix flips the default `api_base` from `api.minimax.io` to `api.minimaxi.com`. Our fork already handles this differently and better: the resolver (`apply_profile_key_based_endpoint_overrides`) auto-routes any `sk-cp-*` API key to the China base URL (`MINIMAX_CHINA_API_BASE`) without changing the default for international users. Mechanically porting upstream's flip would regress everyone whose key does not start with `sk-cp-`. This change: - Updates OAUTH.md MiniMax section to document the dual-endpoint behavior so users see exactly which base URL their key resolves to, and explicitly calls out that `sk-cp-...` keys auto-route to `api.minimaxi.com`. - Adds a regression test `minimax_token_plan_keys_route_to_china_even_when_openai_api_key_env_is_international` that pins down the exact 401 scenario from the issue: an unrelated international `OPENAI_API_KEY` exported in env must NOT pull the resolution back to `.io` when a real `sk-cp-*` key is the one actually being used. Defaults in `MINIMAX_PROFILE` are intentionally left unchanged. Refs #141
1 task
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
Documents and pins down our forks dual-endpoint behavior for MiniMax,
which already addresses the underlying user complaint in
issue #141 (#141)
without the regression cost of upstreams approach.
Background
MiniMax operates two separate platforms:
https://api.minimax.io/v1https://api.minimaxi.com/v1sk-cp-...Upstream PR 1jehuang#188 fixes the
reported
401 authorized_errorfor China Token Plan users by flippingthe default
MINIMAX_PROFILE.api_baseto the China URL.This forks resolver
(
apply_profile_key_based_endpoint_overridesincrates/jcode-provider-metadata/src/provider_catalog.rs) already auto-routes anysk-cp-*API keyto
MINIMAX_CHINA_API_BASEwithout changing the default forinternational users. Mechanically porting upstreams flip would
regress every non-
sk-cp-*MiniMax user. So we deviate.Changes
both endpoints, the
sk-cp-*auto-switch, and the matching docsURL for each platform. This is the user-visible piece that closes
the gap behind the original
401reports.minimax_token_plan_keys_route_to_china_even_when_openai_api_key_env_is_international— pins down the exact failure scenario from the issue: an unrelated
international
OPENAI_API_KEYset in env must NOT pull theresolution back to
.iowhen a realsk-cp-*key is the one beingused.
Tests
The pre-existing
minimax_token_plan_keys_resolve_to_china_endpoint_without_changing_international_defaultplus the new regression test together lock the contract.
Acceptance criteria
sk-cp-...) hitapi.minimaxi.com—pinned by both tests.
api.minimax.io— pinned by thepre-existing test.
OPENAI_API_KEYin env cannot poison the resolution— pinned by the new test.
auto-switch.
Notes / deviations from upstream
MINIMAX_PROFILE.api_basefrom.ioto.com.Upstream PR feat(tui/clipboard): multi-backend copy with OSC 52 fallback (#65) #188 makes that change unconditionally, which would
break international users whose keys do not start with
sk-cp-. Ourfork already routes by key prefix, which is strictly more correct.
api_key_envfromOPENAI_API_KEYtoMINIMAX_API_KEYhere; that is a separate breaking change andshould be its own PR if desired.
Refs upstream PR 1jehuang#188 by @richardiitse.