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

# Pi

> Install Pi and configure Floodgate models.

Pi supports custom OpenAI-compatible providers through `models.json`.

## 1. Install Pi

```bash theme={null}
npm install -g --ignore-scripts @earendil-works/pi-coding-agent
```

Check the installation:

```bash theme={null}
pi --version
```

## 2. Set your API key

```bash theme={null}
export FLOODGATE_API_KEY="YOUR_API_KEY"
```

PowerShell:

```powershell theme={null}
$env:FLOODGATE_API_KEY = "YOUR_API_KEY"
```

## 3. Add Floodgate models

Create or edit `~/.pi/agent/models.json`:

```json theme={null}
{
  "providers": {
    "floodgate": {
      "baseUrl": "https://api.floodgate.dev/v1",
      "api": "openai-completions",
      "apiKey": "$FLOODGATE_API_KEY",
      "authHeader": true,
      "models": [
        { "id": "gpt-6-sol", "name": "GPT-6 Sol" },
        { "id": "gpt-6-astra", "name": "GPT-6 Astra" },
        { "id": "gpt-6-luna", "name": "GPT-6 Luna" },
        { "id": "claude-opus-5-5", "name": "Claude Opus 5.5" },
        { "id": "claude-opus-5", "name": "Claude Opus 5" },
        { "id": "deepseek-v4.1-flash", "name": "DeepSeek V4.1 Flash" },
        { "id": "kimi-k3", "name": "Kimi K3" }
      ]
    }
  }
}
```

`openai-completions` is the standard and most reliable Pi API mode for Floodgate.

## 4. Run Pi

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

Use `/model` or press `Ctrl+L`, then select a model under **floodgate**. Pi reloads `models.json` whenever you open the model picker.

Run a one-shot task:

```bash theme={null}
pi -p "Explain the architectural flow of this repository"
```


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