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

# Connect Pi

> Configure the Pi coding agent to use UncensoredGPT models through a custom OpenAI-compatible provider.

[Pi](https://pi.dev) is a minimal, extensible coding agent for your terminal ([documentation](https://pi.dev/docs/latest)). It connects to UncensoredGPT as a custom OpenAI-compatible endpoint in `models.json`. Setup takes about a minute.

## 1. Set your API key

Create a key in the [Console](https://console.uncensoredgpt.ai) if you don't have one, then export it:

```bash theme={null}
export UNCENSOREDGPT_API_KEY="sk-..."
```

Add the export to your shell profile (`~/.bashrc`, `~/.zshrc`, …) to make it permanent.

## 2. Add the provider to models.json

Create or edit `~/.pi/agent/models.json` (that's the default agent directory; set `PI_CODING_AGENT_DIR` if you use a custom one):

```json theme={null}
{
  "$schema": "https://pi.dev/schemas/models.schema.json",
  "providers": {
    "uncensoredgpt": {
      "baseUrl": "https://api.uncensoredgpt.ai/v1",
      "api": "openai-completions",
      "apiKey": "$UNCENSOREDGPT_API_KEY",
      "models": [
        {
          "id": "uncensoredgpt/qwen3.8-27b-uncensored",
          "name": "Qwen3.8 27B Uncensored",
          "contextWindow": 262000,
          "reasoning": true
        },
        {
          "id": "uncensoredgpt/qwen3.6-35b-a3b-uncensored",
          "name": "Qwen3.6 35B A3B Uncensored",
          "contextWindow": 262000,
          "reasoning": true
        },
        {
          "id": "uncensoredgpt/gemma4-31b-uncensored",
          "name": "Gemma4 31B Uncensored",
          "contextWindow": 131072,
          "reasoning": true
        },
        {
          "id": "uncensoredgpt/gemma4-26b-a4b-uncensored",
          "name": "Gemma4 26B A4B Uncensored",
          "contextWindow": 131072,
          "reasoning": true
        },
        {
          "id": "uncensoredgpt/uncensoredgpt",
          "name": "UncensoredGPT",
          "contextWindow": 262000,
          "reasoning": true
        },
        {
          "id": "uncensoredgpt/qwen3.8-flash-next-cybersecurity",
          "name": "Qwen3.8 Flash Next Cybersecurity",
          "contextWindow": 262000,
          "reasoning": true
        },
        {
          "id": "uncensoredgpt/deepseek-v4.1-flash-uncensored",
          "name": "DeepSeek V4.1 Flash Uncensored",
          "contextWindow": 1000000,
          "reasoning": true
        },
        {
          "id": "uncensoredgpt/glm-5.3-flash-uncensored",
          "name": "GLM 5.3 Flash Uncensored",
          "contextWindow": 1000000,
          "reasoning": true
        },
        {
          "id": "uncensoredgpt/glm-5.3-uncensored",
          "name": "GLM 5.3 Uncensored",
          "contextWindow": 1000000,
          "reasoning": true
        },
        {
          "id": "uncensoredgpt/neuralnet-free-model",
          "name": "NeuralNet Free Model",
          "contextWindow": 200000
        }
      ]
    }
  }
}
```

`apiKey: "$UNCENSOREDGPT_API_KEY"` is resolved from the environment at request time — the key itself never lands on disk.

## 3. Start Pi

```bash theme={null}
cd /path/to/your/project
pi
```

Run `/model` and the UncensoredGPT models appear in the picker. Press `Ctrl+S` on one to save it as your default.

## How model references work

Pi addresses models as `<provider>/<model-id>`. Because our model IDs already contain a slash (`uncensoredgpt/...`), the full reference has three segments:

```bash theme={null}
pi --model uncensoredgpt/uncensoredgpt/glm-5.3-flash-uncensored
```

The **first** segment is the provider key from `models.json` (`uncensoredgpt`); the **rest** is the model ID exactly as the API expects it.

## Notes

* Trim the `models` array to just the models you use.
* `contextWindow` values are the conservative per-model limits from the [coding agents overview](https://docs.uncensoredgpt.ai/api-reference/agents.md). Add `maxTokens` only if you want to cap output tokens explicitly.
* All models support tool calling and streaming, so agent features work fully.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.