Skip to content

feat: add OpenAI Codex OAuth login and Responses API client#19

Closed
rafeegnash wants to merge 2 commits into
masterfrom
feat/openai-codex-oauth
Closed

feat: add OpenAI Codex OAuth login and Responses API client#19
rafeegnash wants to merge 2 commits into
masterfrom
feat/openai-codex-oauth

Conversation

@rafeegnash
Copy link
Copy Markdown

Summary

  • Add clanker auth login/logout/status commands for OpenAI OAuth (PKCE flow via auth.openai.com)
  • Add Codex Responses API client for chatgpt.com/backend-api/codex/responses
  • When no API key is set but OAuth tokens are available, route through Codex endpoint
  • Support OPENAI_OAUTH_TOKEN env var for backend-forwarded tokens
  • Update example config with auth_method field

Test plan

  • Run clanker auth login and complete the browser OAuth flow
  • Run clanker auth status to verify logged-in state
  • Run clanker ask "hello" with no API key, verify it uses Codex endpoint
  • Run clanker auth logout to clear tokens
  • Verify clanker ask with --openai-key still uses api.openai.com

nash 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.
@rafeegnash rafeegnash closed this Apr 5, 2026
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