Skip to content

fix(llm): add MiniMax global provider - #760

Merged
lizhengfeng101 merged 2 commits into
alibaba:mainfrom
moutayam:fix/minimax-global-provider
Aug 7, 2026
Merged

fix(llm): add MiniMax global provider#760
lizhengfeng101 merged 2 commits into
alibaba:mainfrom
moutayam:fix/minimax-global-provider

Conversation

@moutayam

@moutayam moutayam commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #759.

The built-in MiniMax provider currently uses the China endpoint, which rejects
keys created on the MiniMax Global platform. MiniMax Global and China use
separate account spaces and API key systems.

This change:

  • Makes minimax use https://api.minimax.io/v1 with MINIMAX_GLOBAL_API_KEY
  • Keeps minimax-cn on https://api.minimaxi.com/v1 with MINIMAX_API_KEY
  • Updates the provider registry and resolver fallback tests to lock the separate keyspaces
  • Updates localized documentation
  • Keeps the VS Code provider mirror aligned with the CLI registry so
    minimax-cn is selectable in the official provider picker

Existing China-key users currently configured with minimax must select
minimax-cn.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • Breaking change (existing China-key users configured with minimax must select minimax-cn)
  • New feature (non-breaking change that adds functionality)
  • Refactoring (no functional changes)
  • Documentation update
  • CI / Build / Tooling

How Has This Been Tested?

  • make check passes locally
  • make test passes locally
  • make build passes locally
  • Manual testing

Manual testing:

  • Configured the minimax preset with a valid MiniMax Global API key
  • Ran ocr llm test
  • Confirmed the request succeeded against the MiniMax Global endpoint

Checklist

  • My code follows the project's coding style (go fmt, go vet)
  • I have performed a self-review of the code
  • I have added or updated tests covering the provider registry
  • New and existing unit tests pass locally with my changes
  • I have updated the documentation accordingly
  • I have signed the CLA

Related Issues

Closes #759

@CLAassistant

CLAassistant commented Aug 6, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

| `mimo` | openai | `https://api.xiaomimimo.com/v1` | `MIMO_API_KEY` |
| `minimax` | openai | `https://api.minimaxi.com/v1` | `MINIMAX_API_KEY` |
| `minimax` | openai | `https://api.minimax.io/v1` | `MINIMAX_API_KEY` |
| `minimax-cn` | openai | `https://api.minimaxi.com/v1` | `MINIMAX_API_KEY` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `minimax-cn` | openai | `https://api.minimaxi.com/v1` | `MINIMAX_API_KEY` |
| `minimax-cn` | openai | `https://api.minimaxi.com/v1` | `MINIMAX_CN_API_KEY` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you named the CN API as "Minimax CN API" in the API desc, maybe you can distinguish it further.

| `mimo` | openai | `https://api.xiaomimimo.com/v1` | `MIMO_API_KEY` |
| `minimax` | openai | `https://api.minimaxi.com/v1` | `MINIMAX_API_KEY` |
| `minimax` | openai | `https://api.minimax.io/v1` | `MINIMAX_API_KEY` |
| `minimax-cn` | openai | `https://api.minimaxi.com/v1` | `MINIMAX_API_KEY` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `minimax-cn` | openai | `https://api.minimaxi.com/v1` | `MINIMAX_API_KEY` |
| `minimax-cn` | openai | `https://api.minimaxi.com/v1` | `MINIMAX_CN_API_KEY` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

| `mimo` | openai | `https://api.xiaomimimo.com/v1` | `MIMO_API_KEY` |
| `minimax` | openai | `https://api.minimaxi.com/v1` | `MINIMAX_API_KEY` |
| `minimax` | openai | `https://api.minimax.io/v1` | `MINIMAX_API_KEY` |
| `minimax-cn` | openai | `https://api.minimaxi.com/v1` | `MINIMAX_API_KEY` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `minimax-cn` | openai | `https://api.minimaxi.com/v1` | `MINIMAX_API_KEY` |
| `minimax-cn` | openai | `https://api.minimaxi.com/v1` | `MINIMAX_CN_API_KEY` |

| `mimo` | openai | `https://api.xiaomimimo.com/v1` | `MIMO_API_KEY` |
| `minimax` | openai | `https://api.minimaxi.com/v1` | `MINIMAX_API_KEY` |
| `minimax` | openai | `https://api.minimax.io/v1` | `MINIMAX_API_KEY` |
| `minimax-cn` | openai | `https://api.minimaxi.com/v1` | `MINIMAX_API_KEY` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `minimax-cn` | openai | `https://api.minimaxi.com/v1` | `MINIMAX_API_KEY` |
| `minimax-cn` | openai | `https://api.minimaxi.com/v1` | `MINIMAX_CN_API_KEY` |

@lizhengfeng101

Copy link
Copy Markdown
Collaborator

@moutayam Thanks for putting this together — clean PR and nice that you covered all four localized docs too.

One suggestion on the env var: right now both minimax and minimax-cn share MINIMAX_API_KEY, but since Global and China use separate key systems (as you noted), it'd be better to give the new global variant its own env var — something like MINIMAX_GLOBAL_API_KEY — and let minimax-cn keep the original MINIMAX_API_KEY.

This has a couple of benefits:

  1. No env var collision — users can configure both providers independently if needed, which is consistent with how we handle dashscope / dashscope-tokenplan and z-ai / z-ai-coding.
  2. Softer migration — existing China-key users won't accidentally send their key to the global endpoint. Instead of a confusing auth failure, they'd get a clear "no API key configured" error on minimax, and switching to minimax-cn would just work with their existing MINIMAX_API_KEY.

What do you think?

@moutayam

moutayam commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, agreed. I’ll update the Global preset to use MINIMAX_GLOBAL_API_KEY and keep MINIMAX_API_KEY for minimax-cn, consistently across the Go registry, VS Code provider mirror, documentation, and tests. One migration detail: saved credentials under providers.minimax.api_key take precedence over environment-variable fallback, so users with a saved China key under minimax still need to switch explicitly to minimax-cn. The environment-variable split prevents collisions for environment-variable-based configuration.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update, you have successfully dealt with the 2 clashing vars.
I just doubt if writing a single test only for MiniMax is necessary.

@wu21-web wu21-web Aug 7, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other parts look fine.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point. The resolver tests already check both MiniMax URLs and the two env-var fallbacks, so the separate registry test may be overkill. I can remove it and keep the resolver coverage if you’d prefer.

@lizhengfeng101 lizhengfeng101 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lizhengfeng101
lizhengfeng101 merged commit 73d4215 into alibaba:main Aug 7, 2026
14 checks passed
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.

Minimax built-in provider uses China endpoint; global keys get 401

4 participants