Support ChatGPT subscription (Codex OAuth) as a model provider — pi-ai already ships the client #83
kei-tenkawa
started this conversation in
Ideas
Replies: 1 comment
|
Would this design be generalized for other subscription providers ? |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
The "Add Model" flow currently requires an API key for every provider. Many users already pay for a ChatGPT subscription, and OpenAI now openly tolerates third-party use of Codex OAuth (they open-sourced a plugin calling Codex from Claude Code, and enabled OAuth for OpenClaw). Platforms like exe.dev already offer "connect your ChatGPT subscription" as a first-class model source.
Notably,
@earendil-works/pi-ai0.83.0 — already vendored here — ships everything needed:api/openai-codex-responses(speaks tochatgpt.com/backend-api, WebSocket + SSE fallback, auth via access token +chatgpt-account-id) and theopenai-codexmodel catalog. The wiring inai-models.ts(API_STREAMS / catalogModel / a direct-path handle) looks thin.The design questions would be: (1) the "Sign in with ChatGPT" OAuth flow and refresh-token custody — presumably a DO, following the same pattern as the Cloudflare gatekeeper's OAuth; (2) subscription traffic bypassing AI Gateway cost accounting.
Would love to see this in-tree someday!
All reactions