Skip to main content
GET
/
api
/
usage
Usage Aggregator
curl --request GET \
  --url https://app.opencomputer.dev/api/usage \
  --header 'X-API-Key: <api-key>'
{
  "from": "2026-03-23T00:00:00Z",
  "to":   "2026-04-22T00:00:00Z",
  "groupBy": "sandbox",
  "total": { "memoryGbSeconds": 20000, "diskOverageGbSeconds": 360 },
  "items": [
    {
      "sandboxId": "sb-abc",
      "alias": "my-agent",
      "status": "running",
      "tags": { "env": "prod", "team": "payments" },
      "tagsLastUpdatedAt": "2026-04-19T14:02:00Z",
      "memoryGbSeconds": 8000,
      "diskOverageGbSeconds": 120
    }
  ],
  "nextCursor": null
}
Aggregate GB-second spend grouped by sandbox or by tag. Dollars are not exposed — Stripe owns pricing, and this endpoint returns the same physical quantities the invoice is computed from.
Freshness: accurate to the minute for cleanly-shutdown sandboxes. A silently-dead worker leaves scale events open until the worker restarts; until then, accrual keeps going. This is the same behavior as the Stripe pipeline.
groupBy
string
required
sandbox for top sandboxes, or tag:<key> for spend by tag value. Keys may contain : — everything after the first : is the tag key (so groupBy=tag:team:payments groups by the key team:payments).
from
string
ISO-8601 inclusive lower bound. Default: now minus 30 days. Max window: 90 days.
to
string
ISO-8601 exclusive upper bound. Default: now.
filter[tag:<key>]
string
One param per dimension. Comma-separated values are OR’d within that dimension; different filter[...] params are AND’d across dimensions. Passing the same filter[...] key twice returns 400 — put multiple OR values in one comma-separated string instead. Empty value (filter[tag:team]=) matches sandboxes without the team key.
sort
string
-memoryGbSeconds (default) or -diskOverageGbSeconds.
limit
integer
Max items per page. Default 50, max 500.
cursor
string
Opaque cursor from a prior response’s nextCursor.
{
  "from": "2026-03-23T00:00:00Z",
  "to":   "2026-04-22T00:00:00Z",
  "groupBy": "sandbox",
  "total": { "memoryGbSeconds": 20000, "diskOverageGbSeconds": 360 },
  "items": [
    {
      "sandboxId": "sb-abc",
      "alias": "my-agent",
      "status": "running",
      "tags": { "env": "prod", "team": "payments" },
      "tagsLastUpdatedAt": "2026-04-19T14:02:00Z",
      "memoryGbSeconds": 8000,
      "diskOverageGbSeconds": 120
    }
  ],
  "nextCursor": null
}