Get usage and its cost
Returns what was used and what it cost in US dollars, from a whole organisation down to one luna. You choose what each row stands for with by and narrow the rows with the filters. Rows come a page at a time, the most costly first, with the total of every row there is. An account sees the organisations it belongs to. An API key or a token needs usage:read and sees what it reaches.
/_luna/usageAuthorizationBearer token · headerrequiredAn account key (la_…), an API key (lt_…) or a session token (ls_…). The scopes listed are the permissions the operation needs.
usage:readsinceinteger<int64>Usage from this moment on, in milliseconds since the Unix epoch. 31 days before until when left out.
untilinteger<int64>Usage up to this moment, in milliseconds since the Unix epoch. Now when left out.
orgstringOnly this organisation, by its slug or its id.
projectstringOnly this project, by its slug.
environmentstringOnly this environment, by its name.
tenantstringOnly this tenant, by its name.
typestringOnly this luna type, by its name.
lunastringOnly this luna of the type: its key as JSON, or its key encoded in hex. Give type with it.
bystringWhat each row stands for: org, project, environment, tenant, type, luna, or none for the total alone. type when left out.
limitintegerHow many rows to return. 100 when left out, 1000 at most.
cursorstringThe next of the last page, to read the next one.
A page of usage.
sinceinteger<int64>requiredWhere the span starts, in milliseconds since the Unix epoch.
untilinteger<int64>requiredWhere the span ends, in milliseconds since the Unix epoch.
bystringrequiredWhat each row stands for.
rowsUsageRow[]requiredThe rows of this page, the most costly first.
Show propertiesHide properties
UsageRoworgstring | nullThe organisation's slug. Null for a tenant that belongs to no organisation.
projectstring | nullThe project's slug.
environmentstring | nullThe environment's name.
tenantstring | nullThe tenant's name.
typestring | nullThe luna type's name.
lunastring | nullThe luna, as its key encoded in hex. Null for usage that belongs to no one luna.
keyobject | nullThe luna's key as its type declares it, when the row is a luna and its key reads.
indexboolean | nullTrue when the row's type is an index. Left out otherwise.
usageobjectrequiredWhat was used, as raw counts by meter.
costobjectrequiredWhat each meter cost, in US dollars, by meter.
costUsdnumber<double>requiredWhat the row cost in all, in US dollars.
listUsdnumber<double>requiredWhat the row would cost at the plan's rates with nothing included, in US dollars.
totalUsageCostrequiredEvery row there is added up, not only the rows of this page.
Show propertiesHide properties
usageobjectrequiredWhat was used, as raw counts by meter.
costobjectrequiredWhat each meter cost, in US dollars, by meter. A meter with no price has usage and no cost.
costUsdnumber<double>requiredWhat it cost in all, in US dollars. A row's cost is its share of what its organisation is charged for each meter in the month.
listUsdnumber<double>requiredWhat it would cost at the plan's rates with nothing included, in US dollars.
indexesIndexUsage[]requiredThe usage of each index, the most costly first.
Show propertiesHide properties
IndexUsageusageobjectrequiredWhat was used, as raw counts by meter.
costobjectrequiredWhat each meter cost, in US dollars, by meter. A meter with no price has usage and no cost.
costUsdnumber<double>requiredWhat it cost in all, in US dollars. A row's cost is its share of what its organisation is charged for each meter in the month.
listUsdnumber<double>requiredWhat it would cost at the plan's rates with nothing included, in US dollars.
namestringrequiredThe index's name.
metersobjectrequiredEach meter's unit and price, by meter.
nextstring | nullSend it back as cursor to read the next page. Null on the last page.
The request failed. The status says how and error.message says why.
errorErrorDetailrequiredShow propertiesHide properties
codestring | nullA code for programs to branch on, when the error has one.
messagestringrequiredWhat went wrong, in a sentence a person can read.