Skip to content

fix: Update MiniMax API endpoint to China version (api.minimaxi.com)#188

Open
richardiitse wants to merge 2 commits into
1jehuang:masterfrom
richardiitse:fix/minimax-cn-endpoint
Open

fix: Update MiniMax API endpoint to China version (api.minimaxi.com)#188
richardiitse wants to merge 2 commits into
1jehuang:masterfrom
richardiitse:fix/minimax-cn-endpoint

Conversation

@richardiitse
Copy link
Copy Markdown

@richardiitse richardiitse commented May 11, 2026

Summary

  • Changed MiniMax api_base from https://api.minimax.io/v1 (international) to https://api.minimaxi.com/v1 (China)
  • Updated setup_url to point to China platform documentation
  • Fixed related test assertions and OAUTH.md documentation

Problem

MiniMax operates two separate platforms:

  • International: api.minimax.io — uses standard API keys
  • China: api.minimaxi.com — uses Token Plan API Keys (sk-cp-... prefix)

The current code points to the international endpoint, causing 401 Unauthorized errors 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 constant
  • src/provider_catalog_tests.rs — Integration test
  • OAUTH.md — Provider documentation

View in Codesmith
Need help on this PR? Tag @codesmith with what you need.

  • Let Codesmith autofix CI failures and bot reviews

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant