# \[Bug\]: MiniMax Code sign-in always opens the Mainland China login host \(agent.minimaxi.com\) with no Global region or API key option · Issue \#17601 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/issues/17601)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: backlog

Priority: 0

## Description

[Discussion and activity](https://git.cafe/pingdotgg/t3code/issues/17601)

---

## Summary

The **MiniMax Code** provider sign-in in T3 Code always opens the **Mainland China** login host (`agent.minimaxi.com`). There is no way to select the **Global** region (`agent.minimax.io`), and no way to paste an API key instead of using OAuth.

For users with a global MiniMax account this makes the provider effectively unusable: the OAuth flow sends them to a regional platform where their account does not exist.

## Steps to reproduce

1. Open the **Add provider** dialog.
2. Select the **MiniMax Code** provider and continue to the **Sign in** step.
3. T3 Code opens a browser to the Mainland login host.

The URL printed in the terminal pane is:

```
https://agent.minimaxi.com/login?sso=1&target=mcode-internal&callback_port=5007&callback_state=<redacted>&download_source=mcode-internal
```

The `callback_state` value is a per-session token and has been redacted. The shape of the URL is what matters for this report.

## Expected behaviour

Either of the following would resolve this:

1. **A region selector** in the sign-in step, defaulting to Global and falling back to an explicit choice for Mainland accounts.
2. **An API key option**, so a user with a global key can paste it directly and skip the regional OAuth flow entirely.

MiniMax already exposes both in its own tooling, so there is prior art to follow.

### The `mcode` CLI already has the exact flag

From the official [MiniMax Agent docs](https://agent.minimax.io/docs/cli/configuration):

> The default region is mainland China; pass `--region global` for a Global account.

```bash
mcode login                  # mainland China account
mcode login --region global  # global account
mcode acp login --region <region>
```

T3 Code's MiniMax Code provider is driving exactly this CLI (`target=mcode-internal`), and it is invoking the login step as if every account were a Mainland one.

### The API key path is documented too

```bash
export MCODE_PROVIDER_API_KEY="your MiniMax API key"
mcode provider set-minimax-key
# optionally: --api-key-env <name> to read a different variable
```

The sibling `mmx` CLI has the same shape: `mmx auth login --recommend --region=global|cn` and `mmx auth login --api-key sk-xxxxx`.

## Regional hosts

MiniMax runs two fully separate backends that do not share credentials or endpoints. A key from one region will not authenticate against the other's host.

| Role | Global | Mainland China |
|---|---|---|
| Platform | `platform.minimax.io` | `platform.minimaxi.com` |
| Agent / login host | `agent.minimax.io` | `agent.minimaxi.com` |
| Account / OAuth host | `account.minimax.io` | `account.minimaxi.com` |
| API host | `api.minimax.io` | `api.minimaxi.com` |

Worth noting there are **two** distinct host families, not one. The `agent.*` hosts serve the mcode agent login and the coding-plan usage endpoint (`GET /v1/api/openplatform/coding_plan/remains`), while `account.*` hosts serve the OAuth device-code exchange (`/oauth2/device/code`). `agent.minimax.io/login` returns 200 and mirrors the endpoint T3 Code currently calls, so it is the closest drop-in for a global login. Because the region is a property of the stored credential rather than a global setting, whichever region the sign-in uses has to be consistent with the API host used afterwards.

## Notes

- Both hosts return HTTP 200, so this is not a broken link. It silently routes international users to the wrong regional login rather than surfacing an error, which is likely why it has gone unnoticed.
- The URL parameters (`download_source=mcode-internal`, `callback_port=5007`) suggest the host is resolved through T3 Connect rather than hardcoded in the app. Grepping the shipped macOS bundle for `agent.minimax*`, `account.minimax*`, `api.minimax*` and `platform.minimax*` returns **no matches**, and a codebase search for `agent.minimaxi` returns nothing either. Flagging this in case it points at where the fix belongs.
- Other providers in the dialog appear to support both OAuth and API key entry, which makes MiniMax Code the outlier here.

## Environment

| | |
|---|---|
| T3 Code | `0.0.46-nightly.20261009.2873` |
| Platform | macOS (Apple Silicon), T3 Code desktop |
| Provider | MiniMax Code (`mcode-internal`) |
| Account | Global region (`minimax.io`) |

