cpa-provider

内容来源:README.md(说明文档) · 原始地址 · 查看安装指南

原始内容

cpa-provider

CLIProxyAPI provider extension for pi.

The extension reads the OpenAI-compatible /v1/models endpoint, registers the returned models in pi, and enriches known model IDs with context limits, reasoning support, image input, and output limits from the pi.dev model catalog.

Install

pi install npm:cpa-provider

Git installs are also supported:

pi install https://github.com/gcoder1991/cpa-provider

Restart pi, then configure the provider:

/login cpa

Enter the API key configured in CLIProxyAPI. Use /model to select a discovered model.

Configuration

The default CLIProxyAPI endpoint is:

http://127.0.0.1:8317

Override it before starting pi:

CPA_BASE_URL=http://127.0.0.1:8317 pi

For non-interactive authentication:

CPA_API_KEY=your-api-key pi

Both variables can be used together:

CPA_BASE_URL=https://cpa.example.com CPA_API_KEY=your-api-key pi

Model metadata

/v1/models normally returns model IDs but not capability metadata. Known IDs are matched against pi.dev catalogs for:

  • context window
  • maximum output tokens
  • reasoning support
  • image input support
  • pricing metadata

Unknown IDs remain available with conservative defaults: 128K context, 16K maximum output, text-only input, and reasoning disabled.

Update

pi update --extensions

Remove

pi remove npm:cpa-provider