Listar consumos
RegistosGET /consumption
Pages the computed consumption records of one account linked to the caller, such as usage per billing cycle. account_id is required (400 without it) and the caller needs read access to that account, otherwise 403. Pagination uses limit and after.
Parâmetros
tenant_idTenant (utility workspace) that owns the account; when omitted it is worked out from the caller's account memberships.
account_idRequired identifier of the linked account whose consumption is listed.
limitMaximum resources to return (default 20, maximum 100).
afterOpaque cursor returned by the previous page.
meter_idReturns only consumption measured by this meter of the account.
cycle_idReturns only consumption for this billing cycle.
Devolve
200 Account consumption after membership authorization
curl -X GET "$CONSUMER_API/consumption" \
-H "Authorization: Bearer sk_test_..."
# Sem comando CLI equivalente; use cURL ou HTTP directo.
const res = await fetch("$CONSUMER_API/consumption", {
method: "GET",
headers: {
Authorization: "Bearer sk_test_..."
}
});
const data = await res.json();
import requests
res = requests.get(
"$CONSUMER_API/consumption",
headers={
"Authorization": "Bearer sk_test_..."
}
)
data = res.json()
req, _ := http.NewRequest("GET", "$CONSUMER_API/consumption", nil)
req.Header.Set("Authorization", "Bearer sk_test_...")
resp, err := http.DefaultClient.Do(req)
Account consumption after membership authorization