mirror of
https://github.com/mark3labs/kit.git
synced 2026-06-14 03:30:26 +00:00
bbf1106e27
Implements OAuth authentication for OpenAI ChatGPT Plus/Pro (Codex) similar to pi: - Add OpenAICredentials type with OAuth and API key support - Add OpenAI OAuth client with correct endpoints (auth.openai.com) - Implement PKCE-based OAuth flow with local callback server on :1455 - Add login/logout/status commands for openai provider - Support both ChatGPT/Codex OAuth tokens (chatgpt.com/backend-api) and regular OpenAI API keys (api.openai.com) - Extract and store ChatGPT account ID from JWT token - Add custom HTTP transport with required Codex headers: - chatgpt-account-id, originator, OpenAI-Beta: responses=experimental - Update provider selection to use correct endpoint based on auth type Usage: kit auth login openai # OAuth with ChatGPT account kit auth logout openai kit auth status The implementation follows the same patterns as the existing Anthropic OAuth support, with automatic token refresh and secure credential storage in ~/.config/.kit/credentials.json