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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
from | query | integer | no | unix seconds (default current cycle start) |
to | query | integer | no | unix seconds (default current cycle end) |
projectId | path | string | yes |
Responses
200
Default Response
| Field | Type | Required | Description |
|---|---|---|---|
from | integer | no | |
to | integer | no | |
dimensions | object[] | no | |
dimensions.dimension | "ram" | "cpu" | "volume" | "storage" | "egress" | no | |
dimensions.quantity | number | no | |
dimensions.unit | string | no | |
dimensions.costUsd | number | no | quantity × unit price for this dimension in the window |
totalCostUsd | number | no | |
byService | object[] | no | the 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.serviceId | string | null | no | null 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.name | string | null | no | |
byService.type | string | null | no | postgres | storage | compute | redis | mysql | mongodb |
byService.status | string | null | no | 'deleted' for a service that is gone but still owns history |
byService.branch | string | null | no | the environment it belonged to; null for the unattributed bucket |
byService.dimensions | object[] | no | |
byService.dimensions.dimension | "ram" | "cpu" | "volume" | "storage" | "egress" | no | |
byService.dimensions.quantity | number | no | |
byService.dimensions.unit | string | no | |
byService.dimensions.costUsd | number | no | quantity × unit price for this dimension in the window |
byService.totalCostUsd | number | no |
403
Default Response
| Field | Type | Required | Description |
|---|---|---|---|
error | string | yes |