Cloud providers building GPU or Neo Cloud services face a universal challenge: how to turn resource consumption into revenue with accuracy, automation, and operational efficiency. In our previous blog, we demonstrated how to programmatically retrieve usage data from Rafay’s Usage Metering APIs and generate structured CSVs for downstream processing in an external billing platform.
In this follow-up blog, we take the next step toward a complete billing workflow—automatically transforming usage into billable cost using SKU-specific pricing. With GPU clouds scaling faster than ever and enterprise AI workloads becoming increasingly dynamic, providers must ensure their billing engine is consistent, transparent, and tightly integrated with their platform. The enhancements described in this blog are designed exactly for that.
Why Cost Automation Matters for GPU Cloud Providers
When a customer launches a GPU VM, deploys a Slurm workload, or provisions an AI/ML environment, they expect metering and billing to just work. Fortunately, Rafay’s Usage Metering API gives providers a clean, structured view of usage—broken down by organization (i.e. tenant), profile (i.e. SKU), instance, and duration.
However, raw usage alone is not enough for billing teams. To generate invoices or chargeback reports, someone must:
Map SKUs to hourly pricing
Compute usage × rate
Apply reserved/on-demand logic
Layer in additional fees (storage, egress, warm pools, etc.)
Export the results into a billing system
Most organizations build a billing pipeline for this, but without automation, billing becomes brittle and error-prone. Manually joining usage data with a price book slows invoicing cycles and creates room for discrepancies.
For organizations that do not have a billing platform, we have enhanced our original utility to now calculate costs automatically, producing a CSV that is immediately ready for billing ingestion.
About the Utility
Download
The ncp_metrics.py script is a Python utility that collects billing and usage metrics for compute and service instances from the Rafay Console API. It generates CSV reports containing detailed billing information including usage hours, billing rates, and calculated billing amounts for each instance.
What the Utility Does
Fetches Instance Usage Data Retrieves compute and service instance usage data for a specified time range
Retrieves Billing Information Looks up billing rates for each profile associated with instances
Calculates Billing Amounts Computes total billing amounts based on usage hours and billing rates
Generates CSV Reports Creates timestamped CSV files with all metrics
Sorts Output Produces a sorted version of the CSV file organized by organization name
Prerequisites
requests - For making HTTP API calls
csv - For CSV file operations (built-in)
datetime - For date/time operations (built-in)
Environment Variables
This exercise assumes that you have access to an instance of the Rafay Platform (i.e. Controller). Ensure that you have Org Admin level access to the Default Org so that you can use the API Keys to programmatically retrieve the usage metering data.
The utility requires the following environment variables to be set:
ncp-metrics-sorted-{timestamp}.csv: Sorted by organization name
Example filenames:
ncp-metrics-12092025-154146.csv
ncp-metrics-sorted-12092025-154146.csv
Example Output
Notice the billing rate and billing amount columns.
Organization
Profile Type
Profile
Instance
Usage (h)
Status
Billing Rate
Billing Amount (EUR)
Coke
Compute
medium-gpu-vm
coke-2-gpu-vm
238.00h
Running
EUR 2/h
476
Coke
Compute
small-vcluster
coke-small-vcluster-instance
238.00h
Running
EUR 2/h
476
Coke
Service
small-vllm
small-inference-endpoint-user
238.00h
Running
EUR 3/h
714
Coke
Service
small-vllm
coke-demo-inference-ep
238.00h
Running
EUR 3/h
714
Closing Thoughts
GPU cloud providers are moving rapidly toward usage-based economics for both infrastructure (GPU VMs, MIG slices, Slurm clusters) and AI services (model hosting, fine-tuning, inference endpoints). To operate at scale, they require automated, transparent billing workflows.
By enhancing the usage metering utility to include SKU-based cost calculation, we’ve taken a major step toward enabling frictionless billing integration for cloud and enterprise providers. The pipeline is modular, extensible, and easy to adapt to your pricing model.
Rafay Joins VAST Cosmos to Enable Governed GPU-Powered AI Services
Rafay has joined the VAST Cosmos Community as a Technology Partner, aligning its AI-native cloud control plane with the VAST AI Operating System to help organizations operationalize GPU-powered AI. Together, Rafay and VAST integrate governed compute orchestration and scalable data services, enabling NeoCloud providers and enterprises to transform raw infrastructure into consistent, production-ready AI platforms.