Summarize what usage cost the organization
PreviewOperate durable execution, schedules, sandbox infrastructure, budgets, payments and audit logs.
/v1/costs/summarySee authentication for credentials and permissions.
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Window start (inclusive). Default: the start of this month.
Window end (exclusive). Default: now.
Only this agent (agent_...).
Responses
200Success
Success
Org cost over a window, grouped several ways.
object
Totals by agent.
One line of the costs summary.
object
Where the amounts came from: host, rate, provider, list_price, unpriced, or mixed.
Priced cost in USD. Unpriced usage is not in it.
Group key: an agent id, a user id, a source key, a basis, a day.
Display name for the key, such as the agent’s name.
Tokens for models, hours for sandboxes, summed as recorded.
Usage records in the group, priced or not.
Usage records with no price.
Totals by where the amount came from.
One line of the costs summary.
object
Where the amounts came from: host, rate, provider, list_price, unpriced, or mixed.
Priced cost in USD. Unpriced usage is not in it.
Group key: an agent id, a user id, a source key, a basis, a day.
Display name for the key, such as the agent’s name.
Tokens for models, hours for sandboxes, summed as recorded.
Usage records in the group, priced or not.
Usage records with no price.
Totals by day, in the org’s timezone.
One line of the costs summary.
object
Where the amounts came from: host, rate, provider, list_price, unpriced, or mixed.
Priced cost in USD. Unpriced usage is not in it.
Group key: an agent id, a user id, a source key, a basis, a day.
Display name for the key, such as the agent’s name.
Tokens for models, hours for sandboxes, summed as recorded.
Usage records in the group, priced or not.
Usage records with no price.
Totals by what was used, such as a provider and model.
One line of the costs summary.
object
Where the amounts came from: host, rate, provider, list_price, unpriced, or mixed.
Priced cost in USD. Unpriced usage is not in it.
Group key: an agent id, a user id, a source key, a basis, a day.
Display name for the key, such as the agent’s name.
Tokens for models, hours for sandboxes, summed as recorded.
Usage records in the group, priced or not.
Usage records with no price.
Totals by who started the work: person, or unattended (schedules
and other runs nobody watches).
One line of the costs summary.
object
Where the amounts came from: host, rate, provider, list_price, unpriced, or mixed.
Priced cost in USD. Unpriced usage is not in it.
Group key: an agent id, a user id, a source key, a basis, a day.
Display name for the key, such as the agent’s name.
Tokens for models, hours for sandboxes, summed as recorded.
Usage records in the group, priced or not.
Usage records with no price.
Totals by the person the usage counts for.
One line of the costs summary.
object
Where the amounts came from: host, rate, provider, list_price, unpriced, or mixed.
Priced cost in USD. Unpriced usage is not in it.
Group key: an agent id, a user id, a source key, a basis, a day.
Display name for the key, such as the agent’s name.
Tokens for models, hours for sandboxes, summed as recorded.
Usage records in the group, priced or not.
Usage records with no price.
Priced cost in USD over the window. Unpriced usage is not in it.
Window start (inclusive).
Runs where an agent handed work to other agents: their whole cost by
the agent the run started with, split by the agent that spent it.
Every amount is also in by_agent, under the agent that spent it.
The runs one agent led, with whole-run cost and who spent it.
object
The agent the runs started with.
Who spent it, the leading agent itself included, largest first.
One agent’s spend within the runs another agent led.
object
Absent for usage recorded with no agent.
lead for the leading agent itself, created_here for an agent
created as part of it, linked for any other agent.
Priced cost of those runs in USD, every agent included.
Runs it handed work to other agents in, with usage in the window.
The org’s timezone; calendar windows and days use it.
Window end (exclusive).
Usage records over the window with no price.
Example
{ "runs_with_agents": [ { "agent_id": "agent_01h9xk1a", "agent_name": "Foreman", "by_agent": [ { "agent_id": "agent_01h9xk2m", "agent_name": "Implement", "cost_usd": 121.3, "relation": "created_here" } ], "cost_usd": 212.4, "runs": 12 } ]}