# Docs - **Get Started** - [Introduction](/docs): A TypeScript SDK that lets users sign in with their ChatGPT account so your app can stream AI responses on their plan. - [Quickstart](/docs/quickstart): Install the SDK, mount the server handler, render the sign-in button, and stream a response. - [For AI agents](/docs/ai): llms.txt, per-page markdown, and how to point coding agents at these docs. - Concepts - [How it works](/docs/concepts/how-it-works): The device-code login flow, the session state machine, and why polling is serverless-safe. - [Sessions & tokens](/docs/concepts/sessions): The session cookie, the session store, token encryption, and refresh mechanics. - [Response proxy](/docs/concepts/response-proxy): What happens between streamText() in the browser and the ChatGPT-backed Codex endpoint. - [Model discovery](/docs/concepts/models): Treat the model list as account data, pick a sensible default, and survive client_version drift. - [Security model](/docs/concepts/security): What a signed-in app can and cannot do, which guardrails ship by default, and where your obligations start. - Guides - [Build a chat page](/docs/guides/chat-app): A working chat UI with sign-in, a model picker, and streamed responses, in one component. - [Custom sign-in UI](/docs/guides/custom-ui): Build your own login UI with useLoginWithChatGPT() while keeping the consent obligation. - [Cross-origin setup](/docs/guides/cross-origin): Run the frontend and the handler on different origins with allowedOrigins, SameSite=None, and credentialed fetches. - [Fast tier & thinking effort](/docs/guides/fast-and-reasoning): Offer Codex Fast mode and a reasoning-effort control through validated request headers. - [Headless & CLI logins](/docs/guides/headless): Run the device-code flow without a browser using the core primitives, then stream with the direct provider. - [Production checklist](/docs/guides/production): Everything to set, review, and verify before real users sign in. - Reference - [Server handler](/docs/reference/server): createChatGPTHandler() options, defaults, and the getSession / proxyFetch / getModels helpers. - [HTTP routes](/docs/reference/routes): Every route the handler serves, with request/response shapes, status codes, and CSRF rules. - [React](/docs/reference/react): The LoginWithChatGPT widget, the useLoginWithChatGPT hook, and the consent popup helper. - [AI SDK providers](/docs/reference/ai): createChatGPTProxyProvider for browser/server proxy mode, createChatGPT for direct token mode, and the shared provider API. - [Core primitives](/docs/reference/core): ChatGPTConfig, exported defaults, and the device-flow, token, and transport primitives in @opencoredev/loginwithchatgpt-core. - [Error codes](/docs/reference/errors): Every ChatGPTAuthError code, the HTTP error shapes, and ChatGPTProxyError. - [Troubleshooting](/docs/reference/troubleshooting): Diagnose login, session, model, and streaming failures by symptom.