Skip to main content
GET
Roll up token and cost totals for a batch of sessions

Authorizations

Authorization
string
header
required

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

Query Parameters

session_ids
string
required

Comma-separated session ids to roll up, matching the ids returned by GET /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 /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 /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.

session_usage
object[] | null
required

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.