Read metered usage

Usage by the second for one calendar month in UTC, grouped as asked.

GET/v1/usage

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

NameInTypeRequiredWhat it is
periodquerystringNoThe month, YYYY-MM. The current month by default.
group_byquery"project" | "size" | "sandbox" | "end_user" | "product"Noproduct: Pod's own sandboxes (sandboxes) apart from each connected service's (pod-ci), by billing mark.
projectquerystringNoOnly this project.
sandboxquerystringNoOnly this sandbox.
end_userquerystringNoOnly sandboxes labelled with this end user. One the caller cannot see is not_found.
modequery"test" | "live"NoTest or live usage. A key's own mode by default; for a person, live.
includequerystringNocost adds each row's estimated cost (cost_cents) and the page's total (cost), at Pod's rates, for resale. Comma-separated.
Pod-End-UserheaderstringNoNarrows 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).
limitqueryintegerNo
cursorquerystringNoThe next_cursor of the page before. Valid for 24 hours.

Answer

200. The usage.

200
{
  "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
}
FieldTypeAlwaysWhat it is
costUsageCostNoWith 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.
servicesServiceUsageRow[]NoWith 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.
periodstringYes
startstringYesRFC 3339 in UTC with milliseconds, for example 2026-11-23T17:04:05.123Z.
endstringYesRFC 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"Yesproduct: Pod's own sandboxes (sandboxes) apart from each connected service's (pod-ci), by billing mark. Default "project".
dataUsageRow[]Yes
next_cursorstring | nullYes

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

ClientCall
TypeScriptpod.usage.get({ … })
Pythonpod.usage.get(…)
mpodmpod sandboxes usage