Skip to content
reaatech

Per-tenant LLM Cost Chargeback for Vertical SaaS

Track and bill each SMB customer for their AI usage with granular cost attribution.

The problem

As a product manager at a vertical SaaS company, you need to offer AI features to your SMB customers but each customer may use different LLM providers based on their plan. You lack per-tenant cost tracking, making it impossible to charge back usage accurately. This leads to margin erosion and prevents you from scaling AI features profitably. You need a solution that captures LLM costs per tenant and integrates with your existing billing system.

Example artifact

A complete, working implementation of this recipe — downloadable as a zip or browsable file by file. Generated by our build pipeline; tested with full coverage before publishing.

168 kB·99 tests·98.0% coverage·vitest passing

SHA-25683dc7fc04155f3d250bc18504974e5058d58c81d33fdfb23a358018fbe8efd41

Comments

Sign in with GitHub to comment and vote.

Loading comments…