⚠️ Experimental — This resource is part of the Guild platform and may change in future releases.
Manages the cost budget for an agent. Budgets enforce spend limits on a daily or monthly cadence. When the limit is exceeded the agent’s API calls are blocked until the next period.
resource "sg_agent" "example" {
name = "budgeted-agent"
}
resource "sg_agent_budget" "example" {
agent_name = sg_agent.example.name
limit_usd = 100
period_type = "monthly"
}
resource "sg_agent" "burst" {
name = "burst-agent"
}
resource "sg_agent_budget" "daily_cap" {
agent_name = sg_agent.burst.name
limit_usd = 5
period_type = "daily"
}
Import an existing sg_agent_budget using its agent name:
terraform import sg_agent_budget.example 'my-first-agent'
agent_name (String) Name of the agent this budget applies to.limit_usd (Number) Maximum spend in USD for the budget period.period_type (String) Budget reset cadence. Must be ‘daily’ or ‘monthly’.exceeded (Boolean) Whether the agent has exceeded its budget.remaining_usd (Number) Remaining budget in the current period.spent_usd (Number) Amount spent in the current period.