// 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. lock funds
await allotree.lock({
userId: session.userId,
amount: 0.003,
description: 'API request #123'
})
// 4. charge per usage
await allotree.charge({
userId: session.userId,
amount: 0.002,
description: 'API request #123'
}) Add one button
Sign in with allotree gives your users auth and billing in a single flow. One button. Both sides handled.
Set your price
Per request, per token, per second — you define the model. No minimums. No floors.
Verify & Lock
Instantly check if the user has enough funds and reserve them before you perform the action.
Charge on delivery
allotree processes the charge the moment the action completes. Instantly. To the fraction of a cent.
Get paid
Revenue from first delivery. No usage threshold. No free tier.