@cortexkit/pi-openai-auth 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -42
- package/dist/index.d.ts +56 -743
- package/dist/index.js +28 -29
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -1,53 +1,19 @@
|
|
|
1
1
|
# @cortexkit/pi-openai-auth
|
|
2
2
|
|
|
3
|
-
Pi package
|
|
3
|
+
The Pi package of [CortexKit OpenAI Auth](https://github.com/cortexkit/openai-auth). It overrides Pi's built-in `openai-codex` provider so Pi can use a ChatGPT Plus or Pro subscription through the OpenAI Codex backend, with several accounts and sticky routing, usage limits per account and optional Claustrum vault integration. The OpenCode package is [`@cortexkit/opencode-openai-auth`](https://www.npmjs.com/package/@cortexkit/opencode-openai-auth).
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
This package is part of the CortexKit OpenAI Auth monorepo, which supports both OpenCode (`@cortexkit/opencode-openai-auth`) and Pi (`@cortexkit/pi-openai-auth`).
|
|
5
|
+
> This plugin is not affiliated with or endorsed by OpenAI. Using a subscription this way may be against OpenAI's terms, and OpenAI may limit or suspend accounts. You use it at your own risk; the authors accept no responsibility for any action the provider takes.
|
|
8
6
|
|
|
9
7
|
## Install
|
|
10
8
|
|
|
11
|
-
Requires Pi 1.0.1 or newer.
|
|
12
|
-
|
|
13
|
-
Install with Pi's package manager:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
pi install npm:@cortexkit/pi-openai-auth@1.0.3
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
For an unpinned install:
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
pi install npm:@cortexkit/pi-openai-auth
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
To try it for one run without changing Pi settings:
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
pi -e npm:@cortexkit/pi-openai-auth
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
Restart Pi after installing, then authenticate through Pi's normal login flow:
|
|
32
|
-
|
|
33
|
-
```text
|
|
34
|
-
/login openai-codex
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## Commands
|
|
38
|
-
|
|
39
|
-
The extension registers one command in Pi, `openai`, which opens a menu: Accounts (add a fallback account via OAuth, disable, enable, move or remove one), Quota (check now), Routing (`ordered`, `main-first`, `fallback-first`, `sticky-balanced`, and the roster order), Limits (the killswitch and per-account floors), Pi login (the quota of the account you signed in to Pi with, routed as `main`), This session (clear the session's pin) and Vault.
|
|
40
|
-
|
|
41
|
-
The Vault section connects Pi to a [Claustrum](https://github.com/cortexkit/claustrum) vault: Connect proposes the enrollment `openai-auth-pi` and shows the `ck auth enroll approve --request-id <id>` and `ck auth grant --principal enrolled:openai-auth-pi --selector-kind category --selector openai-native --operation read` commands to run; Pi tells you when the approval lands. While Pi is connected (vault mode), the OpenAI accounts the vault serves it are the only ones routed, each request fetching its token from the vault; Pi's own login and the pool are neither used, refreshed nor polled. The provider and model names stay the same: use `openai-codex/<model>` in either mode. Before Pi reloads auth, the plugin saves Pi's original login in an owner-only stash under its vault state directory and puts a non-secret placeholder in Pi's `auth.json`, so Pi cannot refresh that login while the vault serves. Disconnect restores the original entry and forgets Pi's vault token. If a new Pi login was added while connected, disconnect reports a conflict and keeps both the new login and the stashed original without overwriting either. Each vault account can be disabled or enabled on Pi alone.
|
|
42
|
-
|
|
43
|
-
## How requests are routed
|
|
44
|
-
|
|
45
|
-
Every request goes out with one account's token, chosen by the routing mode:
|
|
9
|
+
Requires Pi 1.0.1 or newer. See [Install](https://github.com/cortexkit/openai-auth#install) in the repository README; installing with Pi's own package manager is described in [Configuration](https://github.com/cortexkit/openai-auth/blob/main/docs/configuration.md#installing-on-pi).
|
|
46
10
|
|
|
47
|
-
|
|
48
|
-
- `sticky-balanced` keeps each Pi session on one account, spreading sessions by remaining quota, and moves a session for good only when its account is confirmed exhausted.
|
|
11
|
+
## Documentation
|
|
49
12
|
|
|
50
|
-
|
|
13
|
+
- [Configuration](https://github.com/cortexkit/openai-auth/blob/main/docs/configuration.md#pi)
|
|
14
|
+
- [Accounts and routing](https://github.com/cortexkit/openai-auth/blob/main/docs/accounts-and-routing.md#pi)
|
|
15
|
+
- [Commands](https://github.com/cortexkit/openai-auth/blob/main/docs/commands.md#pi)
|
|
16
|
+
- [Claustrum vault](https://github.com/cortexkit/openai-auth/blob/main/docs/vault.md#pi-in-vault-mode)
|
|
51
17
|
|
|
52
18
|
## License
|
|
53
19
|
|