What the automation spent in the current budget window, agent by agent.
Every agent the automation spends through, not only the ones its stages run per item: a question held as a conversation spends through the agent that holds it — its opening turn, every reply, the notices it posts and the outcome it tells — and none of those runs is named by a transition, so the funnel and the item costs cannot see them. Each agent's spend is split into what it was for. The window is the agents' own budget window (UTC, calendar-aligned), so a row here and that agent's limit are measured over the same span. An agent that also works elsewhere — chat, another automation — spends more against its limit than it spent here; that difference is the reason to read the two together. Production runs only; refused runs cost nothing and are not counted.
Authorization
Bearer JWT Authorization header using the Bearer scheme. Enter 'Bearer' [space] and then your token.
In: header
Path Parameters
The trigger identifier.
uuidThe tenant identifier
Query Parameters
The window: DAILY, WEEKLY (default) or MONTHLY.
"WEEKLY""UNSPECIFIED" | "DAILY" | "WEEKLY" | "MONTHLY"Response Body
curl -X GET "https://api.fruxon.com/v1/tenants/string/triggers/497f6eca-6276-4993-bfeb-53cbbbba6f08/ledger/spend"{
"period": "DAILY",
"from": 0,
"to": 0,
"cost": 0,
"credits": 0,
"runs": 0,
"agents": [
{
"agentId": "string",
"cost": 0,
"credits": 0,
"runs": 0,
"parts": []
}
]
}{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string",
"property1": null,
"property2": null
}{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string",
"property1": null,
"property2": null
}Starts the ledger over.
Destructive. Cancels every open batch (settling its human task and closing its conversation), deletes every item, effect and dedupe key, and moves the cursor to an empty position under a new version so an in-flight pass loses its write. The items' transitions are kept as history. Refused with 409 when `confirmItems` is not the ledger's current item count, or while a running pass holds a claim. The effects' external targets are not touched — the next pass performs them again.
What the automation spent over time, agent by agent and part by part.
The `ledger/spend` figure bucketed by day or week: the same runs, attributed to the same agents and parts and priced the same way, so the buckets of one budget window add up to that window's `ledger/spend`. Tokens are priced per UTC day, so `HOUR` is refused. Counted live from run records, so a window reaching further back than the workspace keeps run history is counted from `countedFromMs`. Buckets with no spend are omitted. A run that spans midnight UTC puts its tool cost and credits on the day it started and the tokens it used after midnight on the next day.