Problem
Today, OpenAI integration in n8n relies on API keys, which:
Donāt support user-level authentication
Donāt integrate with accounts that use subscriptions like ChatGPT Plus
Proposed Solution
Add OAuth 2.0 authentication for OpenAI credentials.
Flow:
Click āConnect with OpenAIā
Redirect to OpenAI login/consent
Receive authorization code
Exchange for access/refresh tokens
Store securely and use in nodes
Why it matters
Secure authentication (no API keys)
Better UX
Enables usage tied to user accounts (e.g., ChatGPT Plus subscribers)
Use cases
Users who already pay for ChatGPT Plus and want native integration
Hi, I opened a draft PR that adds OAuth access token support to the existing OpenAI credential path for OpenAI chat/LLM nodes:
The current implementation is intentionally scoped to supporting OAuth/browser/headless-provided access tokens in the OpenAI credential and making the LangChain/OpenAI chat nodes use that token resolution path, while preserving API key support.
Feedback from the n8n team/community would be very welcome.