> ## Documentation Index
> Fetch the complete documentation index at: https://docs.labelbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Page session nodes and scoped model-cost summaries without loading events



## OpenAPI

````yaml /managed-agents/openapi.yaml get /managed-agents/v1/sessions/{session_id}/costs/sessions
openapi: 3.1.0
info:
  title: Managed Agents API
  version: 0.13.0
  description: >-
    The Recursion Managed Agents REST API. Authenticate with a Recursion API key
    as a bearer token. An organization-scoped key acts in its own organization
    and needs nothing else; a tenant-scoped key must also send
    `x-organization-id` with an organization id or `default`. Field names follow
    each operation's published schema.
servers:
  - url: https://api.recursion.labelbox.com
security:
  - bearerAuth: []
paths:
  /managed-agents/v1/sessions/{session_id}/costs/sessions:
    get:
      tags:
        - Session Model Costs
      summary: >-
        Page session nodes and scoped model-cost summaries without loading
        events
      operationId: managedAgentsListSessionModelCostNodes
      parameters:
        - description: >-
            self selects only this session; subtree selects this session and
            descendants; tree selects the complete root tree.
          in: query
          name: scope
          schema:
            default: self
            description: >-
              self selects only this session; subtree selects this session and
              descendants; tree selects the complete root tree.
            enum:
              - self
              - subtree
              - tree
            type: string
        - in: query
          name: limit
          schema:
            default: 50
            maximum: 100
            minimum: 1
            type: integer
        - description: >-
            Signed, organization/session/scope/limit/snapshot-bound continuation
            token.
          in: query
          name: page_token
          schema:
            description: >-
              Signed, organization/session/scope/limit/snapshot-bound
              continuation token.
            type: string
        - description: >-
            Signed token returned by a model-cost detail page. Pins this
            companion read to the exact same organization/session/scope
            snapshot.
          in: query
          name: model_cost_snapshot_token
          schema:
            description: >-
              Signed token returned by a model-cost detail page. Pins this
              companion read to the exact same organization/session/scope
              snapshot.
            type: string
        - description: >-
            Session id (UUID) the cost read is scoped to. Any id in the tree;
            scope decides how far the read reaches from it. An id outside the
            caller's organization/access policy returns a non-disclosing 404.
          in: path
          name: session_id
          required: true
          schema:
            description: >-
              Session id (UUID) the cost read is scoped to. Any id in the tree;
              scope decides how far the read reaches from it. An id outside the
              caller's organization/access policy returns a non-disclosing 404.
            format: uuid
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ManagedAgentsSessionModelCostNodeListResponse
          description: >-
            One page of the session hierarchy behind a model-cost read,
            paginated independently of the attempt detail so a wide tree cannot
            crowd out attempts.
        '400':
          description: The request was rejected by schema or semantic validation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiError'
        '401':
          description: The caller is unauthenticated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiError'
        '403':
          description: The caller lacks a required permission or capability.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorForbidden'
        '404':
          description: No such resource is reachable for this caller.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiError'
        '429':
          headers:
            Retry-After:
              description: Seconds the caller should wait before retrying.
              schema:
                type: string
              style: simple
          description: A rate limit is exhausted. Honor `Retry-After`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiError'
        '500':
          description: An unexpected server-side failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiError'
        '502':
          description: The service returned an invalid response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorBadGateway'
        '503':
          headers:
            Retry-After:
              description: Seconds the caller should wait before retrying.
              schema:
                type: string
              style: simple
          description: A dependency is unavailable. Retryable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiError'
        '504':
          headers:
            Retry-After:
              description: When to retry, as delay seconds or an HTTP date.
              schema:
                type: string
          description: The service did not respond before the timeout. Retryable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorGatewayTimeout'
components:
  schemas:
    ManagedAgentsSessionModelCostNodeListResponse:
      description: >-
        One page of the session hierarchy behind a model-cost read, paginated
        independently of the attempt detail so a wide tree cannot crowd out
        attempts.
      properties:
        model_cost_snapshot_token:
          description: >-
            Signed organization/session/scope-bound token that pins companion
            model-cost reads to this exact snapshot.
          type: string
        next_page_token:
          description: >-
            Continuation for the next page, passed back as page_token. Absent on
            the last page, and bound to this organization, session, scope,
            limit, and snapshot.
          type: string
        read_timestamp:
          description: >-
            RFC 3339 timestamp of the database snapshot these rollups were read
            from.
          format: date-time
          type: string
        scope:
          description: >-
            How far the hierarchy read reached from that session: this session
            alone (self), this session and its descendants (subtree), or every
            session under the same root (tree).
          enum:
            - self
            - subtree
            - tree
          type: string
        session_id:
          description: Session the read was scoped to (UUID).
          type: string
        session_nodes:
          description: >-
            Sessions in scope, ordered by session_path then session_id, up to
            the requested limit.
          items:
            $ref: '#/components/schemas/ManagedAgentsSessionModelCostNodeResponse'
          type: array
      required:
        - session_id
        - scope
        - session_nodes
        - model_cost_snapshot_token
        - read_timestamp
      type: object
      example:
        model_cost_snapshot_token: example
        next_page_token: example
        read_timestamp: '2026-02-18T09:30:00.000Z'
        scope: self
        session_id: 9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
        session_nodes:
          - model_costs:
              self:
                adjustment_count: example
                attempt_count: example
                charge_count: example
                completeness: complete
                model_cost_usd: example
                scope: self
                session_id: 9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
              session_id: 9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
              subtree:
                adjustment_count: example
                attempt_count: example
                charge_count: example
                completeness: complete
                model_cost_usd: example
                scope: self
                session_id: 9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
              tree:
                adjustment_count: example
                attempt_count: example
                charge_count: example
                completeness: complete
                model_cost_usd: example
                scope: self
                session_id: 9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
            parent_session_id: 9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
            root_session_id: 9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
            session_id: 9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
            session_path: example
    ManagedAgentsApiError:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - analytics
            - analytics_not_ready
            - artifact_fetch_unavailable
            - artifact_generation_mismatch
            - artifact_hash_mismatch
            - artifact_invalid_events
            - artifact_invalid_json
            - artifact_not_allowlisted
            - artifact_size_mismatch
            - atlassian_rate_limited
            - atlassian_unavailable
            - atomic_ingest_timeout
            - auth_unavailable
            - automation_event_source_invalid
            - automation_memory_unavailable
            - automation_reference_invalid
            - automation_runs_unconfigured
            - automations_unconfigured
            - bad_gateway
            - built_in_catalog_unavailable
            - built_in_integrations_disabled
            - built_in_integrations_unconfigured
            - compute_offerings_unavailable
            - conflict
            - content_store_request_canceled
            - content_store_unavailable
            - content_store_upload_timeout
            - credential_encryption_unconfigured
            - delegate_preparation_failed
            - entity_family_not_permitted
            - environment_not_verified
            - evaluation_cancellation_pending
            - evaluation_deletion_pending
            - event_admission_unavailable
            - event_ingress_unavailable
            - event_source_verification_credential_invalid
            - event_sources_unconfigured
            - execution_unconfigured
            - file_quota_exceeded
            - file_storage_unconfigured
            - forbidden
            - gateway_timeout
            - gestalt_unconfigured
            - github_rate_limited
            - github_unavailable
            - handoff_access_invalid
            - handoff_access_unavailable
            - handoff_access_unsupported
            - handoff_capture_unavailable
            - handoff_requires_retest
            - handoff_revoke_unavailable
            - handoff_signal_unavailable
            - idempotency_conflict
            - idempotency_in_progress
            - idempotency_unavailable
            - ingest_policy_changed
            - ingest_policy_not_found
            - ingest_policy_revoked
            - integrations_unconfigured
            - internal_error
            - invalid_json
            - invalid_pull_request_review_result
            - invalid_request
            - invalid_scope
            - invariant_violation
            - launchdarkly_rate_limited
            - launchdarkly_unavailable
            - live_fleet_unconfigured
            - managed_agents_unavailable
            - merge_key_rejected
            - merge_link_unavailable
            - merge_rate_limited
            - merge_unavailable
            - missing_dependency
            - model_gateway_metadata_missing
            - model_gateway_unconfigured
            - model_gateway_unreachable
            - mutation_transaction_budget_exceeded
            - not_found
            - page_token_expired
            - payload_too_large
            - persistence_busy
            - precondition_failed
            - precondition_required
            - provider_registration_unsupported
            - provider_selection_unsupported
            - rate_limit_exceeded
            - rate_limited
            - repository_automation_unconfigured
            - request_too_large
            - reserved_source_type
            - revision_conflict
            - run_log_store_unavailable
            - runner_image_resolution_failed
            - sandbox_provider_disabled
            - service_unavailable
            - session_analyst_busy
            - session_analyst_model_unavailable
            - session_analyst_unconfigured
            - session_start_admission_unavailable
            - session_start_not_admitted
            - setup_fallback_environment_unsafe
            - setup_run_finished
            - setup_run_in_progress
            - setup_run_limit
            - setup_run_not_started
            - setup_runs_unavailable
            - skill_storage_unconfigured
            - slack_channels_rejected
            - slack_channels_unavailable
            - slack_channels_unconfigured
            - slack_connection_malformed
            - slack_event_intake_unavailable
            - slack_installation_mismatch
            - slack_missing_scope
            - slack_rate_limited
            - slack_reapproval_required
            - source_ownership_mismatch
            - source_revision_conflict
            - spanner_unavailable
            - streaming_unsupported
            - submission_transaction_budget_exceeded
            - task_version_number_conflict
            - team_board_unconfigured
            - too_many_streams
            - unauthorized
            - unsupported_media_type
            - vault_creation_retired
            - version_content_conflict
            - webhook_delivery_too_large
            - workspace_boundary_denied
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          description: Optional structured error details.
          type: object
          propertyNames:
            type: string
          additionalProperties: {}
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorForbidden:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - forbidden
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          description: Optional structured error details.
          type: object
          propertyNames:
            type: string
          additionalProperties: {}
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorBadGateway:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - bad_gateway
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          description: Optional structured error details.
          type: object
          propertyNames:
            type: string
          additionalProperties: {}
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorGatewayTimeout:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - gateway_timeout
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          description: Optional structured error details.
          type: object
          propertyNames:
            type: string
          additionalProperties: {}
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsSessionModelCostNodeResponse:
      description: >-
        One session of a tree with its own model-cost rollups, so a tree total
        can be attributed to the sessions that produced it.
      properties:
        model_costs:
          $ref: '#/components/schemas/ManagedAgentsSessionModelCostSummariesResponse'
          description: This session's own, subtree, and tree rollups.
        parent_session_id:
          description: Session that created this one (UUID). Empty on a root session.
          type: string
        root_session_id:
          description: >-
            Root session of the tree this session belongs to (UUID). Equal to
            session_id for a root session.
          type: string
        session_id:
          description: Identifier for this session (UUID).
          type: string
        session_path:
          description: >-
            Position of this session within its tree, as a slash-delimited path
            of session ids. "/" for a root session.
          type: string
      required:
        - session_id
        - root_session_id
        - session_path
        - model_costs
      type: object
      example:
        model_costs:
          self:
            adjustment_count: example
            attempt_count: example
            charge_count: example
            completeness: complete
            model_cost_usd: example
            scope: self
            session_id: 9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
          session_id: 9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
          subtree:
            adjustment_count: example
            attempt_count: example
            charge_count: example
            completeness: complete
            model_cost_usd: example
            scope: self
            session_id: 9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
          tree:
            adjustment_count: example
            attempt_count: example
            charge_count: example
            completeness: complete
            model_cost_usd: example
            scope: self
            session_id: 9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
        parent_session_id: 9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
        root_session_id: 9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
        session_id: 9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
        session_path: example
    ManagedAgentsSessionModelCostSummariesResponse:
      description: >-
        One session's three scope rollups, read from a single database snapshot
        so self, subtree, and tree cannot disagree with one another.
      properties:
        self:
          $ref: '#/components/schemas/ManagedAgentsSessionModelCostSummaryResponse'
          description: >-
            Totals for this session's own attempts, excluding every child
            session.
        session_id:
          description: Session these three rollups were requested for (UUID).
          type: string
        subtree:
          $ref: '#/components/schemas/ManagedAgentsSessionModelCostSummaryResponse'
          description: Totals for this session and every session beneath it in the tree.
        tree:
          $ref: '#/components/schemas/ManagedAgentsSessionModelCostSummaryResponse'
          description: >-
            Totals for every session sharing the same root session, including
            this session's ancestors and siblings.
      required:
        - session_id
        - self
        - subtree
        - tree
      type: object
      example:
        self:
          adjustment_count: example
          attempt_count: example
          charge_count: example
          completeness: complete
          model_cost_usd: example
          scope: self
          session_id: 9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
        session_id: 9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
        subtree:
          adjustment_count: example
          attempt_count: example
          charge_count: example
          completeness: complete
          model_cost_usd: example
          scope: self
          session_id: 9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
        tree:
          adjustment_count: example
          attempt_count: example
          charge_count: example
          completeness: complete
          model_cost_usd: example
          scope: self
          session_id: 9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
    ManagedAgentsSessionModelCostSummaryResponse:
      description: >-
        Model-cost rollup for one session scope: the exact ledger amount, how
        complete the accounting behind it is, and the counts it was derived
        from. attempt_count is every provider call the ledger is accountable
        for, charge_count only those that produced a receipt, and
        adjustment_count the signed corrections applied since. Model spend only:
        sandbox, tool, and storage cost are not included.
      properties:
        adjustment_count:
          description: Exact base-10 integer string.
          type: string
        attempt_count:
          description: Exact base-10 integer string.
          type: string
        charge_count:
          description: Exact base-10 integer string.
          type: string
        completeness:
          description: >-
            Weakest accounting state present in scope, so a rollup never
            overstates confidence: complete when every attempt is fully priced,
            pending when no attempt has been recorded yet or an outcome is still
            unknown, unpriced when no catalog rule matched the provider's
            quantities, partial when only part of the cost is known or several
            states are mixed, legacy_partial for charges recorded before the
            current reconciliation rules, and indeterminate when an attempt may
            have been billed without a usable receipt.
          enum:
            - complete
            - pending
            - unpriced
            - partial
            - legacy_partial
            - indeterminate
          type: string
        model_cost_usd:
          description: >-
            Exact canonical decimal USD string. It is model cost only, not total
            session spend. Customers receive the amount their organization is
            billed; only trusted internal callers receive raw ledger cost here.
          type: string
        scope:
          description: >-
            Which sessions contributed: self counts this session's own attempts,
            subtree adds every session beneath it, and tree covers every session
            sharing the same root session.
          enum:
            - self
            - subtree
            - tree
          type: string
        session_id:
          description: >-
            Session this rollup was requested for (UUID). Scope decides which
            sessions in its tree contributed to the figures.
          type: string
      required:
        - session_id
        - scope
        - model_cost_usd
        - completeness
        - attempt_count
        - charge_count
        - adjustment_count
      type: object
      example:
        adjustment_count: example
        attempt_count: example
        charge_count: example
        completeness: complete
        model_cost_usd: example
        scope: self
        session_id: 9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: A Recursion API key, created in the console under API keys.

````