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

# List trace spans

> Returns spans for a ready trace.



## OpenAPI

````yaml https://api.uselemma.ai/openapi.json get /traces/{trace_id}/spans
openapi: 3.1.0
info:
  title: Lemma Platform API
  description: Lemma Platform HTTP API for AI observability and workspace operations.
  version: 0.1.0
servers:
  - url: https://api.uselemma.ai
    description: Lemma production API
security:
  - bearerAuth: []
paths:
  /traces/{trace_id}/spans:
    get:
      tags:
        - Traces
      summary: List trace spans
      description: Returns spans for a ready trace.
      operationId: list_trace_spans
      parameters:
        - schema:
            type: string
          in: path
          name: trace_id
          required: true
      responses:
        '200':
          description: Trace spans
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    otel_span_id:
                      type: string
                    parent_otel_span_id:
                      type:
                        - string
                        - 'null'
                    name:
                      type: string
                    kind:
                      type:
                        - string
                        - 'null'
                    start_time_ns:
                      type:
                        - string
                        - 'null'
                    end_time_ns:
                      type:
                        - string
                        - 'null'
                    duration_ms:
                      type:
                        - number
                        - 'null'
                    status_code:
                      type:
                        - string
                        - 'null'
                    status_description:
                      type:
                        - string
                        - 'null'
                    input_tokens:
                      type:
                        - number
                        - 'null'
                    output_tokens:
                      type:
                        - number
                        - 'null'
                    model_name:
                      type:
                        - string
                        - 'null'
                    tps:
                      type:
                        - number
                        - 'null'
                    attributes:
                      type: object
                      additionalProperties: {}
                    events: {}
                  required:
                    - id
                    - otel_span_id
                    - parent_otel_span_id
                    - name
                    - kind
                    - start_time_ns
                    - end_time_ns
                    - duration_ms
                    - status_code
                    - status_description
                    - input_tokens
                    - output_tokens
                    - model_name
                    - tps
                  additionalProperties: false
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                  code:
                    type: string
                required:
                  - detail
                additionalProperties: false
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````