# MiniMax Code

Source: https://docs.aicentos.com/en/clients/minimax-code

Language: en

> Connect aicentos in MiniMax Code (mcode) — add an OpenAI-compatible provider with provider add

MiniMax Code is MiniMax's official coding CLI (command `mcode`), with a built-in TUI, headless execution, ACP, and a TypeScript SDK. It supports BYOK: `mcode provider add` can attach any OpenAI-compatible endpoint.

## Prerequisites

First create a dedicated key for MiniMax Code in the console (naming it `minimax-code` is recommended), then install:

```bash
curl -fsSL https://filecdn.minimax.chat/public/install.sh | bash
```

npm works too:

```bash
npm install -g @minimax-ai/code@latest
mcode --version
```

## Configuration to fill in

| Field           | Value                                              |
| --------------- | -------------------------------------------------- |
| provider name   | Your choice, for example `aicentos`                |
| `--base-url`    | `https://aicentos.com/v1`                          |
| `--api-format`  | `openai-completions`                               |
| `--model`       | A model name from the Model Gallery in the console |
| `--api-key-env` | `MCODE_PROVIDER_API_KEY`                           |

## Setup steps

One command registers the provider and switches over to it:

```bash
export MCODE_PROVIDER_API_KEY="sk-your-API-Key"

mcode provider add \
  --name aicentos \
  --base-url https://aicentos.com/v1 \
  --api-format openai-completions \
  --model your-model-name \
  --api-key-env MCODE_PROVIDER_API_KEY \
  --use
```

`--use` means switch to this provider right after registering it. It writes the configuration into the `custom_provider` section of the current profile's `config.yaml` (the default data directory is `~/.minimax`); the equivalent form:

```yaml
custom_provider:
  aicentos:
    options:
      apiKey: sk-your-API-Key
      baseURL: https://aicentos.com/v1
    models:
      your-model-name: {}
```

Note that the key here is `baseURL` (capital URL), not `base-url`.

## Test

```bash
mcode exec "Introduce yourself in one sentence"
```

A response from headless means the configuration is in effect. Then run one real task in the TUI, and finally check usage back in the console.

## Notes

* Custom models need the context and output limits given explicitly (`--context-limit`, `--output-limit`); otherwise it trims by the default values and long files are easily truncated.
* The one-line install script does not support Alpine / musl; use npm in such environments.
* When relaying through the Anthropic-compatible protocol, requests still carry `x-api-key`; if the upstream only accepts `Authorization`, you need to add a translation layer yourself.
* Providers are stored **per profile**, so after switching profiles, re-confirm which one is in effect.

## Related links

* [MiniMax Code quick start](https://agent.minimax.io/docs/cli/quick-start)
* [minimax-code repository](https://github.com/MiniMax-AI/minimax-code)