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

# List span summaries for a trace

> List payload-free structural span summaries for rendering a trace tree.

Use this endpoint to build and navigate the hierarchy without downloading
each span's input, output, or metadata; fetch a selected span's full payload
from GET /v5/traces/{trace_id}/spans/{span_id}. Pages contain at most 100
summaries in ascending start-time order. Both ClickHouse- and Postgres-backed
reads return service-issued opaque continuation cursors. The cursors are
mutually exclusive, and supplying both returns 422. Reads are authorized
against the requested trace.



## OpenAPI

````yaml https://api.sgp.scale.com/openapi-versions/v5/openapi.json get /v5/traces/{trace_id}/spans
openapi: 3.1.0
info:
  title: EGP API V5
  description: >-
    This is the parent API for all EGP APIs. If you are looking for the EGP API,
    please go to https://api.egp.scale.com/docs.
  contact:
    name: Scale Generative AI Platform
    url: https://scale.com/genai-platform
  version: 0.1.0
servers:
  - url: https://api.egp.scale.com
security: []
paths:
  /v5/traces/{trace_id}/spans:
    get:
      tags:
        - Spans
      summary: List span summaries for a trace
      description: >-
        List payload-free structural span summaries for rendering a trace tree.


        Use this endpoint to build and navigate the hierarchy without
        downloading

        each span's input, output, or metadata; fetch a selected span's full
        payload

        from GET /v5/traces/{trace_id}/spans/{span_id}. Pages contain at most
        100

        summaries in ascending start-time order. Both ClickHouse- and
        Postgres-backed

        reads return service-issued opaque continuation cursors. The cursors are

        mutually exclusive, and supplying both returns 422. Reads are authorized

        against the requested trace.
      operationId: GET-V5-/v5/traces/trace_id/spans
      parameters:
        - name: trace_id
          in: path
          required: true
          schema:
            type: string
            title: Trace Id
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 100
            title: Limit
        - name: starting_after
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Starting After
        - name: ending_before
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Ending Before
        - name: x-selected-account-id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Account ID Header
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TraceSpanSummaryPage'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    TraceSpanSummaryPage:
      properties:
        object:
          type: string
          const: list
          title: Object
          default: list
        items:
          items:
            $ref: '#/components/schemas/SpanSummary'
          type: array
          title: Items
        limit:
          type: integer
          title: Limit
          description: The maximum number of items to return.
          default: 100
        has_more:
          type: boolean
          title: Has More
          description: Whether there are more items left to be fetched.
        next_cursor:
          title: Next Cursor
          type: string
        prev_cursor:
          title: Prev Cursor
          type: string
      type: object
      required:
        - items
        - has_more
      description: >-
        Bounded trace-tree page with service-issued opaque cursors when
        available.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SpanSummary:
      properties:
        id:
          type: string
          title: Id
        object:
          type: string
          const: span.summary
          title: Object
          default: span.summary
        trace_id:
          type: string
          maxLength: 256
          title: Trace Id
        parent_id:
          title: Parent Id
          type: string
        group_id:
          title: Group Id
          type: string
        name:
          type: string
          title: Name
        type:
          $ref: '#/components/schemas/ApplicationOperationType'
          default: STANDALONE
        status:
          $ref: '#/components/schemas/ApplicationOperationStatus'
          default: SUCCESS
        start_timestamp:
          type: string
          format: date-time
          title: Start Timestamp
        end_timestamp:
          title: End Timestamp
          type: string
          format: date-time
      type: object
      required:
        - id
        - trace_id
        - name
        - start_timestamp
      description: >-
        Payload-free structural projection, not generated or aggregated semantic
        content.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          title: Error Type
          type: string
        input:
          title: Input
        ctx:
          type: object
          title: Context
          additionalProperties: true
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ApplicationOperationType:
      type: string
      enum:
        - TEXT_INPUT
        - TEXT_OUTPUT
        - COMPLETION_INPUT
        - COMPLETION
        - KB_RETRIEVAL
        - KB_INPUT
        - RERANKING
        - EXTERNAL_ENDPOINT
        - PROMPT_ENGINEERING
        - DOCUMENT_INPUT
        - MAP_REDUCE
        - DOCUMENT_SEARCH
        - DOCUMENT_PROMPT
        - CUSTOM
        - CODE_EXECUTION
        - DATA_MANIPULATION
        - EVALUATION
        - FILE_RETRIEVAL
        - KB_ADD_CHUNK
        - KB_MANAGEMENT
        - GUARDRAIL
        - OUTPUT_GUARDRAIL
        - TRACER
        - AGENT_TRACER
        - AGENT_WORKFLOW
        - STANDALONE
      title: ApplicationOperationType
    ApplicationOperationStatus:
      type: string
      enum:
        - SUCCESS
        - ERROR
        - CANCELED
      title: ApplicationOperationStatus
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````