Skip to main content
GET
Break down a root session's billed cost

Authorizations

Authorization
string
header
required

A Recursion API key, created in the console under API keys.

Headers

x-tenant-id
string

Optional tenant consistency check. When present, it must name the tenant bound to the API key, including when x-organization-id is default.

Minimum string length: 1
x-organization-id
string

Organization in which to act. Required for a tenant-scoped API key. Optional for an organization-scoped key, where it must name that same organization. The value may be an organization id or default.

Minimum string length: 1

Path Parameters

sessionId
string<uuid>
required

Root session id (UUID). A session that is not a root is rejected with 400 naming its root.

Query Parameters

bookedAtGte
string<date-time>

Inclusive start of the booking window, RFC 3339. Omit for an open start. Charges are selected by when they were booked and corrections by when they were made.

bookedAtLt
string<date-time>

Exclusive end of the booking window, RFC 3339; must be after bookedAtGte. Omit for an open end.

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.

bookedUsd
string
required

Sum of every item's billedUsd: charges booked in the window and corrections booked in it, at the billed price.

Example:

"1.234567"

costState
enum<string>
required

The costState the session's costUsd shows: final once every included tree has ended and settled, so_far while the cost can still grow.

Available options:
final,
so_far
items
object[]
required

Billed amounts by source, charge kind and model, for the bookings in the window. Items with nothing booked in the window are left out.

readAt
string<date-time>
required

RFC 3339 timestamp of the ledger snapshot every amount was read at.

sessionId
string
required

Root session whose cost this is (UUID).

totalUsd
string
required

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.

Example:

"1.234567"

unsettledAttempts
object
required

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.

bookedAtGte
string<date-time>

Start of the booking window, inclusive, as requested. Absent for an open start.

bookedAtLt
string<date-time>

End of the booking window, exclusive, as requested. Absent for an open end.

computeEstimateUsd
string

Billed estimate for sandbox compute still running and not yet booked, as costUsd includes it. Present only when the request has no window, because unbooked compute has no booking time.

Example:

"0.12"