> ## Documentation Index
> Fetch the complete documentation index at: https://docs.inference.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Pi

> Route Pi through the Inference.net gateway with inf pi.

`inf pi` routes Pi through `https://api.inference.net/v1` using the openai-completions API. Pi uses two config files. Pi's own `auth.json` sign-in state is never touched.

## Config files

`inf` writes fields in `~/.pi/agent/models.json` and `~/.pi/agent/settings.json` (JSON, two targets). `inf` owns fields in those files, not the whole files. `auth.json` is not touched so `off` cannot sign you out of your own Pi account.

## `inf pi on`

<Metadata text="cli/coding-agents/pi/on-default[series=coding_agents_pi]" />

```bash theme={"system"}
inf pi on
```

| Flag              | Required | Description      | Default        |
| ----------------- | -------- | ---------------- | -------------- |
| `--model <alias>` | No       | Default Pi model | `kimi-k3-fast` |

See [Model mapping](/cli/coding-agents#model-mapping) for supported aliases and limits.

## What gets written

`models.json` `providers.inference` object:

| Path         | Value                          |
| ------------ | ------------------------------ |
| `name`       | `Inference.net`                |
| `baseUrl`    | `https://api.inference.net/v1` |
| `api`        | `openai-completions`           |
| `authHeader` | `true`                         |
| `apiKey`     | gateway key (secret)           |
| `models`     | array of the three aliases     |

`settings.json`:

| Path              | Value          |
| ----------------- | -------------- |
| `defaultProvider` | `inference`    |
| `defaultModel`    | selected alias |

The `glm-5.2-fast` registry entry carries `contextWindow` 262,144 and `maxTokens` 128,000.

<Metadata text="cli/coding-agents/pi/provider-json" />

```json theme={"system"}
{
  "providers": {
    "inference": {
      "name": "Inference.net",
      "baseUrl": "https://api.inference.net/v1",
      "api": "openai-completions",
      "authHeader": true,
      "apiKey": "<gateway-key>",
      "models": [
        {
          "id": "glm-5.2-fast",
          "name": "glm-5.2-fast",
          "input": ["text"],
          "contextWindow": 262144,
          "maxTokens": 128000,
          "reasoning": true
        }
      ]
    }
  }
}
```

## `inf pi status`

<Metadata text="cli/coding-agents/pi/status[series=coding_agents_pi]" />

```bash theme={"system"}
inf pi status
```

If one of the two config updates fails, `status` reports partial state.

## `inf pi off`

<Metadata text="cli/coding-agents/pi/off[series=coding_agents_pi]" />

```bash theme={"system"}
inf pi off
```

`off` restores unchanged owned fields. It keeps fields that you edited after `on`.

## Examples

Select the Fast-tier alias:

<Metadata text="cli/coding-agents/pi/on-model[series=coding_agents_pi]" />

```bash theme={"system"}
inf pi on --model glm-5.2-fast
```

Restart Pi after `on` or `off`. See [Troubleshooting](/cli/coding-agents/troubleshooting) for drift, recovery, and key revocation.
