feat: add OpenAI Codex OAuth login and Responses API client#19
Closed
rafeegnash wants to merge 2 commits into
Closed
feat: add OpenAI Codex OAuth login and Responses API client#19rafeegnash wants to merge 2 commits into
rafeegnash wants to merge 2 commits into
Conversation
added 2 commits
April 5, 2026 13:48
Add `clanker auth login/logout/status` commands for browser-based OpenAI OAuth PKCE flow. Tokens are stored at ~/.clanker/openai-auth.json. Add Codex Responses API client (internal/ai/codex_client.go) that sends requests to chatgpt.com/backend-api/codex/responses using OAuth tokens. When the OpenAI provider is selected but no API key is configured, the CLI checks for OAuth tokens and routes through the Codex client instead of the standard api.openai.com endpoint. Also support OPENAI_OAUTH_TOKEN env var for backend-forwarded tokens.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
clanker auth login/logout/statuscommands for OpenAI OAuth (PKCE flow via auth.openai.com)Test plan
clanker auth loginand complete the browser OAuth flowclanker auth statusto verify logged-in stateclanker ask "hello"with no API key, verify it uses Codex endpointclanker auth logoutto clear tokensclanker askwith--openai-keystill uses api.openai.com