Break down a root session's billed cost
Returns a root session’s billed cost split by source, charge kind and model, read in one ledger snapshot. Amounts are billed amounts only. The breakdown covers the same trees the session’s costUsd counts: its own tree and the linked roots costUsd includes, which are aggregated by role (subagent; oversight, the advisor or supervisor configured under the agent’s oversight settings; grader) and never identified. bookedAtGte and bookedAtLt select a half-open booking window [bookedAtGte, bookedAtLt): a window selects charges by when they were booked and corrections by when they were made, so it can hold a correction to a charge booked before it. computeEstimateUsd, the estimate for sandbox compute still running and not yet booked, is returned only without a window; then totalUsd equals the session’s costUsd read at the same moment. A session id that is not a root is rejected with 400 naming its root. A 503 session_cost_unavailable means the cost could not be read whole right now; it is retryable after the Retry-After delay. Each serving process admits at most 2 breakdowns at once for one organization and 4 in all; a request waits up to 2 seconds for a slot. If the organization’s slot does not free in that time it answers 429 session_cost_breakdown_limit with details.limit, so read fewer at a time; if shared capacity does not, it answers 503 session_cost_unavailable. Both carry Retry-After. A 409 session_cost_withheld means the session exists but its cost is withheld in its current state, as its costUsd is; count that session’s cost as unknown, not zero. For a campaign total, list its roots with managedAgentsListSessionsV2 filtered by metadataAll and rootOnly=true, then read this operation for each root, at most 2 at a time; if any root’s cost is withheld, report the total as incomplete.
Authorizations
Headers
Path Parameters
Query Parameters
Response
A root session's billed cost split by source, charge kind and model, over the same trees its costUsd counts, read in one ledger snapshot. Amounts are billed amounts. A booking window selects charges by when they were booked and corrections by when they were made.
A root session's billed cost split by source, charge kind and model, over the same trees its costUsd counts, read in one ledger snapshot. Amounts are billed amounts. A booking window selects charges by when they were booked and corrections by when they were made.
Billed total as an exact canonical decimal USD string: bookedUsd plus computeEstimateUsd when the request has no window, otherwise bookedUsd. Without a window it equals the session's costUsd read at the same moment. A window that holds only corrections can be negative.
"1.234567"
Billable requests over the included trees whose charge is not settled. These count ledger requests only: running sandbox compute keeps accruing while they stay the same. A finished tree whose compute has stopped can stay so_far while indeterminate requests remain, because the provider may still report a charge for them.