Skip to content

Conversation

@theglove44
Copy link

@theglove44 theglove44 commented Jan 23, 2026

Problem

MiniMax API usage fetches always target api.minimaxi.com, even when the provider is configured for the global (.io) stack. For sk-cp- keys tied to .io, this results in MiniMax credentials are invalid or expired. In the UI, MiniMax shows minimax.api (api) available error=MiniMax credentials are invalid or expired. and minimax.web (web) unavailable, which then surfaces No available fetch strategy for minimax.

Investigation

  • MiniMaxUsageFetcher hard-coded https://api.minimaxi.com/v1/api/openplatform/coding_plan/remains.
  • The MiniMax region setting is used for web requests but not the API token path.
  • With a .io key, the API request is sent to the .com host and fails authentication.

Example (debug pane):

  • minimax.api (api) available error=MiniMax credentials are invalid or expired.
  • minimax.web (web) unavailable
  • Menu card: No available fetch strategy for minimax.

Proposed solution

  • Add region-aware API base URLs (api.minimax.io vs api.minimaxi.com).
  • Use the region’s API base when fetching coding plan remains.
  • Pass the MiniMax region from settings into the API fetch strategy.

Changes

  • MiniMaxAPIRegion adds apiBaseURLString and apiRemainsURL.
  • MiniMaxUsageFetcher.fetchUsage(apiToken:) now uses region.apiRemainsURL.
  • MiniMaxAPIFetchStrategy passes the configured region into the API fetcher.

Testing

  • ./Scripts/compile_and_run.sh failed on this machine due to Swift toolchain/SDK mismatch (SwiftBridging redefinition; SDK built with a different Swift version).
  • pnpm check failed because swiftformat is not installed on PATH.

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