FruxonDocs
Agent NetworkTriggers

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.

GET
/v1/tenants/{tenant}/triggers/{trigger}/ledger/spendTimeseries
AuthorizationBearer <token>

JWT Authorization header using the Bearer scheme. Enter 'Bearer' [space] and then your token.

In: header

Path Parameters

trigger*string

The trigger identifier.

Formatuuid
tenant*string

The tenant identifier

Query Parameters

interval?string

Bucket granularity: DAY (default) or WEEK.

Default"DAY"
Value in"UNSPECIFIED" | "HOUR" | "DAY" | "WEEK"
from?integer

Window start as Unix milliseconds (inclusive). Defaults to 30 days before to.

Formatint64
to?integer

Window end as Unix milliseconds (exclusive). Defaults to now.

Formatint64

Response Body

curl -X GET "https://api.fruxon.com/v1/tenants/string/triggers/497f6eca-6276-4993-bfeb-53cbbbba6f08/ledger/spendTimeseries"
{
  "triggerId": "00000000-0000-0000-0000-000000000000",
  "interval": "HOUR",
  "window": {
    "fromMs": 0,
    "toMs": 0
  },
  "countedFromMs": 0,
  "cost": 0,
  "credits": 0,
  "runs": 0,
  "series": [
    {
      "agentId": "string",
      "part": "ITEM_RUNS",
      "cost": 0,
      "credits": 0,
      "runs": 0,
      "points": []
    }
  ]
}
{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "property1": null,
  "property2": null
}
Empty
Empty
{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "property1": null,
  "property2": null
}