# MiMo Code

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

Language: en

> Use aicentos in MiMo Code — reach an OpenAI-compatible endpoint through its compatibility layer

MiMo Code supports specifying an OpenAI-compatible `base_url` in its configuration. Point it at aicentos and fill in the API Key, and MiMo Code runs on the models aicentos offers.

## Prerequisites

First create a dedicated key for MiMo Code on the console's "API Keys" page (naming it `mimo-code` makes usage easier to track).

* Console: [https://aicentos.com](https://aicentos.com)
* Create a key: [https://aicentos.com/keys](https://aicentos.com/keys)
* Wallet top-up: [https://aicentos.com/wallet](https://aicentos.com/wallet)
* Docs site: [https://docs.aicentos.com](https://docs.aicentos.com)

MiMo Code is a CLI tool, most commonly installed globally with npm; if the release package you got is a tarball, extract it and put the executable on your `PATH`.

```bash
npm install -g mimo-code
mimo --version
```

## Configuration to fill in

| Field     | Value                                              |
| --------- | -------------------------------------------------- |
| API Key   | The key created in the console                     |
| base\_url | `https://aicentos.com/v1`                          |
| model     | A model name from the Model Gallery in the console |

## Setup steps

Environment variables are recommended for the best compatibility:

```bash
export MIMO_BASE_URL="https://aicentos.com/v1"
export MIMO_API_KEY="sk-your-Key"
export AICENTOS_API_KEY="$MIMO_API_KEY"
export MIMO_MODEL="gpt-4o"
```

To persist them, write the exports into `~/.zshrc` or `~/.bashrc`, then run `source ~/.zshrc`.

If you prefer a configuration file, edit `~/.mimo/config.json`:

```json
{
  "baseUrl": "https://aicentos.com/v1",
  "apiKey": "sk-your-Key",
  "model": "gpt-4o"
}
```

Note that different versions may name the configuration keys differently (`base_url` / `baseUrl`) and use different environment variable prefixes (`MIMO_` / `MIMOCODE_`). If the variable names above have no effect, check `mimo --help` or the official documentation for the names your version actually reads instead of trial and error.

## Test

After configuring, run `mimo` directly and send a simple prompt. On an authentication error, check first whether the environment variable names are recognized by your version, whether `base_url` stops at `/v1`, and whether the key has stray spaces.

## Notes

* Some versions validate `base_url` against the built-in official endpoint at startup; if you notice the configuration being ignored, switching to environment variables usually works around it.
* Enter the Base URL only up to `/v1`.
* Before filling in a model name, verify it is visible with `curl https://aicentos.com/v1/models -H "Authorization: Bearer $AICENTOS_API_KEY"`.
* When environment variables and the configuration file are both present, precedence differs across versions — keep only one configuration method.