Commit 507b89e
committed
docs(provider): clarify MiniMax dual-endpoint auto-switch + regression test
Issue #141 (upstream PR #188) reports that MiniMax China Token Plan
users get 401 authorized_error because the international endpoint is
hit with a Token Plan key. Upstream's fix flips the default
`api_base` from `api.minimax.io` to `api.minimaxi.com`.
Our fork already handles this differently and better: the resolver
(`apply_profile_key_based_endpoint_overrides`) auto-routes any
`sk-cp-*` API key to the China base URL (`MINIMAX_CHINA_API_BASE`)
without changing the default for international users. Mechanically
porting upstream's flip would regress everyone whose key does not
start with `sk-cp-`.
This change:
- Updates OAUTH.md MiniMax section to document the dual-endpoint
behavior so users see exactly which base URL their key resolves to,
and explicitly calls out that `sk-cp-...` keys auto-route to
`api.minimaxi.com`.
- Adds a regression test
`minimax_token_plan_keys_route_to_china_even_when_openai_api_key_env_is_international`
that pins down the exact 401 scenario from the issue: an unrelated
international `OPENAI_API_KEY` exported in env must NOT pull the
resolution back to `.io` when a real `sk-cp-*` key is the one
actually being used.
Defaults in `MINIMAX_PROFILE` are intentionally left unchanged.
Refs #1411 parent e1886bb commit 507b89e
2 files changed
Lines changed: 37 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
269 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
270 | 275 | | |
271 | | - | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
272 | 282 | | |
273 | 283 | | |
274 | 284 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
132 | 157 | | |
133 | 158 | | |
134 | 159 | | |
| |||
0 commit comments