1<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="image" href="/openai-oauth-wordmark.svg"/><link rel="stylesheet" href="/_next/static/chunks/06pzqcpg-qjzo.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/0mvvanceivvhe.js"/>
1<script src="/_next/static/chunks/12ng9y1xmtxdd.js" async=""></script>
1<script src="/_next/static/chunks/20msfz3016icq.js" async=""></script>
1<script src="/_next/static/chunks/0iec5q4ack_04.js" async=""></script>
1<script src="/_next/static/chunks/turbopack-14mmaq6lot_ns.js" async=""></script>
1<script src="/_next/static/chunks/1jpuwclqgcozr.js" async=""></script>
1<script src="/_next/static/chunks/14mumt5_n0xhi.js" async=""></script>
1<script src="/_next/static/chunks/0yp9ehn-lax3k.js" async=""></script>
1<title>OpenAI OAuth</title><meta name="description" content="Free OpenAI API access with your ChatGPT account."/><meta property="og:title" content="OpenAI OAuth"/><meta property="og:description" content="Free OpenAI API access with your ChatGPT account."/><meta property="og:url" content="https://openai-oauth.vercel.app"/><meta property="og:site_name" content="OpenAI OAuth"/><meta property="og:image" content="https://openai-oauth.vercel.app/opengraph-image.png?opengraph-image.41k_5_l9bl5wt.png"/><meta property="og:image:type" content="image/png"/><meta property="og:image:width" content="1280"/><meta property="og:image:height" content="640"/><meta property="og:type" content="website"/><meta name="twitter:card" content="summary_large_image"/><meta name="twitter:title" content="OpenAI OAuth"/><meta name="twitter:description" content="Free OpenAI API access with your ChatGPT account."/><meta name="twitter:image" content="https://openai-oauth.vercel.app/opengraph-image.png"/><link rel="shortcut icon" href="/favicon-32x32.png"/><link rel="icon" href="/favicon-32x32.png" sizes="32x32" type="image/png"/><link rel="apple-touch-icon" href="/apple-touch-icon.png"/>
1<script src="/_next/static/chunks/0cz1d0mv5g_q7.js" noModule=""></script>
1</head><body><div hidden=""><!--$--><!--/$--></div><main class="demoShell"><header class="siteHeader"><a aria-label="OpenAI OAuth" class="wordmark" href="/"><img alt="" width="202" height="28" decoding="async" data-nimg="1" style="color:transparent" src="/openai-oauth-wordmark.svg"/></a><nav aria-label="Demo modes" class="modeTabs"><button aria-current="page" type="button">Sign in with ChatGPT</button><button type="button">Free OpenAI API</button></nav><a aria-label="GitHub" class="githubLink" href="https://github.com/EvanZhouDev/openai-oauth" rel="noreferrer" target="_blank"><svg aria-hidden="true" fill="currentColor" focusable="false" viewBox="0 0 24 24"><path d="M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91.58.1.79-.25.79-.56v-2.14c-3.2.7-3.88-1.36-3.88-1.36-.52-1.33-1.28-1.68-1.28-1.68-1.05-.72.08-.71.08-.71 1.16.08 1.77 1.19 1.77 1.19 1.03 1.76 2.7 1.25 3.36.96.1-.75.4-1.25.73-1.54-2.55-.29-5.23-1.28-5.23-5.68 0-1.26.45-2.28 1.19-3.09-.12-.29-.52-1.46.11-3.04 0 0 .97-.31 3.16 1.18A10.9 10.9 0 0 1 12 6.05c.98 0 1.96.13 2.88.39 2.19-1.49 3.15-1.18 3.15-1.18.63 1.58.23 2.75.11 3.04.74.81 1.19 1.83 1.19 3.09 0 4.41-2.69 5.38-5.25 5.67.42.36.78 1.06.78 2.14v3.15c0 .31.21.67.8.56A11.51 11.51 0 0 0 23.5 12C23.5 5.65 18.35.5 12 .5Z"></path></svg></a></header><section aria-label="Sign in with ChatGPT demo" class="demoPanel signInPanel"><div class="stepRow"><section class="stepDocs"><div class="stepHeading"><span class="stepNumber">1</span><div><h1>Add sign in</h1><p>Let users connect their ChatGPT account.</p></div></div><div class="codeFrame"><pre><code><span class="syntax-string">"use client"</span>; 2 3<span class="syntax-keyword">import</span> { SignInWithChatGPT } <span class="syntax-keyword">from</span> <span class="syntax-string">"@openai-oauth/react"</span>; 4 5<span class="syntax-keyword">export</span> <span class="syntax-keyword">default</span> <span class="syntax-keyword">function</span> <span class="syntax-function">App</span>() { 6 <span class="syntax-keyword">return</span> <span class="syntax-component"><SignInWithChatGPT</span> />; 7}</code></pre><button aria-label="Copy code" class="codeCopyButton" type="button"><svg aria-hidden="true" fill="none" focusable="false" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><rect height="14" rx="2" width="14" x="8" y="8"></rect><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path></svg></button></div></section><section class="stepOutput signInOutput"><h2 class="outputHeading">Try it out</h2><p class="planNote">Works across free and paid plans.</p><button type="button" style="align-items:center;background:#ffffff;border:1px solid #d9d9d9;border-radius:9999px;color:#111111;cursor:pointer;display:inline-flex;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;font-size:16px;font-weight:450;gap:12px;justify-content:center;line-height:1.2;min-height:58px;min-width:274px;padding:16px 24px;white-space:nowrap"><svg aria-hidden="true" fill="none" focusable="false" style="display:block;flex:0 0 auto;height:22px;width:22px" viewBox="0 0 5086 5021" xmlns="http://www.w3.org/2000/svg"><title>OpenAI</title><path d="M1947.45 1832.08V1357.04C1947.45 1317.03 1962.45 1287.01 1997.43 1267.05L2952.46 717.024C3082.47 642.035 3237.47 607.018 3397.45 607.018C3997.47 607.018 4377.48 1072.05 4377.48 1567.07C4377.48 1602.06 4377.48 1642.06 4372.46 1682.07L3382.45 1102.04C3322.46 1067.03 3262.46 1067.03 3202.45 1102.04L1947.45 1832.08ZM4177.46 3682.19V2547.08C4177.46 2477.08 4147.44 2427.07 4087.45 2392.08L2832.45 1662.05L3242.46 1427.01C3277.44 1407.02 3307.47 1407.02 3342.45 1427.01L4297.47 1977.03C4572.51 2137.05 4757.46 2477.08 4757.46 2807.06C4757.46 3187.06 4532.51 3537.1 4177.46 3682.12V3682.19ZM1652.43 2682.13L1242.42 2442.13C1207.44 2422.14 1192.44 2392.11 1192.44 2352.14V1252.09C1192.44 717.057 1602.45 312.018 2157.48 312.018C2367.47 312.018 2562.43 382.019 2727.5 507.022L1742.48 1077.07C1682.49 1112.05 1652.49 1162.07 1652.49 1232.1V2682.16L1652.43 2682.13ZM2534.98 3192.15L1947.38 2862.13V2162.13L2534.91 1832.11L3122.41 2162.13V2862.13L2534.98 3192.15ZM2912.45 4712.24C2702.43 4712.24 2507.46 4642.21 2342.43 4517.24L3327.42 3947.16C3387.41 3912.17 3417.43 3862.19 3417.43 3792.16V2342.07L3832.46 2582.06C3867.45 2602.05 3882.44 2632.08 3882.44 2672.08V3772.14C3882.44 4307.14 3467.41 4712.24 2912.45 4712.24ZM1727.41 3597.19L772.388 3047.16C497.352 2887.14 312.365 2547.15 312.365 2217.13C312.365 1832.11 542.409 1487.1 897.386 1342.07V2482.13C897.386 2552.17 927.38 2602.15 987.369 2637.13L2237.42 3362.15L1827.41 3597.19C1792.42 3617.17 1762.4 3617.17 1727.41 3597.19ZM1672.45 4417.24C1107.44 4417.24 692.414 3992.18 692.414 3467.16C692.414 3427.16 697.434 3387.15 702.422 3347.15L1687.41 3917.19C1747.42 3952.19 1807.42 3952.19 1867.41 3917.19L3122.41 3192.18V3667.22C3122.41 3707.22 3107.42 3737.22 3072.43 3757.21L2117.41 4307.23C1987.39 4382.22 1832.39 4417.24 1672.38 4417.24H1672.45ZM2912.45 5012.23C3517.46 5012.23 4022.44 4582.22 4137.49 4012.17C4697.48 3867.15 5057.51 3342.13 5057.51 2807.13C5057.51 2457.09 4907.5 2117.1 4637.49 1872.05C4662.49 1767.06 4677.52 1662.05 4677.52 1557.1C4677.52 842.06 4097.49 306.997 3427.48 306.997C3292.5 306.997 3162.48 326.951 3032.46 371.977C2807.44 151.966 2497.45 11.9648 2157.44 11.9648
7C1552.44 11.9648 1047.46 441.978 932.434 1012.02C372.419 1157.05 12.4219 1682.03 12.4219 2217.06C12.4219 2567.13 162.394 2907.13 432.408 3152.14C407.402 3257.13 392.405 3362.15 392.405 3467.13C392.405 4182.13 972.404 4717.2 1642.45 4717.2C1777.43 4717.2 1907.41 4697.24 2037.43 4652.22C2262.39 4872.23 2572.41 5012.23 2912.45 5012.23Z" fill="currentColor"></path></svg><span>Sign in with ChatGPT</span></button><p class="safetyNote"><svg aria-hidden="true" fill="none" focusable="false" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><rect height="10" rx="2" width="14" x="5" y="11"></rect><path d="M8 11V7a4 4 0 0 1 8 0v4"></path></svg><span>Credentials are encrypted and<br/>stored locally in this browser.</span></p></section></div><div class="stepRow locked"><section class="stepDocs"><div class="stepHeading"><span class="stepNumber">2</span><div><div class="requestTypeControl"><button aria-expanded="false" aria-haspopup="menu" class="requestTypeButton" type="button">Make a request<span aria-hidden="true" class="chevronDown"></span></button></div><p>Use the AI SDK with the signed-in account.</p></div></div><div class="codeFrame" style="--code-min-lines:17"><div aria-label="Code file" class="codeTabs" role="tablist"><button aria-selected="true" class="codeTab" role="tab" type="button">app.tsx</button><button aria-selected="false" class="codeTab" role="tab" type="button">app/api/chat/route.ts</button></div><pre><code><span class="syntax-string">"use client"</span>; 8 9<span class="syntax-keyword">import</span> { useCompletion } <span class="syntax-keyword">from</span> <span class="syntax-string">"@ai-sdk/react"</span>; 10<span class="syntax-keyword">import</span> { openaiAuthHeaders } <span class="syntax-keyword">from</span> <span class="syntax-string">"@openai-oauth/react"</span>; 11 12<span class="syntax-keyword">const</span> { completion, complete } = <span class="syntax-function">useCompletion</span>({ 13 api: <span class="syntax-string">"/api/chat"</span>, 14 streamProtocol: <span class="syntax-string">"text"</span>, 15}); 16 17<span class="syntax-keyword">await</span> <span class="syntax-function">complete</span>(<span class="syntax-string">"Hello!"</span>, { 18 headers: <span class="syntax-keyword">await</span> <span class="syntax-function">openaiAuthHeaders</span>(), 19});</code></pre><button aria-label="Copy code" class="codeCopyButton" type="button"><svg aria-hidden="true" fill="none" focusable="false" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><rect height="14" rx="2" width="14" x="8" y="8"></rect><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path></svg></button></div></section><section class="stepOutput requestOutput"><form class="askForm"><label class="srOnly" for="prompt">Ask anything</label><input disabled="" id="prompt" placeholder="Ask anything" value=""/><button aria-label="Send" disabled="" type="submit"><span aria-hidden="true" class="arrowUp">â</span></button></form></section></div></section><section class="docsCta"><h2>Build with OpenAI OAuth</h2><p>Add Sign in with ChatGPT to your product, start a <br/>dev proxy, or connect through the TypeScript SDK.</p><a class="docsButton" href="https://github.com/EvanZhouDev/openai-oauth#readme" rel="noreferrer" target="_blank">Go to Documentation</a></section></main><!--$--><!--/$--><!--$!--><template data-dgst="BAILOUT_TO_CLIENT_SIDE_RENDERING"></template><!--/$-->
19<script src="/_next/static/chunks/0mvvanceivvhe.js" id="_R_" async=""></script>
19<script>(self.__next_f=self.__next_f||[]).push([0])</script>
19<script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[39756,[\"/_next/static/chunks/1jpuwclqgcozr.js\",\"/_next/static/chunks/14mumt5_n0xhi.js\"],\"default\"]\n3:I[37457,[\"/_next/static/chunks/1jpuwclqgcozr.js\",\"/_next/static/chunks/14mumt5_n0xhi.js\"],\"default\"]\n4:I[2355,[\"/_next/static/chunks/1jpuwclqgcozr.js\",\"/_next/static/chunks/14mumt5_n0xhi.js\"],\"Analytics\"]\n5:I[11376,[\"/_next/static/chunks/1jpuwclqgcozr.js\",\"/_next/static/chunks/14mumt5_n0xhi.js\",\"/_next/static/chunks/0yp9ehn-lax3k.js\"],\"LoginPanel\"]\n6:I[97367,[\"/_next/static/chunks/1jpuwclqgcozr.js\",\"/_next/static/chunks/14mumt5_n0xhi.js\"],\"OutletBoundary\"]\n7:\"$Sreact.suspense\"\n9:I[97367,[\"/_next/static/chunks/1jpuwclqgcozr.js\",\"/_next/static/chunks/14mumt5_n0xhi.js\"],\"ViewportBoundary\"]\nb:I[97367,[\"/_next/static/chunks/1jpuwclqgcozr.js\",\"/_next/static/chunks/14mumt5_n0xhi.js\"],\"MetadataBoundary\"]\nd:I[68027,[\"/_next/static/chunks/1jpuwclqgcozr.js\",\"/_next/static/chunks/14mumt5_n0xhi.js\"],\"default\",1]\n:HL[\"/_next/static/chunks/06pzqcpg-qjzo.css\",\"style\"]\n"])</script>
19<script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]},\"$undefined\",\"$undefined\",16],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/06pzqcpg-qjzo.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/1jpuwclqgcozr.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/14mumt5_n0xhi.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"children\":[[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}],[\"$\",\"$L4\",null,{}]]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$L5\",null,{}],[[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/0yp9ehn-lax3k.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@8\"}]}]]}],{},null,false,null]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L9\",null,{\"children\":\"$La\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Lb\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lc\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$d\",[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/06pzqcpg-qjzo.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"6p7Ws-y6rvAUFDGfFcS1Q\"}\n"])</script>
19<script>self.__next_f.push([1,"a:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script>
19<script>self.__next_f.push([1,"e:I[27201,[\"/_next/static/chunks/1jpuwclqgcozr.js\",\"/_next/static/chunks/14mumt5_n0xhi.js\"],\"IconMark\"]\n8:null\n"])</script>
19<script>self.__next_f.push([1,"c:[[\"$\",\"title\",\"0\",{\"children\":\"OpenAI OAuth\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Free OpenAI API access with your ChatGPT account.\"}],[\"$\",\"meta\",\"2\",{\"property\":\"og:title\",\"content\":\"OpenAI OAuth\"}],[\"$\",\"meta\",\"3\",{\"property\":\"og:description\",\"content\":\"Free OpenAI API access with your ChatGPT account.\"}],[\"$\",\"meta\",\"4\",{\"property\":\"og:url\",\"content\":\"https://openai-oauth.vercel.app\"}],[\"$\",\"meta\",\"5\",{\"property\":\"og:site_name\",\"content\":\"OpenAI OAuth\"}],[\"$\",\"meta\",\"6\",{\"property\":\"og:image\",\"content\":\"https://openai-oauth.vercel.app/opengraph-image.png?opengraph-image.41k_5_l9bl5wt.png\"}],[\"$\",\"meta\",\"7\",{\"property\":\"og:image:type\",\"content\":\"image/png\"}],[\"$\",\"meta\",\"8\",{\"property\":\"og:image:width\",\"content\":\"1280\"}],[\"$\",\"meta\",\"9\",{\"property\":\"og:image:height\",\"content\":\"640\"}],[\"$\",\"meta\",\"10\",{\"property\":\"og:type\",\"content\":\"website\"}],[\"$\",\"meta\",\"11\",{\"name\":\"twitter:card\",\"content\":\"summary_large_image\"}],[\"$\",\"meta\",\"12\",{\"name\":\"twitter:title\",\"content\":\"OpenAI OAuth\"}],[\"$\",\"meta\",\"13\",{\"name\":\"twitter:description\",\"content\":\"Free OpenAI API access with your ChatGPT account.\"}],[\"$\",\"meta\",\"14\",{\"name\":\"twitter:image\",\"content\":\"https://openai-oauth.vercel.app/opengraph-image.png\"}],[\"$\",\"link\",\"15\",{\"rel\":\"shortcut icon\",\"href\":\"/favicon-32x32.png\"}],[\"$\",\"link\",\"16\",{\"rel\":\"icon\",\"href\":\"/favicon-32x32.png\",\"sizes\":\"32x32\",\"type\":\"image/png\"}],[\"$\",\"link\",\"17\",{\"rel\":\"apple-touch-icon\",\"href\":\"/apple-touch-icon.png\"}],[\"$\",\"$Le\",\"18\",{}]]\n"])</script>
19</body></html>
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.