OAuth for AI spend · Developer preview

Your users bring
their own
AI budget.

Wattfare drops a “Connect AI budget” button into your app. Users connect, set a spending cap, and you call any model through one SDK — charged to them, not you. You stop eating the inference bill.

OpenAI-compatible Works with the Vercel AI SDK ~5-min integration
acme-chat.app
A Acme Chat
Wattfare ~30s · one time

Allow acme to charge AI to your budget?

Monthly capAdjustable
$ 10 / month

psst — the button works

Think “Sign in with Google”, but for AI spend. One button connects a user's inference budget to your app — metered, capped, and revocable. You never store a key. They never overspend.

The problem

AI costs are the one line item you can't predict.

Every AI app makes the same uncomfortable bet: price high enough to survive your power users, ration usage so nobody hurts you, or quietly lose money on the heavy ones. Tokens scale with usage — your subscription price doesn't.

Today You pay for their tokens
  • You eat unpredictable inference costs every month.
  • Your price = margin + a budget you guessed each user would burn.
  • Power users wreck your unit economics; free tiers bleed.
  • Side projects need a credit card you're scared to attach.
With Wattfare They bring their own budget
  • Inference is funded by the user, within a cap they set.
  • You charge for the product — your margin, nothing padded.
  • Power users fund themselves. Free tiers cost you nothing.
  • Ship anything. The worst case is their budget, not your bill.
Napkin math illustrative — drag the slider
Your inference bill, today $750/mo
With Wattfare $0/mo

Users fund their own usage inside caps they set. Your COGS stops scaling with their curiosity.

How it works

Three steps. Your app code barely changes.

A claim like that needs receipts — so here's the whole integration, as the diff you'd ship.

feat: let users bring their own AI budget +9 −1
1Drop in the button frontend · +4
@@ main.tsx @@+ <WattfareProvider publishableKey="pk_live_…" session={getToken}>    <App />+ </WattfareProvider>@@ chat.tsx @@  const ai = useChat();+ const { connect, connected } = useWattfare();+ if (!connected) return <button onClick={connect}>Connect AI budget</button>;
2Mint sessions server · +4
+ const wf = new Wattfare({ secretKey: process.env.WATTFARE_SECRET_KEY });+ app.post("/api/ai-session", (c) =>+   c.json(wf.createSession(c.var.userId, { requestLimit: { monthlyUsd: 10 } }))+ );
3Swap the model chat route · +1 −1
  const result = streamText({-   model: openai("gpt-4o"),                                    // billed to: you+   model: wf.user(userId).model("anthropic/claude-sonnet-4"),  // billed to: them    prompt,  });  // the deleted line is the one where you were paying.

01 Publishable key in the browser. The secret key stays on your server and mints short-lived session tokens.

02 Consent happens on Wattfare's domain — a popup, a cap, ~30s. State lives with us, keyed by your existing user ids.

03 The returned model is AI-SDK-compatible. Stream like you already do — every token metered against their cap.

Two sides, one button

Good for the people who build it. Better for the people who use it.

Every mechanism in the middle is read from both ends. Same line, two balance sheets.

Inference is funded by the person using it. Your AI line item drops toward zero, and margins stop fighting compute.

the budget

One budget covers every connected app — no more paying five different markups for the same tokens.

Your worst case is their cap, never your card. The front page of HN stops being a financial event.

the cap

You pick a monthly number. It's enforced upstream — requests stop at your cap, not at an honor system.

No provider keys to collect, encrypt, rotate, or leak. Connection state lives on Wattfare, keyed by your user ids.

the key

You never paste a raw API key into a stranger's app. Consent happens on Wattfare's domain, like OAuth.

Disconnects surface as typed errors — the not-connected path is a normal flow state, not a 3am page.

the switch

Revoke any app in one click. The spending stops immediately, for that app only.

One SDK, hundreds of models, AI-SDK native. Same code in dev and prod — test keys auto-approve.

the models

Your prompts proxy straight through to the model. Wattfare meters cost; it isn't where conversations live.

Freemium that costs you nothing — give the whole product away and let usage fund itself.

the free tier

Try new AI apps in 30 seconds without a new account, card, or subscription each time.

Enterprise spend controls — per-seat budgets, finance-grade reporting — are on the roadmap.

Arrived from an app?

You clicked “Connect AI budget.” Here's exactly what that does.

An app you're using wants to run AI for you — but instead of baking the cost into a pricey subscription, it lets you pay for your own usage, capped at a number you choose. That's all Wattfare is: a safe, revocable way to share a spending limit.

  • You set the cap — enforced upstream, not on the honor system.
  • The app sees your AI replies, not a window into Wattfare.
  • Revoke in one click and the budget is cut off immediately.
  • One connection works across every app that supports it.
Manage your budget & connected apps →
Your budget
$6.40 left
$3.60 usedcap $10.00
Connected · revoke anytime
OpenAI-compatible

Standard wire format, proxied to OpenRouter. No protocol to learn.

AI SDK native

Drop-in model for the Vercel AI SDK — stream as usual.

Real from day one

Connect your own budget on localhost — same consent flow your users see.

Edge-fast

Cloudflare Workers, streamed untouched, typed errors — no buffering.

FAQ

The honest answers.

Isn't this just BYOK with extra steps?

BYOK makes the user paste a raw provider key into your app. Wattfare is an OAuth-style consent flow: the user owns the budget, sets a cap, and can revoke it — and your app never sees or stores a key. Usage is metered for them.

How is this different from OpenRouter's OAuth or “Sign in with ChatGPT”?

Same conviction — users should fund their own inference — different layer. Provider sign-ins tie your app to one vendor's accounts and hand you a per-user key to store, scope, and babysit. Wattfare keeps all state on its side, keyed by the user ids you already have, and adds the parts apps actually need: monthly caps, usage status, one-click revocation, and an AI-SDK-ready model(). Inference currently routes through OpenRouter under the hood; the connection layer is provider-neutral by design.

Which models can I use?

It's an OpenAI-compatible proxy to OpenRouter, so hundreds of models across providers — Anthropic, OpenAI, Google, open-weights — all behind one AI-SDK-compatible model() call.

Do you see my prompts?

Inference is proxied through to read the final usage so we can meter cost — Wattfare isn't a place your conversations are meant to live. As an early preview, treat it accordingly; full data terms land before general availability.

How is the spending cap enforced?

The user picks a monthly cap. Wattfare meters usage against it, and the underlying provider key carries a hard ceiling as the real backstop — so requests stop at the cap, even mid-stream.

What does it cost?

Wattfare is in developer preview and free to build on while we shape it. Pricing for the hosted service will be simple and announced well before it kicks in.

What's the stack?

Cloudflare Workers + Hono on the edge, KV for connection state and soft metering. The SDK is a tiny TypeScript package with server, client, and react entry points.

Developer preview · free to start

Add a “Connect AI budget” button today.

Install the SDK, wrap your app, and let your users fund their own AI. Five minutes to your first capped, metered request.

Open the dashboard