Skip to content

feat: update MiniMax API endpoint to China region (api.minimaxi.com)#389

Open
socamalo wants to merge 1 commit intocampfirein:mainfrom
socamalo:feat/minimax-china-api
Open

feat: update MiniMax API endpoint to China region (api.minimaxi.com)#389
socamalo wants to merge 1 commit intocampfirein:mainfrom
socamalo:feat/minimax-china-api

Conversation

@socamalo
Copy link
Copy Markdown

Summary

Update MiniMax API base URL from api.minimax.io to api.minimaxi.com to support China region access.

Changes

  • src/agent/infra/llm/providers/minimax.ts: Update baseUrl in provider config and createGenerator
  • src/server/core/domain/entities/provider-registry.ts: Update baseUrl in PROVIDER_REGISTRY
  • src/server/infra/http/provider-model-fetcher-registry.ts: Update baseUrl in model fetcher

Testing

  • Verify MiniMax provider connection with new endpoint
  • Confirm model list fetching works

Change MiniMax API base URL from api.minimax.io to api.minimaxi.com
to support China region access.

Files updated:
- src/agent/infra/llm/providers/minimax.ts
- src/server/core/domain/entities/provider-registry.ts
- src/server/infra/http/provider-model-fetcher-registry.ts
@bao-byterover
Copy link
Copy Markdown
Collaborator

Hey, thanks for looking into this! Supporting MiniMax's China region is a great idea.

One thing worth noting: MiniMax maintains two separate regional endpoints with region-specific API keys. From their official AI Coding Tools guide:

"For international users, use https://api.minimax.io/v1; for users in China, use https://api.minimaxi.com/v1"

"Ensure the API host is set correctly based on your location"

API keys are also obtained from different platforms depending on region:

Since the current change replaces the global endpoint with the China one, existing international users would likely start seeing auth errors after updating.

Instead of swapping the default, it'd be great to support both regions. Here's what we have in mind for the user experience:

TUI (/providers flow)

When a user selects MiniMax, a region step appears before the API key prompt:

Connect to MiniMax

Choose your region:

  > Global   (api.minimax.io)
    China    (api.minimaxi.com)

After selecting a region, the flow continues as usual (API key input, model selection). The selected region determines which endpoint and platform link to show:

  • Global selected: "Get your API key at: platform.minimax.io"
  • China selected: "Get your API key at: platform.minimaxi.com"

CLI (non-interactive)

# Global (default, no extra flag needed)
brv providers connect minimax --api-key sk-xxx

# China (pass the China endpoint via --base-url)
brv providers connect minimax --api-key sk-xxx --base-url https://api.minimaxi.com/v1

Changing region later

If a user wants to switch regions, they simply reconnect via /providers or brv providers connect minimax and pick the other region. The new base URL overwrites the previous one.

Implementation notes

The infrastructure for per-provider base URLs already exists (ConnectedProviderConfig.baseUrl), so this mainly involves:

  • A region selection step in the TUI/CLI provider flow (similar to the existing auth method picker)
  • Having createGenerator in minimax.ts read from config.baseUrl instead of hardcoding the URL
  • Keeping Global as the default so existing users aren't affected

Curious to hear your thoughts. Happy to help if needed!

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.

2 participants