Skip to content

Add OpenAI ChatGPT OAuth credential support#122

Open
nguyenngothuong wants to merge 1 commit into
CoreBunch:mainfrom
nguyenngothuong:feature/openai-chatgpt-oauth
Open

Add OpenAI ChatGPT OAuth credential support#122
nguyenngothuong wants to merge 1 commit into
CoreBunch:mainfrom
nguyenngothuong:feature/openai-chatgpt-oauth

Conversation

@nguyenngothuong

Copy link
Copy Markdown
Contributor

Summary

  • Add an OpenAI ChatGPT/Codex OAuth device flow for creating encrypted oauth credentials
  • Add OAuth token refresh/persistence and DB migrations for the new credential auth mode
  • Route OAuth OpenAI requests through the ChatGPT Codex Responses endpoint with store: false
  • Add provider UI for OpenAI API key vs OpenAI ChatGPT OAuth, plus response/request tests

Caveat

This integration intentionally targets ChatGPT/Codex OAuth and https://chatgpt.com/backend-api/codex/responses, not the public OpenAI Platform API-key endpoint. The model list for OAuth credentials is static and may need updating if that endpoint changes.

Tests

  • bun test src/__tests__/architecture/migration-parity.test.ts src/__tests__/architecture/ai-credentials-never-leak.test.ts src/__tests__/ai/credentialsHandler.test.ts src/__tests__/ai/responsesMapping.test.ts
  • bun run build
@DavidBabinec

Copy link
Copy Markdown
Contributor

Is this supported and permitted use by OpenAI?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants