Skip to Content
ReferenceHTTP APIGET /api/v1/usage

GET /api/v1/usage

Preview. Ships with the next server release.

what the coding agents on the contour’s machines used, per machine, agent and UTC hour.

Query parameters

NameTypeRequiredMeaning
fromintegernoStart, unix seconds (default: seven days before to).
tointegernoEnd, unix seconds, not included (default: now).

Responses

StatusMeaningBody
200Agent usage per machine, agent and UTC hourapplication/json object[]
400A period that is empty, reversed or longer than 400 daysapplication/json
401Unauthorizedapplication/json
503Store unavailableapplication/json

Response fields

FieldTypeAlwaysMeaning
agentstringyesThe agent’s catalog id (claude-code, codex).
agent_versionstringno
cache_readintegeryes
cache_writeintegeryes
cost_amountintegernoWhat the agent itself stated, in cost_unit; none when it stated nothing.
cost_unitstringno
hourintegeryesUnix seconds, start of the UTC hour.
input_uncachedintegeryesInput tokens without the cached part.
machinestringyes
machine_namestringyes
modelstringno
outputintegeryesOutput tokens, reasoning included.
projectstringnoThe agent’s working folder on that machine.
reasoningintegeryes
requestsintegeryes
sessionsintegeryesDistinct sessions in this hour; never add it across hours.
token_qualitystringyesreported, derived, estimated, absent or unknown.

Example

curl -sS "https://<contour>.cmdop.ai/api/v1/usage" \ -H "Authorization: Bearer $CMDOP_TOKEN"