Read metered usage
Usage by the second for one calendar month in UTC, grouped as asked.
Usage by the second for one calendar month in UTC, grouped as asked. Seconds asleep and stopped and stored bytes are metered even before they have a price. Usage reaches this call within 3 minutes of the host's log. Usage has the mode of its sandbox, which is the mode of the key that created it. A key reads only its own project and mode; naming the other mode, or a sandbox of another mode or project, answers not_found exactly as a sandbox that does not exist (the test and live rule). A signed-in person reads either mode, live by default. A sandbox with no usage yet in reach is also not_found.
A key with the usage:read scope.
Request
curl "https://api.pod.mapier.ai/v1/usage" \
-H "Authorization: Bearer $POD_API_KEY"Parameters
| Name | In | Type | Required | What it is |
|---|---|---|---|---|
period | query | string | No | The month, YYYY-MM. The current month by default. |
group_by | query | "project" | "size" | "sandbox" | "end_user" | "product" | No | product: Pod's own sandboxes (sandboxes) apart from each connected service's (pod-ci), by billing mark. |
project | query | string | No | Only this project. |
sandbox | query | string | No | Only this sandbox. |
end_user | query | string | No | Only sandboxes labelled with this end user. One the caller cannot see is not_found. |
mode | query | "test" | "live" | No | Test or live usage. A key's own mode by default; for a person, live. |
include | query | string | No | cost adds each row's estimated cost (cost_cents) and the page's total (cost), at Pod's rates, for resale. Comma-separated. |
Pod-End-User | header | string | No | Narrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering not_found, and a create is labelled with it. An end user of another project, or one that is not there, is not_found; a suspended one refuses creates and wakes (account_restricted). |
limit | query | integer | No | |
cursor | query | string | No | The next_cursor of the page before. Valid for 24 hours. |
Answer
200. The usage.
{
"cost": {
"currency": "example",
"total_cents": 0,
"estimate": true
},
"services": [
{
"service": "example",
"kind": "ci_runner",
"unit": "seconds",
"quantity": 0,
"events": 0,
"cost_cents": null
}
],
"period": "example",
"start": "2026-11-23T12:00:00.000Z",
"end": "2026-11-23T12:00:00.000Z",
"mode": "test",
"group_by": "project",
"data": [
{
"project": null,
"size": null,
"sandbox": null,
"end_user": null,
"awake_s": 0,
"asleep_s": 0,
"stopped_s": 0,
"stored_byte_hours": 0,
"egress_bytes": 0,
"billing_mark": null,
"product": null,
"cost_cents": null
}
],
"next_cursor": null
}| Field | Type | Always | What it is |
|---|---|---|---|
cost | UsageCost | No | With include=cost: the currency and the page's total, an estimate at Pod's rates: its rows' and, grouped by product, its services' cost_cents. |
services | ServiceUsageRow[] | No | With group_by=product only: each connected service's own usage, one row per service and kind, sorted by service and kind. Naming a sandbox keeps only the events that name it; naming an end user lists none. The same on every page. |
period | string | Yes | |
start | string | Yes | RFC 3339 in UTC with milliseconds, for example 2026-11-23T17:04:05.123Z. |
end | string | Yes | RFC 3339 in UTC with milliseconds, for example 2026-11-23T17:04:05.123Z. |
mode | "test" | "live" | Yes | |
group_by | "project" | "size" | "sandbox" | "end_user" | "product" | Yes | product: Pod's own sandboxes (sandboxes) apart from each connected service's (pod-ci), by billing mark. Default "project". |
data | UsageRow[] | Yes | |
next_cursor | string | null | Yes |
Errors
The refusals this call is known for: invalid, not_found. Any call can also answer unauthorized, rate_limited, unavailable or internal; the error list says what each means and when to send the call again.
In the SDKs
| Client | Call |
|---|---|
| TypeScript | pod.usage.get({ … }) |
| Python | pod.usage.get(…) |
| mpod | mpod sandboxes usage |