GET/api/orgs/{org_id}/sessions/{session_id}/tree

Get a session's span tree

The whole session as one JSON object: its roots, each node's children nested in start order, long keys, no bodies. The same nodes as the skeleton (up to 25,000; truncated says when the cut applied). Read this first, then open single requests.

Authentication: Bearer API key in the Authorization header

Path parameters

  • org_idstringrequired

    Your organization id (uuid). GET /api/whoami returns it.

  • session_idstringrequired

    The session id: the id your agent sent, else the conversation the gateway recognized, else the trace id.

Responses

  • 200

    The span tree.

    Response
    • session_idstring | null

      The session (on a trace, its one session, else null).

    • trace_idstring

      The trace, on a trace tree only.

    • t0string | nullrequired

      The earliest start; null when there are no nodes.

    • node_countintegerrequired

      Nodes in the tree.

    • truncatedbooleanrequired

      Whether the 25,000-node cut applied.

    • rootsarray<object>required
      roots
      • idstringrequired

        The node id; a gateway request's node id is its request id.

      • kindenumrequired

        request a model call through the gateway, llm your own LLM span, tool a tool call, agent an agent or subagent, span any other span of yours.

        "request""llm""tool""agent""span"
      • trace_idstringrequired
      • namestring | null
      • start_msintegerrequired

        Milliseconds after t0.

      • started_atstringrequired
      • duration_msinteger | null

        Null while running.

      • statusenumrequired
        "completed""failed""incomplete""cancelled""running"
      • failure_classstring | null
      • modelstring | null
      • pathstring | null

        The step path, like /plan/research.

      • api_key_idstring | null
      • ttft_msinteger | null
      • input_tokensinteger
      • output_tokensinteger
      • cached_input_tokensinteger
      • cost_nano_usdinteger

        All-in cost, integer nano-USD (1,000,000,000 = $1).

      • creditsnumber

        Credits drawn (the charged part; 1 credit = 1 cent).

      • tool_chargesobject

        Paid tool charges per tool key, nano-USD; parts of the cost.

      • inferredboolean

        Inferred from traffic; its timing is an estimate.

      • flattenedboolean

        Present when the node sat deeper than 128 levels and was placed beside its ancestor at that depth.

      • childrenarray<object>required
  • 400

    An unknown parameter or value, a parameter or value this API no longer takes, a repeated tag key, a bad range, an edited cursor, or a cursor sent with a different query. code names it (unknown_parameter, parameter_removed, invalid_filter, invalid_cursor, cursor_mismatch, range_too_wide, invalid_limit). A parameter_removed message names what to send instead.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 401

    Missing, unknown or revoked API key.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 404

    No session with this id in the organization (session_not_found).

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 422

    Too broad to read in time (query_too_broad). Narrow the window or add a filter.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 429

    Too many reads. rate_limited: this organization's API-key reads of the request log are over about 10 per second (burst 30) or 4 in flight on one server (sessions are not limited). build_capacity: the shared analytics read slots are busy. Retry after Retry-After.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 503

    This deployment has no observability store (observability_unavailable), or the store could not answer (trace_store_error). Retry shortly.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

Request

curl 'https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/sessions/run-42/tree' \
  -H "Authorization: Bearer <YOUR_API_KEY>"

Response

{
  "session_id": "run-42",
  "t0": "2026-11-18T14:20:01Z",
  "node_count": 2,
  "truncated": false,
  "roots": [
    {
      "id": "req_01JD8ZK4M2Q7V9X3N5T6B8C0EF",
      "kind": "request",
      "trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
      "name": "plan",
      "start_ms": 0,
      "started_at": "2026-11-18T14:20:01Z",
      "duration_ms": 2140,
      "status": "completed",
      "failure_class": null,
      "model": "gpt-6-luna",
      "path": "/plan",
      "api_key_id": null,
      "ttft_ms": 410,
      "input_tokens": 1200,
      "output_tokens": 300,
      "cached_input_tokens": 0,
      "cost_nano_usd": 1284000,
      "credits": 0.1284,
      "tool_charges": {},
      "inferred": false,
      "children": [
        {
          "id": "t-1",
          "kind": "tool",
          "trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
          "name": "lookup_order",
          "start_ms": 2150,
          "started_at": "2026-11-18T14:20:03.150Z",
          "duration_ms": 310,
          "status": "completed",
          "failure_class": null,
          "model": null,
          "path": null,
          "api_key_id": null,
          "ttft_ms": null,
          "input_tokens": 0,
          "output_tokens": 0,
          "cached_input_tokens": 0,
          "cost_nano_usd": 0,
          "credits": 0,
          "tool_charges": {},
          "inferred": true,
          "children": []
        }
      ]
    }
  ]
}

https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/sessions/run-42/tree