# pi
URL: https://docs.munito.ai/sandboxes/cloud-agents/pi

For files on your computer, use the [local pi guide](https://docs.munito.ai/agents/pi).

## Install the CLI [#install-the-cli]

```bash
npm install -g @munitoai/cli
```

The command is `munito`. See [the command line tool](https://docs.munito.ai/cli).

## One command [#one-command]

```bash
munito agent pi "fix the failing test"
```

It creates the sandbox, runs the task and applies the patch back. The `agent`
[template](https://docs.munito.ai/sandboxes/templates) carries pi and our provider package, so there is nothing to install.
pi reads the key from `MUNITO_API_KEY`.

## Through the API [#through-the-api]

```bash
curl -sS --fail-with-body https://api.munito.ai/sandboxes/v1/sandboxes \
  -H "Authorization: Bearer $MUNITO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"template": "agent", "agent": "pi", "internet": true,
       "env": {"MUNITO_API_KEY": "'"$MUNITO_API_KEY"'"}}'
```

Then run a task with `pi --print --model munito/zai-org/glm-5.3-flash "<task>"` through
[a command](https://docs.munito.ai/sandboxes/commands).

- `--print` processes the prompt and exits.
- `--model munito/<id>` names the provider and the model. `pi --list-models munito` lists yours.
- For the EU host, use `munito-eu/`. See [Regions](https://docs.munito.ai/regions).

## The terminal UI [#the-terminal-ui]

```bash
munito ssh <sandbox id>
pi
```

Pick a model with `/model`, such as `munito/zai-org/glm-5.3-flash`. To keep the session through a disconnect,
`apt-get install -y tmux` and start pi in it.
