AI EngineerGuide

Budget for Claude Managed Agents session

by Ashik Nesin Ashik Nesin

For Claude Managed Agents, you now set budget at session level

session=$(curl -fsSL https://api.anthropic.com/v1/sessions \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "anthropic-beta: managed-agents-2026-04-01" \
  -H "content-type: application/json" \
  -d @- <<EOF
{
  "agent": "$AGENT_ID",
  "environment_id": "$ENVIRONMENT_ID",
  "budget": {
    "type": "limit",
    "max_list_cost": {"amount": "2500", "currency": "USD"}
  }
}
EOF
)
SESSION_ID=$(jq -r '.id' <<< "$session")

When creating a session, pass budget with type=limit and max_list_cost.amount in cents.

What happens when a budget is reached?

When the session reaches the budget, we’ll be getting session.thread_status_idle event with budget_reached as stop_reason

Reference

Stay Updated

Get the latest AI engineering insights delivered to your inbox.

No spam. Unsubscribe at any time.