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.
"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 an Fruxon.Model.AgentBudgets.AgentBudget caps spend over. Windows are calendar-aligned in UTC: Fruxon.Model.AgentBudgets.BudgetPeriod.Daily is midnight to midnight, Fruxon.Model.AgentBudgets.BudgetPeriod.Weekly is the ISO week (Monday start), and Fruxon.Model.AgentBudgets.BudgetPeriod.Monthly is the first of the month. The accumulated cost resets when the agent's first execution crosses into a new window (lazy rollover keyed on Fruxon.Model.AgentBudgets.AgentBudget.CostPeriodStart). Wire and storage form is UPPER_SNAKE per project convention.
"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 all collaborators for a specific agent.
Returns every user with an explicit grant on this agent along with their role (Viewer, Editor, or Admin) and joined user profile data (display name, email). Pending access requests created via `POST /v1/tenants/{tenant}/agents/{agent}/collaborators:requestAccess` are included with a pending status so admins can act on them. Tenant admins are not listed here — they have implicit access to all agents regardless of explicit grants.