> ## 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.

# Pi Coding Agent 接入 APIONE

> 使用自定义 Provider 和 API Key 配置 Pi。

## 安装客户端

安装当前 Pi Coding Agent 包，并按包的要求准备 Node.js 环境：

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

## 登记提供商与模型

在 `~/.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"}
      ]
    }
  }
}
```

将模型占位符替换为实际 ID。apiKey 使用环境变量引用；启动 Pi 的进程必须能够读取该变量。需要多个模型时，在 models 数组逐个添加。

## 选择并测试

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

也可以进入 Pi 后运行 `/model` 选择模型。先验证简单对话，再测试目录读取和代码任务。

## 认证方式说明

本教程使用 APIONE API Key。其他服务商的 OAuth 扩展、浏览器授权地址和自动模型发现功能不会因修改提供商名称而变成 APIONE 功能。当前配置需要自行登记模型；密钥失效时在 APIONE 控制台更新。

模型未显示时检查 JSON 格式、provider 名称及 models 数组。401 时检查变量是否导出；工具错误时检查模型能力与协议。

***

[返回集成目录](https://apione.ai/docs/guides/clients.md) · [模型选择](https://apione.ai/docs/models/catalog.md) · [错误排查](https://apione.ai/docs/support/errors.md)


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