Billing Service — AI Integration
Status: populated Owner: Platform Engineering Last updated: 2026-04-18
1. Current Usage
None. Billing calculations are deterministic and purely data-driven. AI is explicitly excluded from pricing or margin computation to maintain auditability and regulatory compliance.
2. Forward-Looking (not in scope)
| Candidate | Purpose |
|---|---|
| Anomaly detection on billing events | Flag unusual usage spikes (e.g. 10x normal volume) before invoice generation |
| Usage forecast | Predict next-period spend for customer self-service forecasting (customer-portal) |
| Pricing optimization | Suggest margin-positive pricing updates based on operator cost trends |
All future AI integrations must route through ai-gateway-service per platform rules. No direct vendor SDK imports from billing-service.
3. Auditability Constraint
Any AI-derived billing adjustment (e.g. anomaly-triggered credit) must produce an explicit AIProvenance record before being applied:
interface AIProvenance {
purpose: string;
model: string;
version: string;
promptHash: string;
decisionId: string;
at: string;
}
AI decisions that affect invoice amounts require a human approval step before finalization. This is a hard requirement, not a guideline.