fix: Update MiniMax API endpoint to China version (api.minimaxi.com)#188
Open
richardiitse wants to merge 2 commits into
Open
fix: Update MiniMax API endpoint to China version (api.minimaxi.com)#188richardiitse wants to merge 2 commits into
richardiitse wants to merge 2 commits into
Conversation
Change api_base from https://api.minimax.io/v1 to https://api.minimaxi.com/v1 to support Chinese Token Plan API Keys (sk-cp-...). The international endpoint (api.minimax.io) and China endpoint (api.minimaxi.com) are separate platforms with non-interchangeable API keys. Also update setup_url and documentation to point to China platform.
The auth/external.rs maps MINIMAX_API_KEY to the minimax provider, but the profile was using OPENAI_API_KEY, causing credential lookup mismatch. Align the profile with the external auth mapping.
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.
Summary
api_basefromhttps://api.minimax.io/v1(international) tohttps://api.minimaxi.com/v1(China)setup_urlto point to China platform documentationProblem
MiniMax operates two separate platforms:
api.minimax.io— uses standard API keysapi.minimaxi.com— uses Token Plan API Keys (sk-cp-...prefix)The current code points to the international endpoint, causing
401 Unauthorizederrors when users try to use China Token Plan API Keys.Evidence
Error response when using wrong endpoint:
{ "type": "error", "error": { "type": "authorized_error", "message": "login fail: Please carry the API secret key in the 'Authorization' field of the request header (1004)", "http_code": "401" } }Official documentation confirms China endpoint: https://platform.minimaxi.com/docs/llms.txt
Files Changed
crates/jcode-provider-metadata/src/lib.rs— Core profile constantsrc/provider_catalog_tests.rs— Integration testOAUTH.md— Provider documentationNeed help on this PR? Tag
@codesmithwith what you need.