intentic
Download the app
Download the app
Models and accounts

Usage

What has been spent, grouped

On this page(4 sections)

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

FieldTypeWhere
fromFirst day to include, as YYYY-MM-DD…stringquery
toLast day to include, as YYYY-MM-DD…stringquery

What comes back

FieldType
rowsSpending grouped by day, provider, account,…object[]
dayThe day, as YYYY-MM-DD in UTCstring
providerWhich model providerstring
accountWhich accountstring
modelWhich modelstring
harnessWhich agentic loopstring
conversationIdWhich conversationstring
turnsTurns in this groupnumber
inputTokensUncached input tokens, excluding cache reads…number
outputTokensTokens receivednumber
cacheReadTokensTokens served from cachenumber
cacheCreationTokensTokens written to cachenumber
costUsdWhat the group cost, in dollarsnumber
costKnownFalse when the cost includes unpriced…boolean
durationMsTime spent, in millisecondsnumber
Try itanswered in this tab
curl
curl "$SANDBOX/usage/rollup" \
  -H "x-intentic-control: $INTENTIC_TOKEN"
TypeScript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.usage.rollup();
POST/usage/plan-limits/refreshMeasure every account's plan limits again

Reads how full each connected account's plan limits are, for every provider, and records it. Forced, it measures even accounts read a moment ago, which is the right thing when a plan was just changed and the question is whether the number on screen is still true. Answers with the accounts it could not read because the provider is rate-limiting them, and when each may be asked again: those keep the reading they already had, so a number that does not move is explained rather than silent.

What you send

FieldTypeWhere
forceMeasure again even if a reading…booleanbody

What comes back

FieldType
oktrue
heldAccounts whose plan limits could not…object[]
providerWhich provider is holding the read…string
accountThe account as its provider's list…string
resumesAtUnix seconds: when this account may…number
Try itanswered in this tab
curl
curl -X POST "$SANDBOX/usage/plan-limits/refresh" \
  -H "x-intentic-control: $INTENTIC_TOKEN" \
  -H "content-type: application/json" \
  -d '{"force":false}'
TypeScript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.usage.refreshPlanLimits({
  "force": false
});
GET/usage/limit-reset/{account}Whether this account's session window can be reopened now

Asks the provider whether it will reopen this account's spent session window immediately, which some plans grant once a week. Only worth asking about an account that has actually been refused: the answer is the provider's judgement at this moment, it is not cached, and an account with no such grant answers plainly that it has none.

What you send

FieldTypeWhere
accountrequiredWhich accountstringaddress

What comes back

FieldType
availableWhether the provider will reopen this…boolean
reasonWhy not, in the provider's own…string
nextAvailableAtWhen the next reset may be…number
weeklyResetsAtWhen the weekly allowance itself reopens,…number
Try itanswered in this tab
curl
curl "$SANDBOX/usage/limit-reset/work" \
  -H "x-intentic-control: $INTENTIC_TOKEN"
TypeScript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.usage.limitReset({
  "account": "work"
});
POST/usage/limit-reset/{account}/claimReopen this account's session window now

Spends one of the account's weekly resets to reopen its session window immediately. The weekly allowance is untouched and still binds. Answers with what the provider actually did: only `reset` changed anything, and it is the cue to send the refused turn again.

What you send

FieldTypeWhere
accountrequiredWhich accountstringaddress

What comes back

FieldType
resultWhat the provider did"reset" | "already_used" | "not_limited" | "ineligible" … (6)
nextAvailableAtWhen another reset may be claimed,…number
detailWhat went wrong, in words, for…string
Try itanswered in this tab
curl
curl -X POST "$SANDBOX/usage/limit-reset/work/claim" \
  -H "x-intentic-control: $INTENTIC_TOKEN"
TypeScript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.usage.claimLimitReset({
  "account": "work"
});
More in Models and accounts

Type to search every page, in the docs and the API reference.