The Billing API uses Kubernetes custom resources and relies on the
Kubernetes Resource Model (KRM) to manage SKUs for
Google Distributed Cloud (GDC) air-gapped services.

To use the Billing API, use the GDC console. If your application uses
your own libraries to call the API, adopt the example service endpoint in the
following section, and the full API definitions to build your requests.

- [billing.gdc.goog/v1](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/service/billing/v1/billing-v1.md.txt)
- [billing.global.gdc.goog/v1](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/service/billing/v1/global-billing-v1.md.txt)

## Service endpoint and discovery document

The Billing APIs are provided in two packages depending on zonal deployment or
global deployment.

The API endpoints for the zonal and global Billing APIs are the following,
respectively:

- `https://MANAGEMENT_API_SERVER_ENDPOINT/apis/billing.gdc.goog/v1`
- `https://GLOBAL_API_SERVER_ENDPOINT/apis/billing.global.gdc.goog/v1`

The `MANAGEMENT_API_SERVER_ENDPOINT` variable is the
endpoint of the zonal management API server, and the
`GLOBAL_API_SERVER_ENDPOINT` variable is the endpoint of
the global API server.

Using the `kubectl proxy` command, access the URL in your browser to
obtain the discovery document for the Billing API. The `kubectl proxy`
command opens up a proxy on `127.0.0.1:8001` to the Kubernetes API server on
your local machine. After that command is running, you can access the document at
the following URLs:

- `http://127.0.0.1:8001/apis/billing.gdc.goog/v1`
- `http://127.0.0.1:8001/apis/billing.global.gdc.goog/v1`

## Example resources

The following is a sample `SKUDescription` resource:

```yaml
apiVersion: billing.gdc.goog/v1
kind: SKUDescription
metadata:
  name: 4a76-432c-797f
  namespace: billing-system
skuID: 4A76-432C-797F
invoiceDescription: "GDC-H Sample SKU"
description: "A description to describe what the SKU is charging."
category: Sample
pricingInfo:
  - unitPrice:
      currencyCode: USD
      units: 100
      nanos: 0
    usageUnit: vTestResource * month
    effectiveTime: "2023-01-01T00:00:00-08:00"
```