Deployments.ai Docs
Operations

Summarize usage per metric and hour or day

GET /v1/usage/summary · SDK getUsageSummary · CLI deployments usage summary

GET
/v1/usage/summary

Requires usage:read.

Authorization

platformBearer
headerAuthorizationBearer <token>

Platform bearer credential accepted as an opaque API key or JWT.

Query Parameters

since*string

Inclusive canonical UTC timestamp on an interval boundary.

Formatdate-time
until*string

Exclusive canonical UTC timestamp on an interval boundary.

Formatdate-time
interval?string

Bucket width (default hour). A summary holds at most 744 hourly or 366 daily buckets.

Value in"hour""day"
agentDefinitionId?string

Restrict the summary to usage of runs that executed this agent definition. Agent series come from the agent's own hourly counters; usage outside runs (inbox traffic, Brain operations) belongs to no agent. Not combinable with workspaceId.

Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$
workspaceId?string

Restrict the summary to usage that names this workspace. Workspace series come from the workspace's own hourly counters, with token splits; usage without a workspace belongs to none. Not combinable with agentDefinitionId.

Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$

Header Parameters

x-deployments-environment*string
Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$

Response Body

UsageSummaryResponse

application/json
  1. response
buckets*array<>
interval*string
Value in"hour""day"
series*array<>
since*string
Match^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$
Formatdate-time
until*string
Match^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$
Formatdate-time
curl -X GET "https://example.com/v1/usage/summary?since=2019-08-24T14%3A15%3A22Z&until=2019-08-24T14%3A15%3A22Z" \  -H "x-deployments-environment: string"
{  "buckets": [    "2019-08-24T14:15:22Z"  ],  "interval": "hour",  "series": [    {      "kind": "cost",      "metric": "string",      "part": "input",      "total": 0,      "unit": "string",      "values": [        0      ]    }  ],  "since": "2019-08-24T14:15:22Z",  "until": "2019-08-24T14:15:22Z"}