Instatic icon indicating copy to clipboard operation
Instatic copied to clipboard

Add OpenAI ChatGPT OAuth credential support

Open nguyenngothuong opened this issue 5 months ago • 1 comments

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

nguyenngothuong avatar Jun 30 '26 11:06 nguyenngothuong

Is this supported and permitted use by OpenAI?

DavidBabinec avatar Jun 30 '26 23:06 DavidBabinec

Closing this for inactivity and undocumented behaviour. If we figure that this is allowed and documented by OpenAI, we may revisit later. For now, MCP is the way to use Codex or ChatGPT with Instatic.

DavidBabinec avatar Jul 06 '26 07:07 DavidBabinec