Hard spending limits enforced before every AI action executes. Reserve, authorize, execute, and account — with evidence.
# 1. Create a budget
curl -X POST https://cainstudio.online/fabric/budgets \
-H "X-Tenant-ID: your-tenant" \
-H "Content-Type: application/json" \
-d '{"name":"$100/month limit","scope":"tenant","limit_cents":10000,"period":"monthly","hard_limit":true}'
# 2. Reserve before an action (enforcement point)
curl -X POST https://cainstudio.online/fabric/budgets/{budget_id}/reserve \
-H "X-Tenant-ID: your-tenant" \
-H "Content-Type: application/json" \
-d '{"amount_cents":150,"action":"model_inference"}'
# 3. Commit after execution (record actual cost)
curl -X POST https://cainstudio.online/fabric/budgets/{budget_id}/commit/{reservation_id} \
-H "X-Tenant-ID: your-tenant" \
-H "Content-Type: application/json" \
-d '{"actual_cost_cents":142}'
# 4. Release if action was not executed
curl -X POST https://cainstudio.online/fabric/budgets/{budget_id}/release/{reservation_id} \
-H "X-Tenant-ID: your-tenant"
| Method | Path | Description |
|---|---|---|
| GET | /fabric/budgets | List all budgets for tenant |
| POST | /fabric/budgets | Create a new budget |
| GET | /fabric/budgets/{id} | Get budget details |
| PATCH | /fabric/budgets/{id} | Update budget limits |
| POST | /fabric/budgets/{id}/reserve | Reserve funds (enforcement point) |
| POST | /fabric/budgets/{id}/commit/{res_id} | Commit actual cost |
| POST | /fabric/budgets/{id}/release/{res_id} | Release unused reservation |
| GET | /fabric/budgets/{id}/usage | Get spending usage |
| GET | /fabric/budgets/{id}/transactions | Get transaction history |
| POST | /fabric/budgets/{id}/freeze | Freeze budget (deny all) |
| POST | /fabric/budgets/{id}/unfreeze | Unfreeze budget |
cain budget list
cain budget get {budget_id}
cain budget create --name "My Budget" --limit-cents 5000 --period monthly
cain budget reserve {budget_id} --amount 100 --action model_inference
cain budget commit {budget_id} {reservation_id} --actual-cost 95
cain budget release {budget_id} {reservation_id}
cain budget usage {budget_id}
cain budget freeze {budget_id}
cain budget unfreeze {budget_id}
Try CAIN Budget without an account at https://cainstudio.online/budget — live enforcement with a $10 demo budget.