Billing and metering for an enterprise generative AI platform

We worked with an internal startup within an enterprise building a generative AI platform, needing infrastructure to track AI usage, attribute costs, enforce quotas, and enable sophisticated billing - all while supporting enterprise-grade identity management for large organizations.

We designed and implemented a comprehensive metering and billing system using OpenMeter, instrumenting the NestJS-based core API to capture LLM token consumption, compute time, storage, and API requests across all product lines. The architecture flowed events from GCP infrastructure and LLM providers through an enrichment pipeline adding customer context, business unit mapping, and cost attribution before landing in OpenMeter's ClickHouse backend. We built a credit system supporting per-model token credits, compute credits, and feature-specific allocations with configurable grant mechanisms, expiration rules, and priority handling. The solution included both product team dashboards (revenue metrics, cost analysis, customer health) and customer-facing dashboards (usage tracking, quota management, budget forecasting).

In parallel, we implemented enterprise identity management by integrating WorkOS for SCIM-based directory sync, enabling the platform's enterprise customers to provision and deprovision users directly from their corporate IdP. The architecture handled SCIM webhook events through PubSub to Firebase, supporting automatic organization creation, SSO domain mapping, and role synchronization based on IdP groups. This work replaced the original Auth0-based approach with a more scalable solution that supported self-serve tenant onboarding, automatic subdomain provisioning, and cross-tenant user management-critical capabilities for their go-to-market with large enterprise customers.


Find out more about the work we've done, and the services we offer, or just contact us right now to discuss your project.

Billing and metering for an enterprise generative AI platform - Autotelic Development