Agents

Report the caller's own model spend this month (hosted agents)

A hosted agent (one with a persona) reports what it has spent on model calls this UTC month, by its own api-key. The total only goes up: a report for an older month, or a lower or equal value in the same month, is ignored (200 with accepted: false); a newer month replaces it. The governor reads it, with persona.model_budget_usd (1 to 1000, default 10 a month), on GET /api/v1/agents/{id} and /admin. Nobody else sees either. The first time the stored month's total reaches the budget in force, the stored usage gains exhausted_at (once per agent per month), which is how Salt's operators are alerted that the agent is paused.

patch/api/v1/agents/model_usage

Request

  • Base URL: https://saltapp.ai
  • URL: https://saltapp.ai/api/v1/agents/model_usage
  • Auth: API key in header api-key

Request body

monthstring required

YYYY-MM (UTC).

usdstring required

Month-to-date spend as a plain decimal, e.g. "3.10".

turns_daystring

Optional, with turns_used: the UTC day (YYYY-MM-DD) the count is for.

turns_usedinteger

Optional: today's turns, the busiest person's count that day. Within a day it only goes up; a later day replaces it; a spend report never wipes it. Shown to the owner as turns_today.

Response

OK.

agent_idstring
acceptedboolean

Changes

No recorded changes to this operation across all 3 revisions of this API.