@adeildo/pi-providers
Provider features for Pi. Bills Anthropic OAuth requests to the Claude Pro or Max plan, keeps several accounts per provider, keeps the prompt cache warm while you are away, and adds OpenAI-compatible endpoints from /login.
Package details
Install @adeildo/pi-providers from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@adeildo/pi-providers- Package
@adeildo/pi-providers- Version
6.0.0- Published
- Nov 2, 2026
- Downloads
- 3,286/mo · 908/wk
- Author
- adeildo
- License
- MIT
- Types
- extension
- Size
- 170.5 KB
- Dependencies
- 1 dependency · 3 peers
Pi manifest JSON
{
"extensions": [
"./src/index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
Get more out of the plans and accounts you already have: bill pi to your Claude plan, keep several accounts per provider, keep the prompt cache warm while you are away, and add any OpenAI-compatible endpoint.
Your Claude plan
With a Claude Pro or Max plan connected through /login anthropic, pi's requests count as extra usage, billed by the token. With this package, they come out of the plan instead, the way Claude Code's requests do.
[!WARNING] This works by presenting pi to Anthropic as Claude Code, and using a subscription outside Claude Code may break Anthropic's terms. It is on as soon as you install the package. To turn it off, switch the
subscriptionfeature off inpi config. Requests that use an API key go out unchanged.
Once the plan pays, pi's warning about extra usage is wrong. Turn it off in ~/.pi/agent/settings.json:
{ "warnings": { "anthropicExtraUsage": false } }
Several accounts
Keep more than one account per provider, such as a work one and a personal one.
| Where | What you do |
|---|---|
/accounts |
List the accounts of the current provider, with what each plan has left |
Enter |
Use the account under the cursor |
a, r, d |
Add, rename or remove an account |
Alt+A |
Switch the account of this session |
When an account hits its limit, pi can ask you, switch to the next account on its own, or stop. accounts.onLimit decides, and it asks by default. A switch only happens before anything was shown, so you never see the same answer twice.
A warm prompt cache
Anthropic keeps a prompt in cache for 5 minutes. While the agent waits for you, pi can send the last request again before then, so your next message reads the prompt from the cache instead of paying to write it again. On Opus 5.5, a refresh costs 5% of the input price, and a miss costs 125%.
By default, this package learns how long you usually take to answer, and refreshes only while that pays for itself. That keeps Opus 5.5 warm for about 23 minutes. Turn on pi's cacheWarming setting (idle) to use it.
OpenAI-compatible endpoints
Add DeepInfra, a vLLM box, an Ollama server or any endpoint that speaks OpenAI's chat completions. In /login, pick Sign in with an API key, then OpenAI-compatible endpoint, and give it a name, a base URL and a key. Its chat models then show up in /model.
Settings
These are in ~/.pi/agent/extensions/pi-harness/settings.json, and on the Providers tab of Alt+S.
| Key | Default | What it does |
|---|---|---|
accounts.onLimit |
"ask" |
What a quota or rate limit does when you have another account: ask, switch or stop |
accounts.onAuthFailure |
"ask" |
What a refused credential does: ask (sign in again or switch), switch or stop |
cache.strategy |
"learned" |
How refreshes are decided: learned, pi, minutes or off |
cache.upTo |
20 |
How many minutes minutes keeps refreshing after the last request |
Learn more
- How it works: what Anthropic checks before it bills the plan, accounts in detail, how the cache refresh is decided, and how endpoints are read.
- Quota: where the numbers about what your plan has left come from.
The Claude plan billing comes from pi-claude-max, and several accounts per provider follow pi-multiprovider. Both are MIT.