// 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
Sign in with allotree gives your users auth and billing in a single flow.
Set your price
Per request, per token, per minute — you define the model. No minimums.
Charge on usage
allotree processes the charge instantly after each action — down to a fraction of a cent.
Get paid
Revenue flows to you from request one. No invoices. No failed payments.