@@ -0,0 +1,68 @@
1+# ChatGPT/Codex subscription auth notes
2+
3+mini-coder does **not** currently support logging in with a ChatGPT Plus/Pro/Codex subscription.
4+
5+## Why
6+
7+We looked at two implementations:
8+
9+- OpenCode in `/tmp/opencode-src`
10+- official Codex in `/tmp/openai-codex/codex-rs`
11+
12+Both rely on OpenAI **first-party/private** auth and backend APIs rather than a documented public developer API.
13+
14+## What those implementations do
15+
16+### Auth
17+
18+They use OAuth-like flows against `https://auth.openai.com`, including:
19+
20+- browser login with PKCE and a localhost callback server
21+- device-code / headless login
22+- refresh tokens via `POST /oauth/token`
23+
24+Both also rely on a hardcoded first-party client id embedded in their source trees.
25+
26+Examples:
27+
28+- official Codex: `/tmp/openai-codex/codex-rs/core/src/auth.rs`
29+- OpenCode: `/tmp/opencode-src/packages/opencode/src/plugin/codex.ts`
30+
31+### Runtime API
32+
33+After login, requests are sent to ChatGPT backend endpoints such as:
34+
35+- `https://chatgpt.com/backend-api/codex`
36+- `https://chatgpt.com/backend-api/codex/responses`
37+
38+with headers like:
39+
40+- `Authorization: Bearer <oauth access token>`
41+- `ChatGPT-Account-Id: <account id>`
42+
43+Examples:
44+
45+- official Codex: `/tmp/openai-codex/codex-rs/core/src/model_provider_info.rs`
46+- official Codex headers: `/tmp/openai-codex/codex-rs/backend-client/src/client.rs`
47+- OpenCode rewrite layer: `/tmp/opencode-src/packages/opencode/src/plugin/codex.ts`
48+
49+## Why mini-coder is not adopting this
50+
51+- It depends on undocumented/private auth endpoints.
52+- It depends on a hardcoded first-party client id.
53+- It depends on private ChatGPT backend routes.
54+- Browser login would require running a local callback server.
55+- Even the official Codex source does not expose a clean public API-based alternative here.
56+
57+## Future stance
58+
59+We may revisit support if OpenAI exposes a stable, documented path for:
60+
61+- ChatGPT subscription login for third-party tools, or
62+- a public Codex/ChatGPT backend API intended for external clients
63+
64+Until then, mini-coder only supports providers with clearer public integration paths.
65+
66+## Note
67+
68+If you want a supported hosted integration instead of ChatGPT subscription auth, mini-coder already supports OpenCode Zen via `OPENCODE_API_KEY`. See the existing `zen/<model>` provider path.