opencoredev/login-with-chatgpt
A simple SDK that lets your users log in with their ChatGPT account.
What it solves
Most apps that want to use ChatGPT models either require building their own auth or forcing users to get separate API keys. This SDK solves that by letting your users log in with their own ChatGPT account, bringing their subscription to your app. Tokens never touch the browser — they stay behind a proxy, so you avoid security risks from exposing credentials.
How it works
The SDK provides a handler that keeps tokens behind a proxy path. When a user clicks the login button, the browser gets a session cookie, then your backend asks which models the user's account has access to and streams responses from there. The whole flow is split into packages: core handles OAuth, token refresh, and model discovery; server provides the backend endpoints; react gives you the button and hook; and the AI package provides providers for the Vercel AI SDK.
Who it's for
Developers building web apps with Node.js 18+ who want to offer ChatGPT-powered features without handling API keys themselves, and who want users to use their own ChatGPT subscriptions. It's also useful if you need image generation, custom tool handoffs, or experimental voice-based interaction.
Highlights
- Users bring their own ChatGPT subscription, so you don't need to manage API keys
- Tokens are protected via HttpOnly cookies and a proxy handler; they never reach the browser
- Works directly with the Vercel AI SDK: you can call
streamText()from the client safely - Supports image generation and editing (size, quality, format, masks, streaming previews)
- Experimental GPT Live WebRTC audio with native interruption
- Desktop-style app-server handoffs for allowlisted tools with explicit confirmations
- Open source under the MIT license
- Includes an agent skill (for Claude Code, Cursor, or Codex) that correctly wires the SDK without inventing API keys or model slugs
Related
- Project
- Project
- Project
- Project