Go back

How ChatGPT Web serves a billion users: reverse-engineering OpenAI’s stack 🧠

ChatGPT Web’s stack and evolution: React Router 7, Vite, streaming SSR, anonymous access, feature flags and bot protection.

How ChatGPT Web serves a billion users: reverse-engineering OpenAI’s stack 🧠

A superb technical breakdown of ChatGPT’s frontend has appeared on performance.dev. At first glance, the interface seems primitive, but under the hood it runs one of the most performant and scalable architectures on the modern web.

The most interesting part is that OpenAI barely uses custom inventions or proprietary frameworks (unlike Google with Gemini), instead assembling its stack from standard open-source solutions.

The current ChatGPT Web stack (mid-2026): — Runtime and framework: React 19 + React Router 7 (in full framework mode with streaming and SSR). — Build tool: Vite (splitting JS and CSS into chunks for each route). — Styles and components: Tailwind CSS + Radix UI primitives. — Text editors: ProseMirror (for the prompt input) and CodeMirror 6 (for code blocks and Canvas). — Infrastructure: Cloudflare (cache, CDN and bot protection) + TanStack Query for client-side server-state management.

The architecture’s evolution: from Next.js to React Router — The Next.js era (2022–2024): ChatGPT started on Next.js 12 with the Pages Router. Notably, OpenAI deliberately skipped the entire App Router era and stayed with the old pages for about 21 months. — The Remix era (autumn 2024): The team migrated to Remix. Initially, this was almost a pure SPA approach: the server returned an empty hydration shell, while data flowed through TanStack Query. — The React Router 7 era (now): Following the merger of Remix and React Router, the project moved to RR7. Now they have pushed SSR to the limit: the unauthenticated page is fully rendered on the server and streamed as ready-to-use HTML. What’s more, all 354 routes (including landing pages and marketing) live in one monolith. Moving from a promotional page into the chat is instant client-side navigation, not a reload.

The fight for milliseconds and TTI — Entry without authentication (render-first): The key retention feature is the absence of a login screen on the first visit. To support this architecturally, the backend has a parallel anonymous API (/backend-anon/me, /backend-anon/conversation), giving the user a temporary ID for handling limits and flags. — Inline scripts in <head>: Before the main bundles load, a script reads the theme from localStorage (to avoid a white-screen flash in dark mode), alongside an embedded performance tracker that logs the precise start of HTML execution and the first animation frame (requestAnimationFrame).

$1.1 billion in flags and bot protection

  • ChatGPT’s experimentation system is enormous: hundreds of tests run simultaneously. OpenAI depended so heavily on the Statsig feature-flag platform that in September 2025 it simply bought the company for $1.1 billion, making its founder the CTO of OpenAI’s applications division.
  • To prevent free anonymous access from consuming all the company’s GPU resources, invisible protection operates under the hood: Cloudflare Proof-of-Work (making the client CPU perform a small computation to verify that this is a real browser) + a proprietary anti-fraud system called Sentinel running in an isolated iframe.

It is surprising how a standard React Router, Vite and Tailwind stack handles traffic from a billion users through smart server streaming and aggressive critical-rendering-path optimization.

Read the breakdown

What do you think of this approach? Does anyone else believe a “pure” SPA paired with a powerful router is the best choice for most complex product applications, or does streaming HTML from the server win after all?

Copied