Models and accounts
Usage
What has been spent, grouped
One read: the spending record over a range of days, grouped finely enough that every cost screen is a rearrangement of it rather than a second call.
GET/usage/rollupWhat was spent, grouped
The spending record over a range of days, grouped by day, provider, account and model. Everything a cost screen shows is a rearrangement of this one answer, so nothing needs a second call. Read-only: rows are written by the sandbox as turns end, which is what makes it worth trusting.
What you send
| Field | Type | Where |
|---|---|---|
fromFirst day to include, as YYYY-MM-DD… | string | query |
toLast day to include, as YYYY-MM-DD… | string | query |
What comes back
| Field | Type |
|---|---|
rowsSpending grouped by day, provider, account,… | object[] |
dayThe day, as YYYY-MM-DD in UTC | string |
providerWhich model provider | string |
accountWhich account | string |
modelWhich model | string |
harnessWhich agentic loop | string |
conversationIdWhich conversation | string |
turnsTurns in this group | number |
inputTokensTokens sent | number |
outputTokensTokens received | number |
cacheReadTokensTokens served from cache | number |
cacheCreationTokensTokens written to cache | number |
costUsdWhat the group cost, in dollars | number |
durationMsTime spent, in milliseconds | number |
answered in this tab
curl "$SANDBOX/usage/rollup" \
-H "x-intentic-control: $INTENTIC_TOKEN"import { sandbox } from "@intentic/sandbox-client";
const result = await sandbox.usage.rollup();More in Models and accounts