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
}The automation's runs, newest first.
A run is one admission — a scheduled or manual pass, an event, a hand start — and everything that has happened since to the items it let in, whichever later pass moved them: counts by state and by stage, and what their agent runs have cost so far. It keeps changing until every item in it settles, so a page that shows a `live` run is meant to be read again. Not the passes list: a pass is what one sweep did, including the older items it moved along. A run's `id` is its fire row's id where the admission wrote one, so the two can be read side by side.
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.