- Track resource usage in our own DB - cloud billing APIs lag 24-48hrs and we need real-time data for user dashboards
- Write start/stop events when enclaves launch/terminate, including cloud resource ID so we can reconcile later
- Hourly cron aggregates running time per user into billing summaries
- We set our own pricing tiers - cloud costs are our problem, customers pay our rates
- Use Paddle as payment processor (Stripe unavailable in Cayman Islands) - they handle tax compliance as Merchant of Record
- Report metered usage to Paddle monthly, they invoice customers
- Cloud provider APIs (AWS Cost Explorer etc) only used for monthly sanity checks - verify we didn't miss any stop events or have orphaned resources
- Abstract cloud-specific stuff behind a trait so billing logic doesn't care which provider
- Billing runs as separate service/worker - isolated from main API
* Track resource usage in our own DB - cloud billing APIs lag 24-48hrs and we need real-time data for user dashboards
* Write start/stop events when enclaves launch/terminate, including cloud resource ID so we can reconcile later
* Hourly cron aggregates running time per user into billing summaries
* We set our own pricing tiers - cloud costs are our problem, customers pay our rates
* Use Paddle as payment processor (Stripe unavailable in Cayman Islands) - they handle tax compliance as Merchant of Record
* Report metered usage to Paddle monthly, they invoice customers
* Cloud provider APIs (AWS Cost Explorer etc) only used for monthly sanity checks - verify we didn't miss any stop events or have orphaned resources
* Abstract cloud-specific stuff behind a trait so billing logic doesn't care which provider
* Billing runs as separate service/worker - isolated from main API