// 1. install
bun add @allotree/sdk
// 2. add to your app
import { allotree } from '@allotree/sdk'
const session = await allotree.auth({
appId: 'your-app-id',
billing: 'per-request',
limit: { amount: 10, period: 'month' }
})
// 3. charge per usage
await allotree.charge({
userId: session.userId,
amount: 0.002,
description: 'API request'
}) Add one button
User clicks "Sign in with allotree" — auth and billing in one flow.
Set your pricing
Per request, per token, per minute — you define the model.
Charge on usage
allotree debits the user wallet instantly after each action.
Get paid
Revenue flows to you — no chasing invoices, no failed payments.