Usage API Overview
The usage API returns the raw quantities Control Plane meters for an org: CPU, memory, egress, GPUs, volume sets, observability storage, and load balancers. It is served fromhttps://metering.cpln.io and has two endpoints:
The usage API returns quantities only. To get the same data priced in your billing account’s currency, use the charges query of the billing API, which takes the same query body.
Usage API Authentication and Permissions
Send a Control Plane token as a Bearer token on every request:- User token: log in with
cpln login, then runcpln profile token <profile-name>. - Service account key: create a service account and generate a key.
readMetrics permission on the org named in the path. Members of the built-in superusers group have it through manage. Any other user or service account needs a policy that grants readMetrics on the org target kind.
Granting or revoking
readMetrics can take up to 5 minutes to apply to the usage API, because authorization results are cached.readUsage permission does not grant access to the usage API; only readMetrics does. A request without readMetrics on the org in the path, or for a deactivated org, returns 401 with {"code":401,"error":"Unauthorized"}.
Usage Tags
Every metered value carries a set of tags. They identify what was used and where. You filter, sum, and group usage by these tags.
A tag that does not apply to a usage row is absent from it. When you aggregate by a tag that a row lacks, the row reports it as
"".
Usage Metrics and Units
Usage is metered every second and summed into hourly rows, so most values are a quantity multiplied by the seconds it was held. For example, two cores held for one hour is7200 core-seconds.
Usage priced from the cloud provider’s bill,
snapshot-storage and load-balancer-processed-bytes, can be revised for up to about 48 hours after the hour it belongs to.
Query Usage
POST https://metering.cpln.io/org/{org}/query
Returns the org’s usage between two times, summed over the tags you do not name and grouped by the tags you do.
Usage Query Request
Times are aligned outward to whole
timeStep boundaries in UTC, so a day query from 2026-09-01T10:00:00Z starts at 2026-09-01T00:00:00Z. Weeks start on Monday. Send times in UTC (Z): other offsets misalign day, week, and month boundaries.
Usage Retention
Usage atmonth resolution is kept indefinitely. Usage at hour, day, and week resolution is kept for the 12 whole months before the current month. A startTime before that returns 400 with the earliest start time still available. Use a later startTime or timeStep: "month".
Usage Filter Syntax
- Exact match:
{"gvc": "prod"}matches rows whosegvcis exactlyprod. - Regular expression: a value wrapped in slashes is a case-sensitive POSIX regular expression, for example
{"workload": "/^api-/"}. A regular expression is unanchored, so/prod/also matchespreprod. Use^and$, and/^(a|b)$/to match one of several values. - Multiple keys:
{"feature": "workloads", "metric": "cpu"}requires both. - Non-string tags:
volumeIndexis a number, so match it with a regular expression such as/^0$/.
Usage Query Response
Example: Usage per GVC for a Month
Return September’s workload usage for the orgmy-org, one group per GVC with one row per metric:
prod, 5184000 core-seconds is 2 cores for 30 days, 11132555231232000 byte-seconds is 4 GiB for 30 days, and 52428800000 bytes is about 48.8 GiB of egress.
Example: Daily CPU per Workload
Return one period per day, with one group per workload whose name starts withapi- in the GVC prod:
List Usage Tag Values
POST https://metering.cpln.io/org/{org}/tags/values/query
Returns the distinct values one tag took in the org’s usage. Use it to discover what to filter or group by, for example every GVC that had usage last month, then pass those values to Query Usage.
Tag Values Request
Tag values are read from monthly usage, so the range is widened to whole calendar months in UTC: from the month containing
startTime through the month that begins at or after endTime. That last month is always included, so endTime: 2026-09-30T00:00:00Z also returns October’s values. Values from the current month can lag until its usage is rolled up.
Tag Values Response
The response echoes the request, adds the org tofilterBy, and lists the values in tagValues, sorted alphabetically. The list contains "" when some matching usage lacks the tag. Add a feature filter to avoid that.
Usage API Errors
An org with no matching usage returns
200 with "periods": null, or an empty tagValues list.
Learn More
Billing API
Price the same usage, read invoices, and set a spend alert.
Query Costs and Usage
Step by step: break down a month’s cost and usage per GVC and workload.