Roll up token and cost totals for a batch of sessions
Rolls up token counts and cost for the sessions named in session_ids and returns one row per session. Ids that do not exist in this organization are omitted rather than erroring, so compare the row count against what you asked for. The request is rejected if it names more ids than the per-request maximum.
Authorizations
A Recursion API key, created in the console under API keys.
Headers
Optional tenant consistency check. When present, it must name the tenant bound to the API key, including when x-organization-id is default.
1Organization 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.
1Query Parameters
Comma-separated session ids to roll up, matching the ids returned by GET /managed-agents/v1/sessions. Ids that do not exist in this organization or are outside the caller's access policy are omitted from the response rather than erroring.
Response
Response body of GET /managed-agents/v1/sessions/usage: token and cost totals for an explicit batch of session ids, so a list view can show a cost per row without reading every session's events. session_ids is required and bounded; too many ids is rejected outright rather than truncated, because a silently short answer is indistinguishable from idle sessions.
Response body of GET /managed-agents/v1/sessions/usage: token and cost totals for an explicit batch of session ids, so a list view can show a cost per row without reading every session's events. session_ids is required and bounded; too many ids is rejected outright rather than truncated, because a silently short answer is indistinguishable from idle sessions.
One roll-up row per requested session id that the caller can see. Null rather than an empty array when none of the requested ids resolved. Ids naming nothing visible are omitted, so the result may be shorter than session_ids and the order should not be assumed to match.