@cortexkit/opencode-openai-auth 0.9.1 → 0.10.0
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 +4 -6
- package/dist/index.js +48 -63
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
ChatGPT Plus/Pro OAuth support for [OpenCode](https://opencode.ai).
|
|
4
4
|
|
|
5
|
-
This OpenCode plugin lets OpenCode talk to the OpenAI Codex backend using a ChatGPT Plus/Pro subscription instead of a pay-as-you-go API key. It rewrites OpenCode's outbound OpenAI requests into Codex's request shape, filters the model list to OAuth-eligible models, zeroes provider costs for those models
|
|
5
|
+
This OpenCode plugin lets OpenCode talk to the OpenAI Codex backend using a ChatGPT Plus/Pro subscription instead of a pay-as-you-go API key. It rewrites OpenCode's outbound OpenAI requests into Codex's request shape, filters the model list to OAuth-eligible models, and zeroes provider costs for those models.
|
|
6
6
|
|
|
7
7
|
The plugin registers the built-in `openai` provider id. OpenCode loads external plugins after its built-ins, so this package supersedes OpenCode's internal OpenAI auth hook without any change to your model configuration.
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ The plugin registers the built-in `openai` provider id. OpenCode loads external
|
|
|
10
10
|
|
|
11
11
|
```json
|
|
12
12
|
{
|
|
13
|
-
"plugin": ["@cortexkit/opencode-openai-auth@0.
|
|
13
|
+
"plugin": ["@cortexkit/opencode-openai-auth@0.10.0"]
|
|
14
14
|
}
|
|
15
15
|
```
|
|
16
16
|
|
|
@@ -25,7 +25,6 @@ Restart OpenCode after changing plugin config, then authenticate:
|
|
|
25
25
|
- ChatGPT Plus/Pro OAuth login (browser and headless device flows), plus a manual API-key fallback.
|
|
26
26
|
- Codex request rewriting for OAuth requests, with Codex identity parity.
|
|
27
27
|
- OAuth model filtering and zero-cost display.
|
|
28
|
-
- Prompt-cache stabilizer (`web_search`) that keeps tool-continuation requests on the backend's cached path (on by default).
|
|
29
28
|
- Multiple ChatGPT accounts with automatic reactive fallback on rate limits, `main-first`, `fallback-first`, or sticky-balanced routing, and a per-account quota killswitch.
|
|
30
29
|
- Per-turn quota tracking (5-hour + weekly windows) on both transports, with a sidebar readout and an explicit all-accounts refresh.
|
|
31
30
|
- Idle prompt-cache keep-warm, with an optional subagent mode and main-only sustain mode.
|
|
@@ -66,15 +65,14 @@ Settings resolve as environment variable → config file (`~/.config/opencode/op
|
|
|
66
65
|
|
|
67
66
|
| Config field | Environment variable | Default | Purpose |
|
|
68
67
|
| --- | --- | --- | --- |
|
|
69
|
-
| `webSearch` | `CORTEXKIT_OPENAI_AUTH_NO_WEB_SEARCH` (set to disable) | `true` | Inject the `web_search` prompt-cache stabilizer. |
|
|
70
68
|
| `webSockets` | `CORTEXKIT_OPENAI_AUTH_WEBSOCKETS` | `false` | Use the Codex Responses WebSocket transport instead of HTTP. |
|
|
71
69
|
| `rawWebSocket` | `CORTEXKIT_OPENAI_AUTH_RAW_WS` | `false` | Use the hand-rolled raw TCP/TLS client with Codex-style incremental streaming. Bun uses `Bun.connect`; Node/OpenCode Desktop uses `node:net`/`node:tls`. |
|
|
72
|
-
| `responsesLite` | `CORTEXKIT_OPENAI_AUTH_RESPONSES_LITE` | `false` | Send `gpt-5.6-sol`/`-terra`/`-luna` requests in Codex's Responses Lite shape, matching the Codex CLI.
|
|
70
|
+
| `responsesLite` | `CORTEXKIT_OPENAI_AUTH_RESPONSES_LITE` | `false` | Send `gpt-5.6-sol`/`-terra`/`-luna` requests in Codex's Responses Lite shape, matching the Codex CLI. |
|
|
73
71
|
| `dump` | `CORTEXKIT_OPENAI_AUTH_DUMP` | `false` | Dump final Codex request bodies for cache debugging. |
|
|
74
72
|
| `dumpDir` | `OPENCODE_OPENAI_AUTH_DUMP_DIR` | OS temp dir: `opencode-openai-auth-dumps` | Directory for request dump files. |
|
|
75
73
|
| `codexApiEndpoint` | `CORTEXKIT_OPENAI_AUTH_CODEX_ENDPOINT` | `https://chatgpt.com/backend-api/codex/responses` | Send rewritten Codex requests to a compatible proxy/relay instead of ChatGPT's backend endpoint. |
|
|
76
74
|
|
|
77
|
-
See the [repository README](https://github.com/cortexkit/openai-auth#readme) for transport differences
|
|
75
|
+
See the [repository README](https://github.com/cortexkit/openai-auth#readme) for transport differences.
|
|
78
76
|
|
|
79
77
|
`sticky-balanced` places a cold session by least projected quota pressure, then keeps its SHA-256-keyed sidebar-state pin for up to seven days. It does not rebalance mid-session or use a Retry-After hold; it migrates only after confirmed exhaustion or permanent auth failure. Stale or unknown quota is excluded from weighted placement; when the killswitch is enabled, accounts below their per-account threshold are also excluded from both weighted placement AND the mode-fallback fail-open branch — that branch otherwise orders by `resetCreditsApplicable` first, then configured order, then account id. Subagents have separate pins and reuse them when resumed.
|
|
80
78
|
|