Documentation menu

Get usage

GEThttps://api.instacloud.com/projects/{projectId}/usage

Token scope: account · org · project — read-only tokens allowed.

Project usage across the 5 billing dimensions over a window (default current cycle)

Parameters

NameInTypeRequiredDescription
fromqueryintegernounix seconds (default current cycle start)
toqueryintegernounix seconds (default current cycle end)
projectIdpathstringyes

Responses

200

Default Response

FieldTypeRequiredDescription
fromintegerno
tointegerno
dimensionsobject[]no
dimensions.dimension"ram" | "cpu" | "volume" | "storage" | "egress"no
dimensions.quantitynumberno
dimensions.unitstringno
dimensions.costUsdnumbernoquantity × unit price for this dimension in the window
totalCostUsdnumberno
byServiceobject[]nothe same window and the same money split by service — deleted services included, plus one unattributed bucket where the service is unrecoverable. Sums to totalCostUsd. A postgres lineage ROOT is attributed to its origin service, so a forked environment’s database cost lands on the service it was forked from.
byService.serviceIdstring | nullnonull for the unattributed bucket: spend with no live service to name — its environment was deleted, or the resource predates service attribution (pre-0010, never backfilled). NOT spend of zero
byService.namestring | nullno
byService.typestring | nullnopostgres | storage | compute | redis | mysql | mongodb
byService.statusstring | nullno'deleted' for a service that is gone but still owns history
byService.branchstring | nullnothe environment it belonged to; null for the unattributed bucket
byService.dimensionsobject[]no
byService.dimensions.dimension"ram" | "cpu" | "volume" | "storage" | "egress"no
byService.dimensions.quantitynumberno
byService.dimensions.unitstringno
byService.dimensions.costUsdnumbernoquantity × unit price for this dimension in the window
byService.totalCostUsdnumberno

403

Default Response

FieldTypeRequiredDescription
errorstringyes

View as Markdown