Prerequisites
Pricing policies are project-level resources.- Web console
- CLI
- Go SDK
- Python SDK
- JavaScript SDK
Make sure that you’re in a group that has one of the following roles within the project, depending on what you need to do:
- To view pricing policies: at least the
viewerrole. - To create, edit or delete pricing policies: at least the
editorrole.
- Install and configure the Nebius AI Cloud CLI.
-
Make sure that you’re in a group that has one of the following roles within the project, depending on what you need to do:
- To view pricing policies: at least the
viewerrole. - To create, edit or delete pricing policies: at least the
editorrole.
- To view pricing policies: at least the
- Install and initialize the Nebius SDK for Go.
-
Make sure that you’re in a group that has one of the following roles within the project, depending on what you need to do:
- To view pricing policies: at least the
viewerrole. - To create, edit or delete pricing policies: at least the
editorrole.
- To view pricing policies: at least the
- Install and initialize the Nebius SDK for Python.
-
Make sure that you’re in a group that has one of the following roles within the project, depending on what you need to do:
- To view pricing policies: at least the
viewerrole. - To create, edit or delete pricing policies: at least the
editorrole.
- To view pricing policies: at least the
- Install and initialize the Nebius SDK for JavaScript.
-
Make sure that you’re in a group that has one of the following roles within the project, depending on what you need to do:
- To view pricing policies: at least the
viewerrole. - To create, edit or delete pricing policies: at least the
editorrole.
- To view pricing policies: at least the
How to view pricing policies
- Web console
- CLI
- Go SDK
- Python SDK
- JavaScript SDK
-
In the web console, go to
Billing → Pricing.
- Switch to the Pricing policy tab and find the policy that you need. If the policy status is Blocked, its max price is lower than the current spot price. Resources that use this policy can’t start until the spot price decreases or until you increase the max price.
To list pricing policies in a project, run:To get a pricing policy by ID, run:In the output, check
nebius billing pricing-policy list \
--parent-id <project_ID>
nebius billing pricing-policy get \
--id <pricing_policy_ID>
status.scheduling_state. If the value is SCHEDULING_STATE_BLOCKED, the policy’s max price is lower than the current spot price.-
List pricing policies in a project:
In the code, set
pricingPolicyService := sdk.Services().Billing().V1(). PricingPolicy() policies, err := pricingPolicyService.List( ctx, &billing.ListPricingPoliciesRequest{ ParentId: "<project_ID>", }, ) if err != nil { return fmt.Errorf("list pricing policies: %w", err) } fmt.Println(policies)ParentIdto the project ID. Copy theMetadata.Idvalue of the required policy in the list output. -
Get a pricing policy by ID:
In the code, set
pricingPolicyService := sdk.Services().Billing().V1(). PricingPolicy() policy, err := pricingPolicyService.Get( ctx, &billing.GetPricingPolicyRequest{ Id: "<pricing_policy_ID>", }, ) if err != nil { return fmt.Errorf("get pricing policy: %w", err) } fmt.Println(policy)Idto the pricing policy ID that you copied. In the output, checkStatus.SchedulingState. If the value isbilling.PricingPolicyStatus_SCHEDULING_STATE_BLOCKED, the policy’s max price is lower than the current spot price.
-
List pricing policies in a project:
In the code, set
pricing_policy_service = PricingPolicyServiceClient(sdk) pricing_policies = await pricing_policy_service.list( ListPricingPoliciesRequest( parent_id="<project_ID>", ), ) print(pricing_policies)parent_idto the project ID. Copy themetadata.idvalue of the required policy in the list output. -
Get a pricing policy by ID:
In the code, set
pricing_policy_service = PricingPolicyServiceClient(sdk) pricing_policy = await pricing_policy_service.get( GetPricingPolicyRequest( id="<pricing_policy_ID>", ), ) print(pricing_policy)idto the pricing policy ID that you copied. In the output, checkstatus.scheduling_state. If the value isSCHEDULING_STATE_BLOCKED, the policy’s max price is lower than the current spot price.
-
List pricing policies in a project:
In the code, set
const listService = new PricingPolicyService(sdk); const pricingPolicies = await listService.list( ListPricingPoliciesRequest.create({ parentId: "<project_ID>", }), ).result; console.log(pricingPolicies);parentIdto the project ID. Copy themetadata.idvalue of the required policy in the list output. -
Get a pricing policy by ID:
In the code, set
const getService = new PricingPolicyService(sdk); const fetchedPricingPolicy = await getService.get( GetPricingPolicyRequest.create({ id: "<pricing_policy_ID>", }), ).result; console.log(fetchedPricingPolicy);idto the pricing policy ID that you copied. In the output, checkstatus.schedulingState. If the value isSCHEDULING_STATE_BLOCKED, the policy’s max price is lower than the current spot price.
How to create a pricing policy
You can create a pricing policy before creating preemptible resources, or create it while configuring a new resource in the web console.- Web console
- CLI
- Go SDK
- Python SDK
- JavaScript SDK
-
In the web console, go to
Billing → Pricing.
-
Switch to the Pricing policy tab and click
Create pricing policy.
- Enter a policy name. It can only contain Latin letters and numbers, with no special characters.
- Select the project where the policy will be available.
- Select the GPU platform for the policy.
- In Max price, enter the highest spot price per GPU hour at which preemptible resources can run on this platform. The web console shows the minimum price for the selected platform. The value must be higher than or equal to the minimum price. To let resources start while the current spot price stays unchanged, enter a value that is higher than or equal to the current spot price.
- Click Create pricing policy.
-
Get the current spot price for the GPU platform:
Specify the project where you create the pricing policy, as well as the platform and preset. In the output,
nebius billing v1alpha1 calculator estimate \ --resource-spec-compute-instance-spec-parent-id <project_ID> \ --resource-spec-compute-instance-spec-resources-platform <platform_ID> \ --resource-spec-compute-instance-spec-resources-preset <preset> \ --resource-spec-compute-instance-spec-preemptible-on-preemption STOPhourly_cost.general.total.costis the current hourly spot price of a preemptible VM with the specified preset in the project’s region:To get the spot price per GPU hour, divide this value by the number of GPUs in the preset. For example, divide by 8 forhourly_cost: general: total: cost: "2.5" cost_rounded: "2.5"8gpu-128vcpu-1600gb. -
Create the pricing policy:
In this command:
nebius billing pricing-policy create \ --parent-id <project_ID> \ --name <pricing_policy_name> \ --compute-instance-spec-v1-platform <platform_ID> \ --pricing-max-price-v1-max-price <max_price>--parent-id: ID of the project where the pricing policy will be available.--name: Pricing policy name. It can only contain Latin letters and numbers, with no special characters.--compute-instance-spec-v1-platform: GPU platform ID, for examplegpu-h100-sxm.--pricing-max-price-v1-max-price: Maximum spot price per GPU hour in your billing currency. The value must be higher than or equal to the minimum price. If the value is lower than the current spot price, the policy is created with blocked scheduling.
-
Get the current spot price for the GPU platform:
Specify the project where you create the pricing policy, as well as the platform and preset. The code prints the current hourly spot price of a preemptible VM with the specified preset in the project’s region. To get the spot price per GPU hour, divide this value by the number of GPUs in the preset. For example, divide by 8 for
computeInstanceSpec := &compute.CreateInstanceRequest{ Metadata: &common.ResourceMetadata{ ParentId: "<project_ID>", }, Spec: &compute.InstanceSpec{ Resources: &compute.ResourcesSpec{ Platform: "<platform_ID>", Size: &compute.ResourcesSpec_Preset{ Preset: "<preset>", }, }, Preemptible: &compute.PreemptibleSpec{ OnPreemption: compute.PreemptibleSpec_STOP, }, }, } calculatorService := sdk.Services().Billing().V1Alpha1(). Calculator() estimate, err := calculatorService.Estimate( ctx, &billing.EstimateRequest{ ResourceSpec: &billing.ResourceSpec{ ResourceSpec: &billing.ResourceSpec_ComputeInstanceSpec{ ComputeInstanceSpec: computeInstanceSpec, }, }, }, ) if err != nil { return fmt.Errorf("estimate spot price: %w", err) } spotPrice := estimate.GetHourlyCost().GetGeneral(). GetTotal().GetCost() fmt.Println(spotPrice)8gpu-128vcpu-1600gb. -
Create the pricing policy:
In the code:
pricingPolicyService := sdk.Services().Billing().V1(). PricingPolicy() pricingPolicyOperation, err := pricingPolicyService.Create( ctx, &billing.CreatePricingPolicyRequest{ Metadata: &common.ResourceMetadata{ ParentId: "<project_ID>", Name: "<pricing_policy_name>", }, Spec: &billing.PricingPolicySpec{ ComputeInstanceSpec: &billing.ComputeInstanceSpec{ Versions: &billing.ComputeInstanceSpec_V1{ V1: &billing.ComputeInstanceSpecV1{ Platform: "<platform_ID>", }, }, }, Pricing: &billing.PricingMethod{ Versions: &billing.PricingMethod_MaxPriceV1{ MaxPriceV1: &billing.MaxPriceV1{ MaxPrice: "<max_price>", }, }, }, }, }, ) if err != nil { return fmt.Errorf("create pricing policy: %w", err) } pricingPolicyOperation, err = pricingPolicyOperation.Wait(ctx) if err != nil { return fmt.Errorf("wait for pricing policy creation: %w", err) } fmt.Println(pricingPolicyOperation.ResourceID())Metadata.ParentId: ID of the project where the pricing policy will be available.Metadata.Name: Pricing policy name. It can only contain Latin letters and numbers, with no special characters.Spec.ComputeInstanceSpec.Versions.V1.Platform: GPU platform ID, for examplegpu-h100-sxm.Spec.Pricing.Versions.MaxPriceV1.MaxPrice: Maximum spot price per GPU hour in your billing currency. The value must be higher than or equal to the minimum price. If the value is lower than the current spot price, the policy is created with blocked scheduling.
-
Get the current spot price for the GPU platform:
Specify the project where you create the pricing policy, as well as the platform and preset. The code prints the current hourly spot price of a preemptible VM with the specified preset in the project’s region. To get the spot price per GPU hour, divide this value by the number of GPUs in the preset. For example, divide by 8 for
compute_instance_spec = CreateInstanceRequest( metadata=ResourceMetadata( parent_id="<project_ID>", ), spec=InstanceSpec( resources=ResourcesSpec( platform="<platform_ID>", preset="<preset>", ), preemptible=PreemptibleSpec( on_preemption=( PreemptibleSpec.PreemptionPolicy.STOP ), ), ), ) calculator_service = CalculatorServiceClient(sdk) estimate = await calculator_service.estimate( EstimateRequest( resource_spec=ResourceSpec( compute_instance_spec=compute_instance_spec, ), ), ) print(estimate.hourly_cost.general.total.cost)8gpu-128vcpu-1600gb. -
Create the pricing policy:
In the code:
pricing_policy_service = PricingPolicyServiceClient(sdk) pricing_policy_operation = await pricing_policy_service.create( CreatePricingPolicyRequest( metadata=ResourceMetadata( parent_id="<project_ID>", name="<pricing_policy_name>", ), spec=PricingPolicySpec( compute_instance_spec=ComputeInstanceSpec( v1=ComputeInstanceSpecV1( platform="<platform_ID>", ), ), pricing=PricingMethod( max_price_v1=MaxPriceV1( max_price="<max_price>", ), ), ), ), ) await pricing_policy_operation.wait() print(pricing_policy_operation.resource_id)metadata.parent_id: ID of the project where the pricing policy will be available.metadata.name: Pricing policy name. It can only contain Latin letters and numbers, with no special characters.spec.compute_instance_spec.v1.platform: GPU platform ID, for examplegpu-h100-sxm.spec.pricing.max_price_v1.max_price: Maximum spot price per GPU hour in your billing currency. The value must be higher than or equal to the minimum price. If the value is lower than the current spot price, the policy is created with blocked scheduling.
-
Get the current spot price for the GPU platform:
Specify the project where you create the pricing policy, as well as the platform and preset. The code prints the current hourly spot price of a preemptible VM with the specified preset in the project’s region. To get the spot price per GPU hour, divide this value by the number of GPUs in the preset. For example, divide by 8 for
const computeInstanceSpec = CreateInstanceRequest.create({ metadata: ResourceMetadata.create({ parentId: "<project_ID>", }), spec: InstanceSpec.create({ resources: ResourcesSpec.create({ platform: "<platform_ID>", size: { $case: "preset", preset: "<preset>", }, }), preemptible: PreemptibleSpec.create({ onPreemption: PreemptibleSpec_PreemptionPolicy.STOP, }), }), }); const calculatorService = new CalculatorService(sdk); const estimate = await calculatorService.estimate( EstimateRequest.create({ resourceSpec: ResourceSpec.create({ resourceSpec: { $case: "computeInstanceSpec", computeInstanceSpec, }, }), }), ).result; console.log( estimate.hourlyCost?.costType?.general?.total?.cost, );8gpu-128vcpu-1600gb. -
Create the pricing policy:
In the code:
const createService = new PricingPolicyService(sdk); const createPricingPolicyOp = await createService.create( CreatePricingPolicyRequest.create({ metadata: ResourceMetadata.create({ parentId: "<project_ID>", name: "<pricing_policy_name>", }), spec: PricingPolicySpec.create({ computeInstanceSpec: ComputeInstanceSpec.create({ versions: { $case: "v1", v1: ComputeInstanceSpecV1.create({ platform: "<platform_ID>", }), }, }), pricing: PricingMethod.create({ versions: { $case: "maxPriceV1", maxPriceV1: MaxPriceV1.create({ maxPrice: "<max_price>", }), }, }), }), }), ).result; await createPricingPolicyOp.wait(); console.log(createPricingPolicyOp.resourceId());metadata.parentId: ID of the project where the pricing policy will be available.metadata.name: Pricing policy name. It can only contain Latin letters and numbers, with no special characters.spec.computeInstanceSpec.versions.v1.platform: GPU platform ID, for examplegpu-h100-sxm.spec.pricing.versions.maxPriceV1.maxPrice: Maximum spot price per GPU hour in your billing currency. The value must be higher than or equal to the minimum price. If the value is lower than the current spot price, the policy is created with blocked scheduling.
How to edit a pricing policy
To update the max price in a pricing policy, first stop all running resources that use that policy.
- Web console
- CLI
- Go SDK
- Python SDK
- JavaScript SDK
- In the web console, go to
Billing → Pricing.
- Switch to the Pricing policy tab.
- Find the policy you want to edit and click
→ Edit.
- Rename the policy or adjust the max price. The policy name can only contain Latin letters and numbers, with no special characters.
- Click Save changes.
-
Get the pricing policy ID by name. To do this, use nebius billing pricing-policy get-by-name with the pricing policy name and the project ID.
In the output, copy the
metadata.idvalue. -
To rename the pricing policy, run:
In this command:
nebius billing pricing-policy update <pricing_policy_ID> \ --name <new_pricing_policy_name><pricing_policy_ID>: ID of the pricing policy that you copied.--name: New pricing policy name. It can only contain Latin letters and numbers, with no special characters.
-
To update the max price, run:
The max price can only be updated when there are no running VMs associated with that policy.
nebius billing pricing-policy update <pricing_policy_ID> \ --pricing-max-price-v1-max-price <max_price>
-
Get the pricing policy ID. To do this, list pricing policies in a project and find the required policy by name:
In the code, set
pricingPolicyService := sdk.Services().Billing().V1(). PricingPolicy() policies, err := pricingPolicyService.List( ctx, &billing.ListPricingPoliciesRequest{ ParentId: "<project_ID>", }, ) if err != nil { return fmt.Errorf("list pricing policies: %w", err) } fmt.Println(policies)ParentIdto the project ID. Copy theMetadata.Idvalue of the required policy in the list output. -
Rename the pricing policy:
In the code:
pricingPolicyService := sdk.Services().Billing().V1(). PricingPolicy() policy, err := pricingPolicyService.Get( ctx, &billing.GetPricingPolicyRequest{ Id: "<pricing_policy_ID>", }, ) if err != nil { return fmt.Errorf("get pricing policy: %w", err) } pricingPolicyOperation, err := pricingPolicyService.Update( ctx, &billing.UpdatePricingPolicyRequest{ Metadata: &common.ResourceMetadata{ Id: policy.GetMetadata().GetId(), ParentId: policy.GetMetadata().GetParentId(), Name: "<new_pricing_policy_name>", }, Spec: policy.GetSpec(), }, ) if err != nil { return fmt.Errorf("rename pricing policy: %w", err) } pricingPolicyOperation, err = pricingPolicyOperation.Wait(ctx) if err != nil { return fmt.Errorf("wait for pricing policy rename: %w", err) } fmt.Println(pricingPolicyOperation)GetPricingPolicyRequest.Id: The pricing policy ID that you copied.Metadata.Name: New pricing policy name. It can only contain Latin letters and numbers, with no special characters.
-
Update the max price:
The max price can only be updated when there are no running VMs associated with that policy.
pricingPolicyService := sdk.Services().Billing().V1(). PricingPolicy() policy, err := pricingPolicyService.Get( ctx, &billing.GetPricingPolicyRequest{ Id: "<pricing_policy_ID>", }, ) if err != nil { return fmt.Errorf("get pricing policy: %w", err) } pricingPolicySpec := policy.GetSpec() pricingPolicySpec.Pricing = &billing.PricingMethod{ Versions: &billing.PricingMethod_MaxPriceV1{ MaxPriceV1: &billing.MaxPriceV1{ MaxPrice: "<max_price>", }, }, } pricingPolicyOperation, err := pricingPolicyService.Update( ctx, &billing.UpdatePricingPolicyRequest{ Metadata: &common.ResourceMetadata{ Id: policy.GetMetadata().GetId(), ParentId: policy.GetMetadata().GetParentId(), Name: policy.GetMetadata().GetName(), }, Spec: pricingPolicySpec, }, ) if err != nil { return fmt.Errorf("update pricing policy max price: %w", err) } pricingPolicyOperation, err = pricingPolicyOperation.Wait(ctx) if err != nil { return fmt.Errorf("wait for pricing policy update: %w", err) } fmt.Println(pricingPolicyOperation)
-
Get the pricing policy ID. To do this, list pricing policies in a project and find the required policy by name:
In the code, set
pricing_policy_service = PricingPolicyServiceClient(sdk) pricing_policies = await pricing_policy_service.list( ListPricingPoliciesRequest( parent_id="<project_ID>", ), ) print(pricing_policies)parent_idto the project ID. Copy themetadata.idvalue of the required policy in the list output. -
Rename the pricing policy:
In the code:
pricing_policy_service = PricingPolicyServiceClient(sdk) pricing_policy = await pricing_policy_service.get( GetPricingPolicyRequest( id="<pricing_policy_ID>", ), ) pricing_policy_operation = await pricing_policy_service.update( UpdatePricingPolicyRequest( metadata=ResourceMetadata( id=pricing_policy.metadata.id, parent_id=pricing_policy.metadata.parent_id, name="<new_pricing_policy_name>", ), spec=pricing_policy.spec, ), ) await pricing_policy_operation.wait() print(pricing_policy_operation)GetPricingPolicyRequest.id: The pricing policy ID that you copied.metadata.name: New pricing policy name. It can only contain Latin letters and numbers, with no special characters.
-
Update the max price:
The max price can only be updated when there are no running VMs associated with that policy.
pricing_policy_service = PricingPolicyServiceClient(sdk) pricing_policy = await pricing_policy_service.get( GetPricingPolicyRequest( id="<pricing_policy_ID>", ), ) pricing_policy.spec.pricing = PricingMethod( max_price_v1=MaxPriceV1( max_price="<max_price>", ), ) pricing_policy_operation = await pricing_policy_service.update( UpdatePricingPolicyRequest( metadata=ResourceMetadata( id=pricing_policy.metadata.id, parent_id=pricing_policy.metadata.parent_id, name=pricing_policy.metadata.name, ), spec=pricing_policy.spec, ), ) await pricing_policy_operation.wait() print(pricing_policy_operation)
-
Get the pricing policy ID. To do this, list pricing policies in a project and find the required policy by name:
In the code, set
const listService = new PricingPolicyService(sdk); const pricingPolicies = await listService.list( ListPricingPoliciesRequest.create({ parentId: "<project_ID>", }), ).result; console.log(pricingPolicies);parentIdto the project ID. Copy themetadata.idvalue of the required policy in the list output. -
Rename the pricing policy:
In the code:
const renameService = new PricingPolicyService(sdk); const pricingPolicyToRename = await renameService.get( GetPricingPolicyRequest.create({ id: "<pricing_policy_ID>", }), ).result; const renamePricingPolicyOp = await renameService.update( UpdatePricingPolicyRequest.create({ metadata: ResourceMetadata.create({ id: pricingPolicyToRename.metadata.id, parentId: pricingPolicyToRename.metadata.parentId, name: "<new_pricing_policy_name>", }), spec: pricingPolicyToRename.spec, }), ).result; await renamePricingPolicyOp.wait(); console.log(renamePricingPolicyOp);GetPricingPolicyRequest.id: The pricing policy ID that you copied.metadata.name: New pricing policy name. It can only contain Latin letters and numbers, with no special characters.
-
Update the max price:
The max price can only be updated when there are no running VMs associated with that policy.
const updateService = new PricingPolicyService(sdk); const pricingPolicyToUpdate = await updateService.get( GetPricingPolicyRequest.create({ id: "<pricing_policy_ID>", }), ).result; pricingPolicyToUpdate.spec.pricing = PricingMethod.create({ versions: { $case: "maxPriceV1", maxPriceV1: MaxPriceV1.create({ maxPrice: "<max_price>", }), }, }); const updatePricingPolicyOp = await updateService.update( UpdatePricingPolicyRequest.create({ metadata: ResourceMetadata.create({ id: pricingPolicyToUpdate.metadata.id, parentId: pricingPolicyToUpdate.metadata.parentId, name: pricingPolicyToUpdate.metadata.name, }), spec: pricingPolicyToUpdate.spec, }), ).result; await updatePricingPolicyOp.wait(); console.log(updatePricingPolicyOp);
How to delete a pricing policy
Deleting a pricing policy can stop resources that use it. Stopped VMs keep their attached volumes, and the volumes continue to be charged until you delete them. For more information about stopping charges for unused resources, see How to stop being charged.
- Web console
- CLI
- Go SDK
- Python SDK
- JavaScript SDK
-
In the web console, go to
Billing → Pricing.
- Switch to the Pricing policy tab.
- Check the number of running resources that use the policy.
-
Find the policy you want to delete and click
→ Delete. If the web console shows affected resources, review them and continue only if they can be stopped.
- Enter the policy name and click Delete policy.
-
Get the pricing policy ID by name. To do this, use nebius billing pricing-policy get-by-name with the pricing policy name and the project ID.
In the output, copy the
metadata.idvalue. -
Delete the pricing policy:
nebius billing pricing-policy delete \ --id <pricing_policy_ID>
-
Get the pricing policy ID. To do this, list pricing policies in a project and find the required policy by name:
In the code, set
pricingPolicyService := sdk.Services().Billing().V1(). PricingPolicy() policies, err := pricingPolicyService.List( ctx, &billing.ListPricingPoliciesRequest{ ParentId: "<project_ID>", }, ) if err != nil { return fmt.Errorf("list pricing policies: %w", err) } fmt.Println(policies)ParentIdto the project ID. Copy theMetadata.Idvalue of the required policy in the list output. -
Delete the pricing policy:
In the code, set
pricingPolicyService := sdk.Services().Billing().V1(). PricingPolicy() pricingPolicyOperation, err := pricingPolicyService.Delete( ctx, &billing.DeletePricingPolicyRequest{ Id: "<pricing_policy_ID>", }, ) if err != nil { return fmt.Errorf("delete pricing policy: %w", err) } pricingPolicyOperation, err = pricingPolicyOperation.Wait(ctx) if err != nil { return fmt.Errorf("wait for pricing policy deletion: %w", err) } fmt.Println(pricingPolicyOperation)DeletePricingPolicyRequest.Idto the pricing policy ID that you copied.
-
Get the pricing policy ID. To do this, list pricing policies in a project and find the required policy by name:
In the code, set
pricing_policy_service = PricingPolicyServiceClient(sdk) pricing_policies = await pricing_policy_service.list( ListPricingPoliciesRequest( parent_id="<project_ID>", ), ) print(pricing_policies)parent_idto the project ID. Copy themetadata.idvalue of the required policy in the list output. -
Delete the pricing policy:
In the code, set
pricing_policy_service = PricingPolicyServiceClient(sdk) pricing_policy_operation = await pricing_policy_service.delete( DeletePricingPolicyRequest( id="<pricing_policy_ID>", ), ) await pricing_policy_operation.wait() print(pricing_policy_operation)DeletePricingPolicyRequest.idto the pricing policy ID that you copied.
-
Get the pricing policy ID. To do this, list pricing policies in a project and find the required policy by name:
In the code, set
const listService = new PricingPolicyService(sdk); const pricingPolicies = await listService.list( ListPricingPoliciesRequest.create({ parentId: "<project_ID>", }), ).result; console.log(pricingPolicies);parentIdto the project ID. Copy themetadata.idvalue of the required policy in the list output. -
Delete the pricing policy:
In the code, set
const deleteService = new PricingPolicyService(sdk); const deletePricingPolicyOp = await deleteService.delete( DeletePricingPolicyRequest.create({ id: "<pricing_policy_ID>", }), ).result; await deletePricingPolicyOp.wait(); console.log(deletePricingPolicyOp);DeletePricingPolicyRequest.idto the pricing policy ID that you copied.