Skip to content
Luna
Esc
↑↓navigate↵open⌘Jpreview

Get the billing summary

Returns an organisation’s plan with its prices and limits, its credit, what this month costs so far and what it is using right now.

GET/_luna/orgs/{org}/billing
Authorization
AuthorizationBearer token · headerrequired

An account key (la_…), an API key (lt_…) or a session token (ls_…). The scopes listed are the permissions the operation needs.

Scopes:billing:read
Path parameters
orgstringrequired

The organisation, by its slug.

Responses
200

The billing summary.

organisationstringrequired

The organisation's slug.

billingstringrequired

stripe when the cluster bills through Stripe, off when it does not bill.

planstringrequired

The name of the plan the organisation is on.

planDetailsPlanItemrequired

A plan: what it charges, what it includes and what it limits.

Show properties
namestringrequired

The plan's name, which is how you choose it.

titlestringrequired

What the plan is called. Its name when it has no title.

descriptionstring
highlightsstring[]

Short lines that say what the plan gives.

publicbooleanrequired

Whether every organisation may choose the plan. A plan that is not public is one the operator gives an organisation.

orderinteger<int64>required

Where the plan comes among the plans offered, the lowest first.

ratesobjectrequired

The price of each meter in US dollars per billed unit, by meter.

includedobjectrequired

How many billed units of each meter a month includes at no charge, by meter.

quotasQuotasrequired

The limits a plan sets for an organisation.

Show properties
requestsPerSecondnumber<double> | null

The requests a second the organisation's tenants take together.

default: null
databaseBytesinteger<int64> | null

The size of the organisation's databases together, in bytes.

min 0 · default: null
blobBytesinteger<int64> | null

The size of the files its lunas store together, in bytes.

min 0 · default: null
egressBytesPerMonthinteger<int64> | null

The bytes its tenants send out in a calendar month.

min 0 · default: null
ingressBytesPerMonthinteger<int64> | null

The bytes its tenants take in over a calendar month.

min 0 · default: null
activeLunasinteger<int64> | null

The lunas awake at once.

min 0 · default: null
sandboxesinteger<int64> | null

The sandboxes running at once.

min 0 · default: null
totalCpuTotalLimit | null
default: null
Show properties
One of:
TotalLimit
TotalLimit
null
null
totalMemoryMibTotalLimit | null
default: null
Show properties
One of:
TotalLimit
TotalLimit
null
null
lunaMemoryMibinteger<int64> | null

The most memory any one luna may declare or use, in MiB (limits.memory).

min 0 · default: null
lunaCpunumber<double> | null

The most cores any one luna may declare or use (limits.cpu).

default: null
lunaDefaultMemoryMibinteger<int64> | null

The memory a luna has when it declares none, in MiB.

min 0 · default: null
lunaDefaultCpunumber<double> | null

The cores a luna has when it declares none.

default: null
lunaReserveboolean | null

Whether lunas may reserve their limits (limits.reserve). When it is not set, they may not.

default: null
historyDaysinteger<int32> | null

How many days back lunas can be restored or forked. An environment keeps this many days unless it asks for fewer.

min 0 · default: null
monthlyCreditUsdnumber<double>required

The credit the plan gives each calendar month, in US dollars. Usage beyond the included amounts comes out of it first. What is left at the end of the month does not carry over.

monthlyFeeUsdnumber<double>required

What the plan costs each month, in US dollars.

effectiveFromMsinteger<int64>required

When this version of the plan took effect, in milliseconds since the Unix epoch.

min 0
workerEgressEgressModerequired

The outbound connections code in workers may open.

Allowed:nonetrustedopen
sandboxEgressEgressModerequired

The outbound connections sandboxes may open.

Allowed:nonetrustedopen
sandboxPublicPortsbooleanrequired

Whether sandboxes' declared ports may be given a public address.

grantGrantItem | null
Show properties
One of:
GrantItem
fromMsinteger<int64>required

When the grant started, in milliseconds since the Unix epoch.

min 0
untilMsinteger<int64> | null

When the grant ends, in milliseconds since the Unix epoch. Null when it has no end.

min 0
endedbooleanrequired

Whether the grant has ended.

null
null
ratesobjectrequired

The price of each meter in US dollars per billed unit, by meter.

includedobjectrequired

How many billed units of each meter a month includes at no charge, by meter.

unitsobjectrequired

What each meter's billed unit is called, by meter.

scalesobjectrequired

How many of a meter's raw counts make one billed unit, by meter. Usage is in raw counts. Prices and included amounts are per billed unit.

quotasQuotasrequired

The limits a plan sets for an organisation.

Show properties
requestsPerSecondnumber<double> | null

The requests a second the organisation's tenants take together.

default: null
databaseBytesinteger<int64> | null

The size of the organisation's databases together, in bytes.

min 0 · default: null
blobBytesinteger<int64> | null

The size of the files its lunas store together, in bytes.

min 0 · default: null
egressBytesPerMonthinteger<int64> | null

The bytes its tenants send out in a calendar month.

min 0 · default: null
ingressBytesPerMonthinteger<int64> | null

The bytes its tenants take in over a calendar month.

min 0 · default: null
activeLunasinteger<int64> | null

The lunas awake at once.

min 0 · default: null
sandboxesinteger<int64> | null

The sandboxes running at once.

min 0 · default: null
totalCpuTotalLimit | null
default: null
Show properties
One of:
TotalLimit
One of:
number
number
string
string
null
null
totalMemoryMibTotalLimit | null
default: null
Show properties
One of:
TotalLimit
One of:
number
number
string
string
null
null
lunaMemoryMibinteger<int64> | null

The most memory any one luna may declare or use, in MiB (limits.memory).

min 0 · default: null
lunaCpunumber<double> | null

The most cores any one luna may declare or use (limits.cpu).

default: null
lunaDefaultMemoryMibinteger<int64> | null

The memory a luna has when it declares none, in MiB.

min 0 · default: null
lunaDefaultCpunumber<double> | null

The cores a luna has when it declares none.

default: null
lunaReserveboolean | null

Whether lunas may reserve their limits (limits.reserve). When it is not set, they may not.

default: null
historyDaysinteger<int32> | null

How many days back lunas can be restored or forked. An environment keeps this many days unless it asks for fewer.

min 0 · default: null
subscriptionSubscriptionItem | null
Show properties
One of:
SubscriptionItem
statusstring | null

The status Stripe gives it, such as active or past_due.

feeUsdnumber<double>required

What the subscription charges each month for the plan, in US dollars.

periodEndMsinteger<int64> | null

When the period paid for ends, in milliseconds since the Unix epoch.

min 0
endsMsinteger<int64> | null

When the subscription ends, if it was cancelled, in milliseconds since the Unix epoch.

min 0
thenPlanName | null
Show properties
One of:
PlanName
namestringrequired
titlestringrequired
null
null
null
null
creditCreditItemrequired

An organisation's credit, in US dollars.

Show properties
monthlyUsdnumber<double>required

The credit the plan gives for this month.

monthlyLeftUsdnumber<double>required

What is left of the plan's credit for this month.

toppedUpUsdnumber<double>required

The credit the operator added on top, in all.

toppedUpLeftUsdnumber<double>required

What is left of the credit the operator added.

usedUsdnumber<double>required

How much of the credit is used.

owedUsdnumber<double>required

What no credit covered and no card has paid yet.

creditUsdnumber<double>required

The plan's credit for this month and the credit the operator added, together, in US dollars.

spentUsdnumber<double>required

How much of the credit is used, in US dollars.

remainingCreditUsdnumber<double>required

How much of the credit is left, in US dollars.

monthUsdnumber<double>required

What this month costs so far, in US dollars.

monthUsageobjectrequired

What this month used so far, as raw counts by meter.

packagesobjectrequired

A line for each package the organisation uses this month, by package.

limitsLimitsrequired

The limits an organisation sets on its own spending.

Show properties
hardCapUsdnumber<double> | null

The most the organisation spends in a calendar month, in US dollars. Its work pauses when the month reaches it. No cap when left out.

default: null
alertsUsdnumber<double>[]

Amounts in US dollars. The organisation is told when the month's spending passes each one. At most 20.

default: []
inUseInUserequired

What an organisation is using right now.

Show properties
coresnumber<double>required

The cores its lunas used over the last half minute or so, with the sizes of the lunas that reserve and of its running sandboxes.

memoryMibinteger<int64>required

The memory in use, counted the same way, in MiB.

min 0
activeLunasinteger<int64>required

The lunas awake now.

min 0
sandboxesinteger<int64>required

The sandboxes running now.

min 0
limitsInUseLimitsrequired

What the plan allows of each. Null means no limit.

Show properties
coresnumber<double> | null
memoryMibnumber<double> | null
activeLunasinteger<int64> | null
min 0
sandboxesinteger<int64> | null
min 0
hasPaymentMethodbooleanrequired

Whether a card is on file.

paymentFailedbooleanrequired

Whether the last payment failed.

outOfCreditSinceMsinteger<int64> | null

Since when the organisation has been out of credit, in milliseconds since the Unix epoch.

min 0
pausedPaused | null
Show properties
One of:
Paused
codestringrequired

PaymentRequired, QuotaExceeded or Suspended.

messagestringrequired

The reason, in words.

null
null
warningsstring[]required

What the organisation should know, such as a limit it is close to.

default

The request failed. The status says how and error.message says why.

errorErrorDetailrequired
Show properties
codestring | null

A code for programs to branch on, when the error has one.

messagestringrequired

What went wrong, in a sentence a person can read.

Try it
Server
Authorization
Parameters
Request
curl -X GET 'https://luna.example.com/_luna/orgs/string/billing' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json'
Response
{
  "organisation": "string",
  "billing": "string",
  "plan": "string",
  "planDetails": {
    "name": "string",
    "title": "string",
    "description": "string",
    "highlights": [
      "string"
    ],
    "public": true,
    "order": 0,
    "rates": {
      "property1": 0.1,
      "property2": 0.1
    },
    "included": {
      "property1": 0.1,
      "property2": 0.1
    },
    "quotas": {
      "requestsPerSecond": null,
      "databaseBytes": null,
      "blobBytes": null,
      "egressBytesPerMonth": null,
      "ingressBytesPerMonth": null,
      "activeLunas": null,
      "sandboxes": null,
      "totalCpu": null,
      "totalMemoryMib": null,
      "lunaMemoryMib": null,
      "lunaCpu": null,
      "lunaDefaultMemoryMib": null,
      "lunaDefaultCpu": null,
      "lunaReserve": null,
      "historyDays": null
    },
    "monthlyCreditUsd": 0.1,
    "monthlyFeeUsd": 0.1,
    "effectiveFromMs": 0,
    "workerEgress": "none",
    "sandboxEgress": "none",
    "sandboxPublicPorts": true
  },
  "grant": {
    "fromMs": 0,
    "untilMs": 0,
    "ended": true
  },
  "rates": {
    "property1": 0.1,
    "property2": 0.1
  },
  "included": {
    "property1": 0.1,
    "property2": 0.1
  },
  "units": {
    "property1": "string",
    "property2": "string"
  },
  "scales": {
    "property1": 0.1,
    "property2": 0.1
  },
  "quotas": {
    "requestsPerSecond": null,
    "databaseBytes": null,
    "blobBytes": null,
    "egressBytesPerMonth": null,
    "ingressBytesPerMonth": null,
    "activeLunas": null,
    "sandboxes": null,
    "totalCpu": null,
    "totalMemoryMib": null,
    "lunaMemoryMib": null,
    "lunaCpu": null,
    "lunaDefaultMemoryMib": null,
    "lunaDefaultCpu": null,
    "lunaReserve": null,
    "historyDays": null
  },
  "subscription": {
    "status": "string",
    "feeUsd": 0.1,
    "periodEndMs": 0,
    "endsMs": 0,
    "then": {
      "name": "string",
      "title": "string"
    }
  },
  "credit": {
    "monthlyUsd": 0.1,
    "monthlyLeftUsd": 0.1,
    "toppedUpUsd": 0.1,
    "toppedUpLeftUsd": 0.1,
    "usedUsd": 0.1,
    "owedUsd": 0.1
  },
  "creditUsd": 0.1,
  "spentUsd": 0.1,
  "remainingCreditUsd": 0.1,
  "monthUsd": 0.1,
  "monthUsage": {
    "property1": 0,
    "property2": 0
  },
  "packages": {
    "property1": {
      "usage": {
        "property1": 0,
        "property2": 0
      },
      "costUsd": 0.1
    },
    "property2": {
      "usage": {
        "property1": 0,
        "property2": 0
      },
      "costUsd": 0.1
    }
  },
  "limits": {
    "hardCapUsd": null,
    "alertsUsd": []
  },
  "inUse": {
    "cores": 0.1,
    "memoryMib": 0,
    "activeLunas": 0,
    "sandboxes": 0,
    "limits": {
      "cores": 0,
      "memoryMib": 0,
      "activeLunas": 0,
      "sandboxes": 0
    }
  },
  "hasPaymentMethod": true,
  "paymentFailed": true,
  "outOfCreditSinceMs": 0,
  "paused": {
    "code": "string",
    "message": "string"
  },
  "warnings": [
    "string"
  ]
}

Was this page helpful?