Skip to content

Add ChatGPT Plus/Pro OAuth login support#1873

Draft
dgageot wants to merge 1 commit intodocker:mainfrom
dgageot:chatgpt
Draft

Add ChatGPT Plus/Pro OAuth login support#1873
dgageot wants to merge 1 commit intodocker:mainfrom
dgageot:chatgpt

Conversation

@dgageot
Copy link
Member

@dgageot dgageot commented Feb 27, 2026

Add 'chatgpt' as a provider alias so users with a ChatGPT Plus/Pro subscription can use models like chatgpt/o3 without a separate API key.

Authentication uses the OAuth2 PKCE flow against auth.openai.com (the same flow as the Codex CLI). After obtaining OAuth tokens, the id_token is exchanged for a standard OpenAI API key via token exchange. Tokens are persisted to ~/.config/cagent/chatgpt_token.json and automatically refreshed when expired.

New CLI commands:
cagent login chatgpt - authenticate via browser
cagent logout chatgpt - remove stored credentials

New package pkg/chatgpt with auth, token storage, and an environment.Provider that resolves CHATGPT_ACCESS_TOKEN.

Assisted-By: cagent

Add 'chatgpt' as a provider alias so users with a ChatGPT Plus/Pro
subscription can use models like chatgpt/o3 without a separate API key.

Authentication uses the OAuth2 PKCE flow against auth.openai.com
(the same flow as the Codex CLI). After obtaining OAuth tokens, the
id_token is exchanged for a standard OpenAI API key via token exchange.
Tokens are persisted to ~/.config/cagent/chatgpt_token.json and
automatically refreshed when expired.

New CLI commands:
  cagent login chatgpt   - authenticate via browser
  cagent logout chatgpt  - remove stored credentials

New package pkg/chatgpt with auth, token storage, and an
environment.Provider that resolves CHATGPT_ACCESS_TOKEN.

Assisted-By: cagent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant