# CLI

Install the aio command in one line and use MozOut AI in the terminal: chat, images, videos, voice, your balance and MCP.

Updated on 17 November 2026

`aio` is the terminal command of the MozOut All in One AI. With it you chat with AI models, generate images, videos and voice, check your balance and set up the MCP server in your tools, without writing code. On this page:

- [Install](https://docs.mozout.com/cli.md): In one line, on Linux, macOS and Windows, or with npm.
- [Log in](https://docs.mozout.com/cli.md): The API key and where it is saved.
- [Commands](https://docs.mozout.com/cli.md): Balance, models, chat, generations, status and MCP, with examples.
- [Environment variables](https://docs.mozout.com/cli.md): Change the key, the models and the language without options.
- [Sandbox](https://docs.mozout.com/cli.md), [Cost](https://docs.mozout.com/cli.md) and [Errors](https://docs.mozout.com/cli.md): Free tests, credits and what to do when something fails.

## Install

`aio` is a single file with no dependencies and needs Node.js 18 or later. The current version is 1.0.0.

### Requirements

- Node.js 18 or later. Check with `node --version`. If you do not have it, install the LTS version from the official Node.js site.
- An API key with the `ai:read` and `ai:write` permissions, created in the [API Center](https://www.my.mozout.com/api-center.php?language=english&currency=1). See [Permissions](https://docs.mozout.com/permissions.md).
- AI credits or an active Coding Plan in [All in One AI](https://www.my.mozout.com/all-in-one-ai.php?language=english&currency=1), for the `prod_` key.

### Linux and macOS

```bash
curl -fsSL https://docs.mozout.com/cli/install.sh | sh
```

The installer checks the Node.js version, downloads `aio` over https, checks the SHA256 and installs it in `~/.local/bin/aio`. It never asks for `sudo`. If the `~/.local/bin` folder is not in your `PATH`, the installer shows the line to add to `~/.bashrc` or `~/.zshrc`.

### Windows

In PowerShell:

```powershell
irm https://docs.mozout.com/cli/install.ps1 | iex
```

The installer runs the same checks, installs `aio` in `%LOCALAPPDATA%\aio` and adds that folder to your user `PATH`, without administrator rights. Close and reopen any terminals that were already open.

### With npm

```bash
npm install -g https://docs.mozout.com/cli/aio-1.0.0.tgz
```

If npm asks for administrator rights to install global packages, use the installer above, which does not need them.

### Files and SHA256

All the files are in `https://docs.mozout.com/cli/`:

| File | What it is |
|---|---|
| [aio.js](/cli/aio.js) | The command, in a single file. |
| [aio-1.0.0.tgz](/cli/aio-1.0.0.tgz) | The package for npm. |
| [install.sh](/cli/install.sh) | The installer for Linux and macOS. |
| [install.ps1](/cli/install.ps1) | The installer for Windows. |
| [SHA256SUMS](/cli/SHA256SUMS) | The SHA256 sums of all the files. |

You can read the installers before running them. To check `aio.js` by hand:

```bash
curl -fsSLO https://docs.mozout.com/cli/aio.js
curl -fsSLO https://docs.mozout.com/cli/SHA256SUMS
sha256sum --ignore-missing -c SHA256SUMS
```

On macOS, use `shasum -a 256 aio.js` and compare the result with the `aio.js` line in `SHA256SUMS`.

### Update and uninstall

To update, run the install command again: the new file replaces the old one. To uninstall:

```bash
curl -fsSL https://docs.mozout.com/cli/install.sh | sh -s -- --uninstall
```

On Windows, use `& ([scriptblock]::Create((irm https://docs.mozout.com/cli/install.ps1))) -Uninstall`. If you installed with npm, use `npm uninstall -g aio-cli`. The saved key is not deleted: see [Log in](https://docs.mozout.com/cli.md).

## Log in

```bash
aio auth login
```

`aio` asks for the key (`prod_...` or `sandbox_...`) without showing it on screen, checks it with the API and saves it in `~/.config/aio/config.json`, which only your user can read. On Windows, it goes in `%APPDATA%\aio\config.json`.

- `aio auth status` shows the key in use (hidden), where it comes from, the mode and the balance.
- `aio auth logout` deletes the saved key.
- The `AIO_API_KEY` variable takes priority over the saved key. It is the simplest way on a server or in a CI pipeline.

The key never appears in the messages or errors of `aio`. The command already has the MozOut API address, `https://api.mozout.com`.

## Commands

Every command accepts `--json`, to use the response in another program, and `--help`, to see its options. `aio help` shows the full list.

### Balance

```bash
aio balance
```

Shows your AI credits and, with a Coding Plan, the points left this week and this month, the reset dates and whether credits are used when the plan points run out.

### Models

```bash
aio models --type image
aio models --search kimi
aio model moonshotai/kimi-k2.7-code
```

- `aio models` lists the models in a table, with the type, the name and the price in credits. Filter with `--type text|image|video|audio|agent` and search with `--search`.
- `aio model <id>` shows one model. For image, video and voice models, it also shows the input fields you can use with `--opt`.

### Chat

```bash
aio chat "Explain what an MX DNS record is"
aio chat "Write a slogan for a bakery" --model deepseek-ai/deepseek-v4-flash --max-tokens 300
cat prompt.txt | aio chat
aio chat
```

- The answer appears bit by bit, as the model writes it. Use `--no-stream` to get it all at once.
- `--system` gives the model instructions, for example `--system "Answer in English"`. `--max-tokens` limits the length of the answer.
- Without a prompt in quotes, the text that comes from stdin (`|`) is the prompt.
- Without a prompt or stdin, `aio chat` opens a chat in the terminal: `/reset` starts over, and `/exit` or `Ctrl+C` quits.
- At the end, `aio` shows the input and output tokens. The default model appears in `aio help chat`.

### Generate images, videos and voice

```bash
aio generate image "a lighthouse at sunset" --opt size=1024x1024 --out images/
aio generate video "waves crashing on the rocks" --model <id>
aio generate audio "Welcome to our support service" --out welcome.mp3
```

- `aio` sends the request, shows a progress indicator while it waits, downloads the files to `--out` (or the current folder) and shows the cost.
- `--opt key=value` fills in the model fields and can be repeated. See the fields with `aio model <id>`.
- `--model` chooses the model. Without it, `aio` uses the default model of each type, the same as the MCP server.
- `--no-wait` only sends the request and shows the id. `--timeout` changes the waiting time, in seconds: by default, 300 for images and voice and 900 for videos.

### Generation status

```bash
aio status <id>
aio status <id> --download --out videos/
```

Shows the status (processing, completed or failed), the model, the file addresses and the cost. With `--download`, it downloads the files of a completed generation.

### MCP

```bash
aio mcp install claude
aio mcp install codex
aio mcp install cursor
```

Shows the command or the config block to add the `mozout-ai` MCP server (`https://api.mozout.com/mcp`) to each tool, with the key hidden. For Claude Code, `aio` only runs `claude mcp add` if you confirm (or with `--yes`). For Codex and Cursor, the key comes from the `AIO_API_KEY` variable. Use `--show-key` to see the full key. What the MCP tools do is in [MCP](https://docs.mozout.com/mcp.md).

### Help and version

- `aio help` shows every command, and `aio help <command>` the options of one command.
- `aio --version` shows the version, the brand and the API address.

## Environment variables

| Variable | What it is for |
|---|---|
| `AIO_API_KEY` | The API key. It takes priority over the saved key. |
| `AIO_BASE_URL` | Another API address. You do not need to change it: by default, it is `https://api.mozout.com`. |
| `AIO_MODEL` | The `aio chat` model, when you do not use `--model`. |
| `AIO_IMAGE_MODEL`, `AIO_VIDEO_MODEL`, `AIO_AUDIO_MODEL` | The `aio generate` model of each type. |
| `AIO_LANG` | The language of the messages: `pt` or `en`. Without it, `aio` follows the system `LANG`. |
| `AIO_CONFIG_DIR` | Another folder for the settings. |
| `AIO_TIMEOUT` | The waiting time for each API request, in seconds (by default, 120). |
| `AIO_POLL_SECONDS` | How many seconds `aio` waits between checks of a generation. |
| `NO_COLOR` | Turns off colors and bold in the terminal, like the `--no-color` option. |

## Sandbox

With a `sandbox_` key, `aio` works the same way, but no model is called and nothing is charged:

- `aio chat` always answers `Resposta de teste (sandbox).`
- A generation is completed at once, with a sample file and `0` credits.
- The model list, the prices and the balance are the real ones.

Use it to try the commands and your scripts. Then log in with the `prod_` key. See [Sandbox and Production](https://docs.mozout.com/api-rules.md).

## Cost

- `aio` is free. You only pay for what you use of the [AI API](https://docs.mozout.com/ai.md), at the same prices.
- `aio balance`, `aio models`, `aio model` and `aio status` do not spend credits.
- In `aio chat`, tokens are paid at the model price, as in [How chat is charged](https://docs.mozout.com/ai.md). With a Coding Plan, the plan models spend points instead of credits.
- In `aio generate`, we reserve the credits with the request, charge the real cost at the end and return the rest. A generation that fails costs nothing.

Each command counts towards the 90 requests per minute limit of the key and appears in the All in One AI history.

## Errors

`aio` shows the error in the terminal language, with the code, the HTTP status and the request id, to give to support. It exits with code `0` when all goes well, `1` when there is an error and `2` when the command is written wrong.

| Situation | What to do |
|---|---|
| There is no API key. | Run `aio auth login` or set the `AIO_API_KEY` variable. |
| The API rejected the key (`401`). | Check the key in the API Center: it may be revoked or belong to another account. |
| The key does not have `ai:read` or `ai:write` (`403`). | Create a key with both permissions. |
| There are not enough credits (`402`). | Buy credits in All in One AI or choose a cheaper model. |
| The model does not exist (`404`). | Look up the `id` with `aio models --search`. |
| You went over the requests per minute limit (`429`). | Wait a little and run the command again. |
| The generation did not finish within the waiting time. | Check it later with `aio status <id> --download`. |
| aio needs Node.js 18 or later. | Update Node.js and run the command again. |

The full list of codes is in [Errors](https://docs.mozout.com/api-rules.md).
