Monetize with usage-based billing

Turn AI usage into revenue

Meter every model call in credits, cap spend per user and per app, and let auto top-up keep balances funded — with billing modals that ship in the SDK.

How it works

Usage in, revenue out

Meter every call

Usage is metered in credits at 100 credits per $1, so every model call maps to a clear, per-user cost you can bill against.

Set spend caps

Apply per-user and per-app spending limits so a runaway prompt or a single customer can never blow past the budget you set.

Auto top-up and modals

Metered auto top-up keeps balances funded, while prebuilt billing modals handle add-funds and low-balance moments inside your app.

Hosted flows

Mount the modals once

Drop <HyperyModals /> at the root and the hosted add-funds and auto-billing flows open themselves — a 402 opens the funds modal, right where the request ran out.

  • Metered auto top-up and prepaid, on the same credits
  • Per-user and per-app spending limits
  • The funds modal opens on a 402, no wiring required
import { HyperyProvider, HyperyModals } from "@hyperyai/sdk"
 
export default function RootLayout({ children }) {
return (
<HyperyProvider config={config}>
{/* add-funds + auto-billing modals, rendered for you */}
<HyperyModals />
{children}
</HyperyProvider>
)
}

The wallet hook

Render balances with useWallet

Reach for useWallet when you want to show a balance or trigger a top-up from your own UI, all on team-pooled credits.

  • useWallet returns the balance and an addFunds trigger
  • Team-pooled credits at 100 credits per $1
  • Top up from your own components, no redirect
import { useWallet } from "@hyperyai/sdk"
 
export function Billing() {
const { wallet, addFunds } = useWallet()
 
return (
<div>
<p>balance: {wallet.credits} credits</p>
<button onClick={() => addFunds()}>add funds</button>
</div>
)
}

FAQ

Questions

How does metered billing work?
Usage is tracked in credits at 100 credits per $1. Metered mode auto-tops-up a customer’s balance from a card, so usage keeps flowing without manual refills; prepaid mode is also available.
Can I cap what a single user or app spends?
Yes. Set per-user and per-app spending limits so a customer or an embedded app can’t exceed the budget you assign, with team-level pooled credits on top.
Do I have to build a billing UI?
No. Drop <HyperyModals /> under the provider and the add-funds and auto-billing flows render for you. useWallet gives you the balance and an addFunds action for custom surfaces.
Metered or prepaid — which should I pick?
Metered auto top-up is the default and works like a usual pay-as-you-go card. Prepaid lets customers load credits up front. Both share the same credits, caps, and analytics.

Monetize with usage-based billing

Charge for what customers actually use

Meter usage, set caps, and let auto top-up do the collecting — start turning your AI app’s usage into recurring revenue.

$npm install @hyperyai/sdk