FruxonDocs
AgentsBudget

Creates or updates the budget configuration for an agent

Creates or replaces the cap identified by origin, environment and period. period defaults to MONTHLY; multiple windows can enforce together. New runs are rejected if they would exceed an enforced cap, and alerts fire at the configured thresholds. Mandatory agent-wide daily, weekly and monthly caps for PRODUCTION and TEST cannot be deleted; set enforceLimit=false for notification only. Optional caps can be removed with DELETE budget.

PUT
/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 this budget caps — default PRODUCTION; pass TEST for the developer test bucket.

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

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).

amount?number

Budget amount in USD.

Formatdouble
period?string

The billing window to cap spend over — daily, weekly, or monthly. If null, defaults to BudgetPeriod.Monthly on create and preserves the existing period on update.

Value in"UNSPECIFIED" | "DAILY" | "WEEKLY" | "MONTHLY"
thresholdRules?|null

Threshold rules defining at which percentages notifications are sent. If null, existing thresholds are preserved on update.

enforceLimit?boolean|null

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.

[key: string]?never

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
}
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
}