Prince Chauhan

Prince Chauhan

building cool things

About

I build developer tools and ship them MIT. I like the unglamorous half of the work: what breaks once you leave localhost, and the detail nobody bothered to write down. Finding it is most of the job. Right now that's ai-oauth-sdk, plus a chat app built on it.

Badges

Tastemaker
Tastemaker
Gone streaking
Gone streaking

Forums

Launching today: let your users bring the AI subscription they already pay for

Every AI app I've built ended up with the same screen. Paste your API key, we'll store it. I never liked shipping that, and users don't love it either.

So I built ai-oauth-sdk. It lets someone sign in with the AI plan they already pay for, using the providers' real OAuth flows, the same ones their official CLIs use. The token stays on their device, so you never hold a key and you never pay for their inference.

Eight providers today: ChatGPT, Claude, Gemini, Grok, Copilot, Qwen, OpenRouter and Azure. Zero dependencies in the core package, MIT, and it runs in Node, the browser, React Native and the usual frameworks.

The OAuth was the easy half. What took the time was the things nobody documents. OpenAI's CLI client id is registered for one exact port, localhost:1455, and if it's busy the flow just fails with nothing useful in the error. Cross-Origin-Opener-Policy: same-origin quietly severs window.opener, so a popup callback completes and the parent never hears about it. Google validates redirect_uri strictly enough that a hosted callback is rejected outright, so the loopback URL has to be copied back by hand.

17h ago

How many AI subscriptions are you actually paying for?

I added mine up this month and the total was higher than I'd have guessed. Claude Max, ChatGPT Pro, xAI, and GitHub Copilot which I added recently.

Two of those are top tier plans, which is where most of the damage is. The honest part is that I don't open all of them in a given week. A couple I keep because they're each better at different things, one because it sits in my editor and I forget it's there, and the rest because cancelling feels like a decision I'd only have to make again in two months.

What gets me is that this is only half the bill. Every AI SaaS app I sign up for has to price in its own inference cost, so I end up paying a second time, through their subscription, for models I already pay for directly. The startup can't really avoid it either. They either eat the margin or charge me extra to cover it, and I don't think either side is happy with that.

So what's your number? How many do you actually open in a normal week? And has anyone cancelled one and genuinely not missed it?

AI OAuth SDK - Let your customers bring their own AI subscription

Let your customers bring the AI subscription they pay for. Think BYOK, but they sign in with the plan they already have instead of pasting a key. ai-oauth-sdk runs the providers' real OAuth flows, the same ones their official CLIs use. The token stays on their device, so you never hold a key or pay for their inference. Eight providers: ChatGPT, Claude, Gemini, Grok, Copilot, Qwen, OpenRouter, Azure. Zero dependencies, MIT. Node, browser, React, Vue, Svelte, Solid, React Native, CLI.
View more