Instatic
Instatic copied to clipboard
Add OpenAI ChatGPT OAuth credential support
Summary
- Add an OpenAI ChatGPT/Codex OAuth device flow for creating encrypted
oauthcredentials - 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.tsbun run build
Is this supported and permitted use by OpenAI?
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.