Dimensional SKUs
In this Get Started guide, you will learn how to do the following as a "SKU Designer" at a cloud provider.
- Configure a SKU with Dimension based Pricing
- Validate cost estimates
- Use APIs to programmatically retrieve usage metrics for the SKU
This data can then be used by the cloud provider's billing platform to generate a bill for the SKU.
Important
This guide assumes that you have already setup a working SKU (i.e. compute or service profile) based on other/existing Get Started guides.
1. Configure Dimension Based Pricing¶
Next, you will configure dimension based pricing on an existing profile within your default organization. Pricing can be configured within the Global Settings of the default Org.
- In your Default Org, navigate to System -> Global Settings
- Add YAML similar to the following being sure to update the name of the profile, dimensions and base_unit specific to your environment. The dimension names must match the name of input parameters in the profile.
The base_unit is the dividing number to determine the billable units. As an example, if the user selects 2048 for the memory and the base_unit is 1024, the user will be billed at 2x the price rate (2048/1024 = 2). The time_unit can be either m, h or d (minute/hour/day).
- name: <PROFILE_NAME>
billing:
currency:
- USD
dimensions:
- memory
- cpu
ratecard:
memory:
- price: 2
time_unit: h
currency: USD
base_unit: 1024
cpu:
- price: 1
time_unit: h
currency: USD
base_unit: 1000
- Click Save
If a profile contains specific values for a dimension that each have their own pricing, we can define value based dimensions in the following way.
- name: <PROFILE_NAME>
billing:
currency:
- USD
dimensions:
- GPU Type
ratecard:
GPU Type:
- price: 1
time_unit: h
base_value: 1
count_from: "GPU Count"
currency: USD
value: A4
- price: 1.2
time_unit: h
base_value: 1
count_from: "GPU Count"
currency: USD
value: L40
- price: 1.5
time_unit: h
base_value: 1
count_from: "GPU Count"
currency: USD
value: A100
- price: 2.5
time_unit: h
base_value: 1
count_from: "GPU Count"
currency: USD
value: H100
2. Configure Dimension Based Metrics¶
Next, you will configure the profile with the dimensions that should be reported through the metric's API. In the previous step's example, memory and CPU dimensions were added to the rate card. We will now add these two dimensions to the metrics API for this profile.
- In your Default Org, navigate to PaaS Studio
- Edit the Compute or Service profile of your choice
- In the General section, click View Advanced Configuration
- Expand Extra Configuration
- Click Add Extra Configuration
- Enter billableParameters for the key
- Enter JSON similar to the following for the value being sure to update the names of the dimensions and the values to match the dimensions in your environment.
The "name" field is the name of the dimension that will be displayed in the metrics API output. The "value" field is the expression used to match the name of the dimension configured within the ratecard.
[
{
"name": "CPU",
"type": "jsonpath",
"isLabel": true,
"value": "$.spec.variables[?(@.name == 'cpu')].value"
},
{
"name": "Memory",
"type": "jsonpath",
"isLabel": true,
"value": "$.spec.variables[?(@.name == 'memory')].value"
}
]
3. View Dimension Based Pricing Estimates¶
Next you will use the end user facing self service portal (i.e. Developer Hub) to view the newly set dimension pricing estimates.
- In your Default Org, navigate to Developer Hub
- Select the project where your profile resides
- Select the Compute Type of your profile
- Click New \<ComputeType>
Within the Profile Catalog, the profile card will NOT display any cost settings. This is different than the SKU based configuration.
- Click Select on the profile card
You will now see the estimated monthly cost of the instance. If the dimensions are updated within the window, the pricing will be updated to reflect the selections.
- Enter a name for the instance
- Click Deploy
4. Retrieve Dimension Based Metrics/Usage¶
Important
It can take up to 1 hour for usage metrics to be aggregated and available on the controller for retrieval via APIs
Next you will use Swagger to access the Billing APIs in order to pull Dimension based usage metrics.
- In your Default Org, navigate to Documentation -> API Docs -> V3 APIs
- Click Authorize
- Enter the API key. The API Key can be obtained My Tools -> Manage Keys
- Click Authorize
- Click Close
- Locate the APIs under Billing Paas Profile Usage API For Partner
- Expand GET /apis/billing.envmgmt.io/v1/metrics/partner/profile/kind/{kind}/usage
- Click Try it out
- Enter the following parameters
Name | Value |
---|---|
kind | Kind of profile (compute, service) |
profile_name | The name of the dimension based profile to filter on |
range_from | The date range FROM in the format 2025-07-29T00:00:00.157Z |
range_to | The date range To in the format 2025-07-29T00:00:00.157Z |
- Click Execute
You will notice the response for the dimension based profile will display the additional billing parameters that were defined within the profile.