FruxonDocs
AgentsBudget

Gets the budget configuration for an agent, including current cost and usage data

Returns the budget cap, period, alert thresholds, and the live cost accumulated against the current period (sourced from the same execution-cost stream that powers `GET /v1/tenants/{tenant}/agents/{agent}/revisions/{revision}/cost`). A `null` response body means the agent has no budget enforcement and runs are uncapped. A 404 here means the agent id is invalid or the caller has no access to it — not that the budget is unset. Use this to drive budget UI and to check headroom before kicking off expensive batches.

GET
/v1/tenants/{tenant}/agents/{agent}/budget
AuthorizationBearer <token>

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

In: header

Path Parameters

agent*string

The agent ID.

tenant*string

The tenant identifier

Query Parameters

origin?string

Which spend bucket to read — PRODUCTION (default, preserves pre-test-budget client behavior) or TEST (the developer :test / :streamTest bucket). Production and Test are independent caps on the same agent; M:Fruxon.Server.Controllers.AgentBudgetController.ListAll(System.String) returns both at once for a budget-panel UI.

Value in"UNSPECIFIED" | "PRODUCTION" | "TEST"
environment?string

Which environment's cap to read. Omitted (default) reads the agent-wide budget spanning all environments; a slug reads that environment's own cap. The two layers are independent budgets.

period?string

Which window's cap to read — MONTHLY (default), WEEKLY, or DAILY. A bucket can hold several caps on different windows; M:Fruxon.Server.Controllers.AgentBudgetController.ListAll(System.String) returns them all at once for a budget-panel UI.

Value in"UNSPECIFIED" | "DAILY" | "WEEKLY" | "MONTHLY"

Response Body

curl -X GET "https://api.fruxon.com/v1/tenants/string/agents/string/budget"
{
  "agentId": "string",
  "origin": "PRODUCTION",
  "environment": "string",
  "amount": 0,
  "period": "DAILY",
  "thresholdRules": [
    {
      "percent": 0
    }
  ],
  "enforceLimit": false,
  "currentPeriodCost": 0,
  "usagePercent": 0,
  "periodStart": 0,
  "periodEnd": 0,
  "createdAt": 0,
  "modifiedAt": 0
}
Empty
{
  "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
}