Back home
Technical reviewLive Demo Lab
Click through the exact AI SaaS billing loop: registration grant, successful deduction, failed-call no deduction, admin recharge, logs, and role protection.
Credits
1,000
Successful AI calls
0
Failed AI calls
0
Admin API rule
403
Interactive Credit Loop
This page is a reviewer demo that works without private Supabase, DeepSeek, or OpenAI keys. The production code still implements the real backend routes and SQL functions described below.
Latest API result
Demo user registered with 1000 credits.
Admin Recharge
Real route:
POST /api/admin/recharge. Normal users get 403. Admins call the SQL function admin_add_credits.Usage Logs
| Time | Action | Status | Credits used | Balance after | Technical note |
|---|---|---|---|---|---|
| Registration | New user profile created | success | 0 | 1000 | Database trigger creates profile and initial_grant transaction. |