List all billable metrics
curl --request GET \
--url https://api.metronome.com/v1/billable-metrics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.metronome.com/v1/billable-metrics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.metronome.com/v1/billable-metrics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.metronome.com/v1/billable-metrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.metronome.com/v1/billable-metrics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.metronome.com/v1/billable-metrics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.metronome.com/v1/billable-metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"name": "data transfer (GB)",
"id": "9570e4f3-d1da-4b95-ba81-bd40ee002727",
"aggregation_type": "SUM",
"aggregation_key": "bytes",
"event_type_filter": {
"in_values": [
"cpu_usage"
]
},
"property_filters": [
{
"name": "cpu_hours",
"exists": true
},
{
"name": "region",
"exists": true,
"in_values": [
"EU",
"NA"
]
},
{
"name": "machine_type",
"exists": true,
"in_values": [
"slow",
"fast"
]
}
],
"group_keys": [
[
"region"
],
[
"machine_type"
]
],
"custom_fields": {
"envionment": "production"
}
}
],
"next_page": null
}Billable metrics
List all billable metrics
Retrieves all billable metrics with their complete configurations. Use this for programmatic discovery and management of billable metrics, such as associating metrics to products and auditing for orphaned or archived metrics.
Important: Archived metrics are excluded by default; use include_archived=true parameter to include them.
GET
/
v1
/
billable-metrics
List all billable metrics
curl --request GET \
--url https://api.metronome.com/v1/billable-metrics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.metronome.com/v1/billable-metrics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.metronome.com/v1/billable-metrics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.metronome.com/v1/billable-metrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.metronome.com/v1/billable-metrics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.metronome.com/v1/billable-metrics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.metronome.com/v1/billable-metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"name": "data transfer (GB)",
"id": "9570e4f3-d1da-4b95-ba81-bd40ee002727",
"aggregation_type": "SUM",
"aggregation_key": "bytes",
"event_type_filter": {
"in_values": [
"cpu_usage"
]
},
"property_filters": [
{
"name": "cpu_hours",
"exists": true
},
{
"name": "region",
"exists": true,
"in_values": [
"EU",
"NA"
]
},
{
"name": "machine_type",
"exists": true,
"in_values": [
"slow",
"fast"
]
}
],
"group_keys": [
[
"region"
],
[
"machine_type"
]
],
"custom_fields": {
"envionment": "production"
}
}
],
"next_page": null
}