open source · MIT · bring your own subscription
Login with ChatGPT
A drop-in button that lets your users power your app's AI with their own ChatGPT subscription. Ship AI features without ever paying OpenAI for API usage.
bun add loginwithchatgpt
One line in your UI
Drop the button, then make AI calls that bill the connected user. No keys, no token plumbing, no refresh logic.
the button
the call
How it works
User clicks the button
They sign in with their own ChatGPT account through OpenAI's Codex OAuth flow.
Token stored, encrypted
Their subscription token is saved with AES-256-GCM, keyed from the OS keychain.
AI runs on their plan
Every call bills the user's ChatGPT subscription. You never pay OpenAI for usage.
Why it's nice
No API bill
Costs scale with users — for them, not you. Each user funds their own AI.
Three login flows
Loopback for desktop, device-code for web, headless paste for SSH and CI.
Encrypted by default
Tokens encrypted at rest, auto-refreshed on expiry and 401. Swap the store in one line.
One package, three entries
Headless engine, a React button, and Next.js route handlers. Install once.
Ship AI without the bill
Your users already pay for ChatGPT. Let them bring it into your app.