Endpoint
{accountId} path segment is the identifier of the Blaxel account that owns the workspaces you want to query. You can retrieve it from your account settings in the Blaxel Console, or by calling GET /v0/accounts.
All requests must be authenticated with a Bearer token. See Access tokens for how to obtain one.
Query parameters
Required
Optional
Use the enum discovery endpoints to populate dropdowns for
groupBy and resourceType values without hard-coding them.
Resolution rules
Whenresolution is omitted, Blaxel picks one based on the window length:
Explicit values have maximum window caps to keep responses bounded:
Requesting a resolution that exceeds its cap returns
400 Bad Request.
Admin-only parameters
The following two features are restricted to account admins — non-admin callers get403 Access denied:
workspace=<name>— filtering to a single workspacegroupBy=workspace— splitting the response by workspace (including whenworkspaceappears as one dimension in a multi-dimensiongroupBy, e.g.groupBy=resource_type,workspace)
workspace= when they are admins of the account, which is distinct from the workspace admin role. See workspace access control for more on the role model.
Billing dimensions
A billing dimension is the canonical, unit-stable metric that Blaxel bills against. Each resource type maps to one or more dimensions, and each dimension carries a single unit (gbs = GB-seconds, count = discrete events, hours = active hours).
Response
A successful call returns200 OK with an AccountMetricsResponse. Example for groupBy=resource_type — usage fields are omitted per the rule above:
Top-level fields
Per-group entry
Each item indata is an AccountMetricsDataEntry. The fields populated depend on which groupBy dimension(s) were requested:
When using multi-dimension
groupBy, all fields from each requested dimension are populated. Additionally, metadata enrichment fills in contextual fields — for example, groupBy=resource_uuid also populates workspace, resourceName, and resourceType from the underlying data.
Every entry also carries:
summary.cost— cost in USD for this group over the window.summary.usage— usage for this group. Only populated whenbilling_dimensionis among the requestedgroupBydimensions (same unit-safety rule as the top-level summary).timeseries— one entry per resolution bucket for the full window. Buckets with no activity havecost: 0. Bucket-levelusagefollows the same rule as group-levelusage.
Pagination
Grouped responses are paginated. To request the next page, pass thenextCursor value from the previous response back as the cursor query parameter:
meta.hasMore is false, meta.nextCursor is empty and there are no more pages.
limit defaults to 100 and is capped at 100; values above the cap are silently clamped.
Enum discovery endpoints
Two helper endpoints expose the valid values forgroupBy and resourceType so you can render dropdowns without baking the list into your client.
GET /v0/accounts/{accountId}/metrics/enums/group-by
Returns every valid value for the groupBy query parameter. The enum is static but exposed as an endpoint so it stays in sync automatically if new groupings are added.
GET /v0/accounts/{accountId}/metrics/enums/resource-types
Returns the distinct resource_type values actually observed for the account in the supplied window. Unlike the group-by enum, this list is dynamic: a resource type only appears once there is at least one metric event for it in range.
Required query parameters: startTime, endTime (same format as the main endpoint).
Errors
Multi-dimension groupBy
You can group by multiple dimensions at once by passing a comma-separated list. For example,groupBy=resource_type,workspace returns the cross-product — one entry per unique (resource_type, workspace) combination:
- Maximum 3 dimensions per query. Exceeding this returns
400 Bad Request. - Pagination works the same way — the cursor is opaque and handles the composite grouping internally.
summary.usagefollows the same unit-safety rule: only populated whenbilling_dimensionis among the requested dimensions.
