Feature request: Add OpenAI's Oauth2 based login as an auth feature, similar to the Claude Pro/Max login method #1250

Closed
opened 2026-02-16 17:30:10 -05:00 by yindo · 1 comment
Owner

Originally created by @rishsriv on GitHub (Aug 11, 2025).

Originally assigned to: @thdxr on GitHub.

One way to do this would be do copy creds from ~/.codex/auth.json.

AFAIK (from reading Codex source code), this is how codex handles this:

  • Changes the base URL to https://chatgpt.com/backend-api/codex
  • Adds an authorization token to the request: Authorization: Bearer <access_token> (JWT from OAuth)
  • Adds an extra header to the frequest: chatgpt-account-id: <account_id from auth json>

Would love to make a PR if this would be a welcome addition. Would you want to support this?

Originally created by @rishsriv on GitHub (Aug 11, 2025). Originally assigned to: @thdxr on GitHub. One way to do this would be do copy creds from `~/.codex/auth.json`. AFAIK (from reading [Codex source code](https://github.com/openai/codex/blob/39276e82d4a02e527a85694ee7e901bdbcc9548f/codex-rs/core/src/model_provider_info.rs)), this is how codex handles this: - Changes the base URL to `https://chatgpt.com/backend-api/codex` - Adds an authorization token to the request: `Authorization: Bearer <access_token>` (JWT from OAuth) - Adds an extra header to the frequest: `chatgpt-account-id: <account_id from auth json>` Would love to make a PR if this would be a welcome addition. Would you want to support this?
yindo closed this issue 2026-02-16 17:30:10 -05:00
Author
Owner

@thdxr commented on GitHub (Aug 11, 2025):

Duplicate of #1686

@thdxr commented on GitHub (Aug 11, 2025): Duplicate of #1686
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1250