AI Help
How do I track AI API spending separately for each customer or workflow?
Attach a customer or workflow ID to your own usage records and reconcile measured costs with provider billing.
Steps to follow
- Record run ID, tenant or workflow, model, input and output usage, cached usage and billable tools.
- Apply current pricing by billing category and allocate shared storage or infrastructure using a documented rule.
- Aggregate costs by period and compare the totals with the invoice. Keep access controls and data minimization on usage logs.
Example in practice
Illustrative example. A support workflow and a report workflow share a project but have separate internal cost totals through their logged workflow IDs.
Related AI help
- How do I pin an AI model version so my app doesn’t switch models unexpectedly?
- How do I use webhooks to find out when a background AI response is ready?