Model overview
Aiybiz uses a prepaid wallet model. Clients add funds upfront; sessions deduct from the balance when they end. No invoicing or post-pay.| Who | What |
|---|---|
| Client | Holds a wallet balance (in cents) |
| Session | Billed at duration × pricePerHour when it ends |
| Aiybiz | Keeps 10% platform fee |
| Builder | Receives 90% via Stripe automatic transfer |
Wallet top-up
Client initiates top-up
POST /stripe/wallet/topup { amountCents } → returns a Stripe PaymentIntent clientSecretClient completes payment
The web app uses Stripe Elements to collect card details and confirm the PaymentIntent.
Session billing
When a session ends (manually or by cron):- Client wallet is debited by
billedCents - Builder receives
builderPayoutvia Stripe Transfer to their Connect account - An invoice is generated with the full breakdown
Auto-end cron
A cron job runs hourly againstPOST /internal/check-sessions:
- If
walletBalance < remainingHourlyCost→ session is force-ended - If balance is running low and the client hasn’t been warned → low-balance notification sent
Guards
Stripe Connect
Builders connect a Stripe Express account during onboarding:POST /stripe/connect/onboard→ redirect to Stripe Express onboarding- Builder completes Stripe’s KYC flow
- Stripe fires
account.updatedwebhook → Aiybiz updatesstripeConnectStatus - Once
active, the builder can publish agents and receive payouts
Invoice
Every ended session produces one invoice with:| Field | Description |
|---|---|
totalCents | Full billed amount |
platformFeeCents | 10% Aiybiz fee |
builderPayoutCents | 90% transferred to builder |
stripeTransferId | Stripe Transfer ID |