feat: Sign in with ChatGPT#1892
Conversation
|
I just tried this out with my Pro account and I get a missing organization_id error. |
|
Thanks for trying! I aligned the implementation more closely with what codex does. Not sure if it will fix your issue. If not, I'll convert to draft and park this until enterprise accounts are supported unless someone else want's to give it a shot. |
|
Alright I seem to get a different error now. This login works with codex so I'm guessing something else is up. I was thinking it wasn't passing the organization ID but I couldn't get it to work when doing that either, or I'm just not doing it right. |
|
Is it work now? :) |
|
This code did not work for me. I tried to use the OpenAI OAuth token directly from Codex CLI in OpenCode; however, for the OAuth token to be used, I belive the request would need to go through a opencode's plugin. It seems like making a plugin similar to the one for Anthropic would be a correct way of implementing OAuth for OpenAI. Another issue I came across was that the OAuth token from Codex CLI worked only on the Codex base URL "https://chatgpt.com/backend-api/codex" that accepts only Codex system prompts. |
|
Thanks @mpazik for looking into this. I currently don't have the capacity to make such large changes, so I'll close this PR for now. If anyone else wants to give it a shot, feel free to reuse anything here. |
Adds support for signing in with ChatGPT (same as in codex) through
opencode auth login. Unfortunately, I cannot test if it actually works because support for enterprise accounts is "coming soon".If anyone with a Plus, Pro, or Team ChatGPT account could test this via
bun run dev -- auth login, that would be awesome.