How to log in using GPT? #1782

Closed
opened 2026-02-16 17:32:35 -05:00 by yindo · 5 comments
Owner

Originally created by @Decme on GitHub (Sep 20, 2025).

Originally assigned to: @rekram1-node on GitHub.

I have a paid ChatGPT account and I'd like to log in (to avoid using API), but when I type "opencode auth login" it returns "OpenAI API key is missing. Pass it using the 'apiKey' parameter or the OPENAI_AI_KEY environment variable."

Originally created by @Decme on GitHub (Sep 20, 2025). Originally assigned to: @rekram1-node on GitHub. I have a paid ChatGPT account and I'd like to log in (to avoid using API), but when I type "opencode auth login" it returns "OpenAI API key is missing. Pass it using the 'apiKey' parameter or the OPENAI_AI_KEY environment variable."
yindo closed this issue 2026-02-16 17:32:35 -05:00
Author
Owner

@Vanalio commented on GitHub (Sep 20, 2025):

OpanAI, as other similar, gives that kind of auth option capability only to its own apps. There some sort of app sig that get checked.

@Vanalio commented on GitHub (Sep 20, 2025): OpanAI, as other similar, gives that kind of auth option capability only to its own apps. There some sort of app sig that get checked.
Author
Owner

@rekram1-node commented on GitHub (Sep 20, 2025):

@Decme you can only login with api key here, is that what you tried? A chatgpt plan specifically for codex wont work you need an api key

@rekram1-node commented on GitHub (Sep 20, 2025): @Decme you can only login with api key here, is that what you tried? A chatgpt plan specifically for codex wont work you need an api key
Author
Owner

@mpazik commented on GitHub (Sep 22, 2025):

There is an open PR for this, however, I did not manage to make it work.

@mpazik commented on GitHub (Sep 22, 2025): There is an open [PR](https://github.com/sst/opencode/pull/1892) for this, however, I did not manage to make it work.
Author
Owner

@rekram1-node commented on GitHub (Sep 22, 2025):

Just to document for you the following is the only way we support using openai: https://opencode.ai/docs/providers/#openai

meaning you have to login with api key oauth isn't supported for them

@rekram1-node commented on GitHub (Sep 22, 2025): Just to document for you the following is the only way we support using openai: https://opencode.ai/docs/providers/#openai meaning you have to login with api key oauth isn't supported for them
Author
Owner

@x22x22 commented on GitHub (Sep 30, 2025):

@Decme
you can try @kdump/code-cli-any-llm

https://www.npmjs.com/package/@kdump/code-cli-any-llm

code-cli-any-llm supports disguising opencode in a non-intrusive way as codex (and supports chatgpt sso login method).

💡 Codex ChatGPT mode: Choosing Codex + ChatGPT prompts the CLI to open a browser-based OAuth login on the first request. The login URL appears in your terminal, and successful authentication writes auth.json to ~/.code-cli-any-llm/codex/. Tokens refresh automatically, so repeat logins are not required.

@x22x22 commented on GitHub (Sep 30, 2025): @Decme you can try @kdump/code-cli-any-llm https://www.npmjs.com/package/@kdump/code-cli-any-llm code-cli-any-llm supports disguising opencode in a non-intrusive way as codex (and supports chatgpt sso login method). 💡 Codex ChatGPT mode: Choosing Codex + ChatGPT prompts the CLI to open a browser-based OAuth login on the first request. The login URL appears in your terminal, and successful authentication writes auth.json to ~/.code-cli-any-llm/codex/. Tokens refresh automatically, so repeat logins are not required.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1782