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

# Connect Pi Coding Agent to APIONE

> Configure a custom provider and API Key for Pi.

## Install

Install the current Pi package using a supported Node.js version:

```bash theme={null}
npm install -g @earendil-works/pi-coding-agent
pi --version
export APIONE_API_KEY="YOUR_APIONE_KEY"
```

## Register the provider and model

Merge the following into `~/.pi/agent/models.json`:

```json theme={null}
{
  "providers": {
    "apione": {
      "baseUrl": "https://api.apione.ai/v1",
      "api": "openai-completions",
      "apiKey": "$APIONE_API_KEY",
      "models": [
        {"id": "YOUR_APIONE_MODEL_ID", "name": "APIONE model"}
      ]
    }
  }
}
```

Replace the model placeholder. apiKey references an environment variable that must be available to the Pi process. Add further models to the models array as needed.

## Select and test

```bash theme={null}
pi --list-models apione
pi --provider apione --model YOUR_APIONE_MODEL_ID
```

You can also run `/model` inside Pi. Verify text generation, directory reading, and coding tasks separately.

## Authentication

This guide uses an APIONE API Key. Another service's OAuth extension, browser authorization, and automatic model discovery do not become APIONE features by changing the provider name. Register models explicitly in this configuration and manage keys in the APIONE console.

For missing models, check JSON syntax, the provider name, and models array. For 401, check the exported variable. For tool errors, check the protocol and model capabilities.

***

[Integration directory](https://apione.ai/docs/en/guides/clients.md) · [Choose a model](https://apione.ai/docs/en/models/catalog.md) · [Troubleshooting](https://apione.ai/docs/en/support/errors.md)


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