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.

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

Query Parameters

session_ids
string
required

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.

session_usage
object[] | null
required

One roll-up row per requested session id the caller can see. Empty when none 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.