cpa-provider
v0.2.3
Published
CLIProxyAPI provider extension for pi with automatic model discovery
Maintainers
Readme
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 pi's bundled model catalog.
Install
pi install npm:cpa-providerGit installs are also supported:
pi install https://github.com/gcoder1991/cpa-providerRestart pi, then configure the provider:
/login cpaEnter the API key configured in CLIProxyAPI. Use /model to select a discovered model.
Configuration
The default CLIProxyAPI endpoint is:
http://127.0.0.1:8317Override it before starting pi:
CPA_BASE_URL=http://127.0.0.1:8317 piFor non-interactive authentication:
CPA_API_KEY=your-api-key piBoth variables can be used together:
CPA_BASE_URL=https://cpa.example.com CPA_API_KEY=your-api-key piFast mode
Toggle OpenAI Fast mode for CPA requests:
/cpa-fast on
/cpa-fast off
/cpa-fast status
/cpa-infoTo enable it at startup:
CPA_FAST_MODE=1 piFast mode sends service_tier: "priority", the backward-compatible name for OpenAI Fast mode. OpenAI/Codex text models use /v1/responses; other discovered models keep /v1/chat/completions.
Model metadata
/v1/models normally returns model IDs but not capability metadata. Known IDs are matched against the model catalog bundled with pi, without additional network requests, 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 --extensionsRemove
pi remove npm:cpa-provider