Skip to content
Hoody.com

These endpoints return cross-session usage aggregates: a per-session rollup scoped by working directory and realm, plus global usage rollups by (provider, account) and by (model, provider). Use them to surface per-session activity, per-account audits, and per-model cost or latency reporting. The cross-session statistics endpoint scopes by cwd by default and accepts realm selectors; the usage rollups are cwd-independent and global, so they accept no realm scope.

Returns the cross-session usage aggregate: per-session counters rolled up over persisted records.

Returns the cross-session usage aggregate: per-session counters rolled up over persisted records. The scope query parameter defaults to cwd; realm selection uses X-Hoody-Realm (header, wins) or ?realm= (query alias). When the realm selector is omitted, the agent’s own realm is used.

Terminal window
curl -X GET "https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com/api/v1/agent/statistics?scope=cwd" \
-H "Authorization: Bearer $HOODY_TOKEN" \
-H "X-Hoody-Cwd: /home/user/project" \
-H "X-Hoody-Realm: global"
NameInTypeRequiredDescription
scopequerystringNocwd (default) rolls up the current working directory; all rolls up every session.
realmquerystringNoPer-request realm selector: "global" or a 24-hex realm id. Query alias of X-Hoody-Realm (read only when the header is absent).
X-Hoody-CwdheaderstringNoPer-request working-directory scope: the .hoody project layer, the record cwd, or the tool and workflow cwd.
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override selecting which on-disk .hoody install a stateless read or write resolves against.
X-Hoody-RealmheaderstringNoPer-request realm selector: "global" or a 24-hex realm id. Wins over the realm query parameter. When omitted, the agent’s own realm is used.
{
"scope": "cwd",
"cwd": "/home/user/project",
"totals": {
"sessions": 12,
"messages": 145
}
}

Returns a per-(provider, account) usage rollup from the global usage store.

Returns a per-(provider, account) usage rollup from the global usage store. Accepts ?since=<unix-seconds> to set the lower bound (omit for all-time; a negative or non-numeric value is rejected 400). Because the usage store is global and not realm-scoped, a realm header is rejected with 400 realm_scope_unsupported.

Terminal window
curl -X GET "https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com/api/v1/agent/usage/by-account?since=1700000000" \
-H "Authorization: Bearer $HOODY_TOKEN"
NameInTypeRequiredDescription
sincequeryintegerNoUnix-seconds lower bound; omit for all-time. A negative or non-numeric value is rejected 400.
X-Hoody-CwdheaderstringNoPer-request working-directory scope: the .hoody project layer, the record cwd, or the tool and workflow cwd.
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override selecting which on-disk .hoody install a stateless read or write resolves against.
{
"accounts": [
{
"provider": "openai",
"account": "team@example.com",
"calls": 1247,
"success": 1218,
"errors": 29
}
]
}

Returns a per-(model, provider) usage rollup from the global usage store: calls, success rate, cost, and latency.

Returns a per-(model, provider) usage rollup from the global usage store: calls, success rate, cost, and latency. Accepts ?since=<unix-seconds> (omit for all-time; a negative or non-numeric value is rejected 400). Because the usage store is global, cwd-independent, and not realm-scoped, a realm header returns 400 realm_scope_unsupported and the rollup is identical regardless of the active realm.

Terminal window
curl -X GET "https://{projectId}-{containerId}-agent-1.{server}.containers.hoody.com/api/v1/agent/usage/by-model" \
-H "Authorization: Bearer $HOODY_TOKEN"
NameInTypeRequiredDescription
sincequeryintegerNoUnix-seconds lower bound; omit for all-time. A negative or non-numeric value is rejected 400.
X-Hoody-CwdheaderstringNoPer-request working-directory scope: the .hoody project layer, the record cwd, or the tool and workflow cwd.
X-Hoody-Config-DirheaderstringNoPer-request --config-dir override selecting which on-disk .hoody install a stateless read or write resolves against.
{
"models": [
{
"provider": "openai",
"model": "gpt-4o",
"calls": 1247,
"success_rate": 0.977,
"cost_usd": 12.45,
"latency_ms": 850
}
]
}