Quickstart
From install to working in two files
For a local-first Next.js (App Router) app. react is an optional peer dependency you only need for the button.
1. Install
Install
2. Mount the route handlers
One catch-all route serves /api/chatgpt/login, /session, and /logout.
route handlers
3. Drop in the button
the button
4. Make AI calls
Once a user is connected, calls bill their subscription. No API key anywhere.
an AI call
Next step
See the full API reference for the core functions, login flows, and token storage.