UseDocumentation Index
Fetch the complete documentation index at: https://docs.opencomputer.dev/llms.txt
Use this file to discover all available pages before exploring further.
Usage for billing-aligned usage queries and per-sandbox
time-series drilldowns. Use Tags to set and read sandbox tags used
by the usage aggregator.
Preview: Usage and tag APIs are new. Endpoints, response fields,
and SDK method names may change before GA; temporary inaccuracies or
rough edges are possible while the surface settles.
apiUrl may include or omit /api; both
https://app.opencomputer.dev and https://app.opencomputer.dev/api
work.
usage.forSandbox(sandboxId, opts?)
Return 1-minute memory points plus envelope totals for one sandbox.
HTTP API ->
Sandbox ID.
ISO date (
YYYY-MM-DD) or RFC3339 lower bound. Default: now minus
1 hour.ISO date (
YYYY-MM-DD) or RFC3339 upper bound. Default: now.
Window must be at most 30 days.Promise<SandboxUsageResponse>
usage.bySandbox(opts?)
Rank sandboxes by usage for an organization. HTTP API ->
ISO date (
YYYY-MM-DD) or RFC3339 lower bound. Default: now minus
30 days.ISO date (
YYYY-MM-DD) or RFC3339 upper bound. Default: now.
Window must be at most 90 days.Tag filters. Keys are dimensions such as
"tag:team". Values are
exact tag values, comma-separated OR values, or "" to match
sandboxes without that tag key."-memoryGbSeconds" (default) or "-diskOverageGbSeconds".Max rows per page. Default 50, max 500.
Cursor returned by the previous page’s
nextCursor.Promise<UsageBySandboxResponse>
usage.byTag(tagKey, opts?)
Group usage by the value of one tag key. Tag keys may contain :.
HTTP API ->
Tag key to group by, for example
"team" or "team:subsystem".Optional tag filters applied before grouping.
ISO date (
YYYY-MM-DD) or RFC3339 lower bound. Default: now minus
30 days.ISO date (
YYYY-MM-DD) or RFC3339 upper bound. Default: now.
Window must be at most 90 days."-memoryGbSeconds" (default) or "-diskOverageGbSeconds".Max rows per page. Default 50, max 500.
Cursor returned by the previous page’s
nextCursor.Promise<UsageByTagResponse>
tags.set(sandboxId, tags)
Replace the full tag set for a sandbox. Partial updates are not
supported: read, modify, then write the full map. HTTP API ->
Sandbox ID.
Flat tag map.
{} clears all tags.Promise<{ tags: Record<string, string>; tagsLastUpdatedAt: string | null }>
tags.get(sandboxId)
Read the current tag set for a sandbox. HTTP API ->
Returns: Promise<{ tags: Record<string, string>; tagsLastUpdatedAt: string | null }>
tags.listKeys()
List tag keys seen in the organization, with counts for tagged
sandboxes and distinct values. HTTP API ->
Returns: Promise<TagKeyInfo[]>
Units
All*GbSeconds fields are GiB-seconds. For example, a sandbox
provisioned at 4096 MiB for one minute reports 240
memoryAllocatedGbSeconds.
memoryAllocatedGbSeconds is billing-aligned provisioned memory.
memoryUsedGbSeconds is measured resident memory from the worker
collector, so it can lag by a few minutes after a sandbox starts.
Types
SandboxUsageResponse
SandboxUsageResponse
SandboxUsagePoint
SandboxUsagePoint
SandboxUsageTotals
SandboxUsageTotals
UsageSandboxItem
UsageSandboxItem
UsageTagItem
UsageTagItem