Creates or updates the budget configuration for an agent
Upserts a single cap in place, identified by (origin, environment, period) — the same call creates the cap if none exists or replaces the existing one. The window is taken from `period` in the body (default `MONTHLY`); several caps on different windows can coexist on one bucket and all enforce together. Once a cap is set, the execution engine rejects new runs that would push that window's accumulated cost above it, and alert thresholds fire notifications as usage crosses them. The mandatory agent-wide daily, weekly, and monthly caps (on Production and Test) cannot be removed — set `enforceLimit: false` for a notify-only cap instead; optional caps can be removed via M:Fruxon.Server.Controllers.AgentBudgetController.Delete(System.String,Fruxon.Model.AgentSessions.ExecutionOrigin,System.String,Fruxon.Model.AgentBudgets.BudgetPeriod).
Authorization
Bearer JWT Authorization header using the Bearer scheme. Enter 'Bearer' [space] and then your token.
In: header
Path Parameters
The agent ID.
The tenant identifier
Query Parameters
Which spend bucket this budget caps — default PRODUCTION; pass TEST for the developer test bucket.
"PRODUCTION""UNSPECIFIED" | "PRODUCTION" | "TEST"Which environment this budget caps. Omitted (default) sets the agent-wide cap spanning all environments; a slug caps only that environment's spend (the environment is auto-created if needed). An execution must fit under every configured cap.
The budget configuration (amount, period, thresholds, enforce flag).
Budget amount in USD.
doubleThe billing window to cap spend over — daily, weekly, or monthly. If null, defaults to Fruxon.Model.AgentBudgets.BudgetPeriod.Monthly on create and preserves the existing period on update.
"UNSPECIFIED" | "DAILY" | "WEEKLY" | "MONTHLY"Threshold rules defining at which percentages notifications are sent. If null, existing thresholds are preserved on update.
When true, execution is blocked when spend reaches 100% of the budget.
When null on create, defaults to true (budgets enforce by
default); set false for notify-only. On update, null preserves
the existing value.
Response Body
curl -X PUT "https://api.fruxon.com/v1/tenants/string/agents/string/budget" \ -H "Content-Type: application/json" \ -d '{}'{
"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
}{
"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
}{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string",
"property1": null,
"property2": null
}Removes a single optional budget cap
Deletes the cap identified by (origin, environment, period). The mandatory agent-wide daily, weekly, and monthly caps (on Production and Test) cannot be removed — a request targeting one returns 400. Use this to drop a per-environment cap. Historical cost data is unaffected.
Lists the immutable audit timeline for a single approval request, newest-first.
Each entry records one lifecycle transition (requested / responded / cancelled / expired) with the actor, the channel they acted through (web, connector, topic callback, system), and — for the decision — the verdict and any free text. The requested entry also carries the tool parameters that were put up for approval. Returns an empty page when the approval id does not belong to the agent in the route.