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

# List Traces

> List recent traces for the caller's project (newest first).

Offline-evaluation traces are excluded by default; pass
``include_evaluations=true`` to include them.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/public/traces
openapi: 3.1.0
info:
  title: TraceRoot Public API
  version: 0.1.0
servers:
  - description: TraceRoot Cloud
    url: https://app.traceroot.ai
  - description: Self-hosted
    url: '{baseUrl}'
    variables:
      baseUrl:
        default: http://localhost:8000
        description: Your TraceRoot backend URL
security: []
paths:
  /api/v1/public/traces:
    get:
      tags:
        - Traces
      summary: List Traces
      description: |-
        List recent traces for the caller's project (newest first).

        Offline-evaluation traces are excluded by default; pass
        ``include_evaluations=true`` to include them.
      operationId: list_traces
      parameters:
        - description: Items per page
          in: query
          name: limit
          required: false
          schema:
            default: 50
            description: Items per page
            maximum: 200
            minimum: 1
            title: Limit
            type: integer
        - description: Only traces that started at or after this time (inclusive, ISO 8601)
          in: query
          name: start_after
          required: false
          schema:
            anyOf:
              - format: date-time
                type: string
              - type: 'null'
            description: >-
              Only traces that started at or after this time (inclusive, ISO
              8601)
            title: Start After
        - description: Only traces that started before this time (exclusive, ISO 8601)
          in: query
          name: end_before
          required: false
          schema:
            anyOf:
              - format: date-time
                type: string
              - type: 'null'
            description: Only traces that started before this time (exclusive, ISO 8601)
            title: End Before
        - description: >-
            Include traces produced by offline-evaluation runs. Excluded by
            default so evaluation runs do not appear in the production trace
            list.
          in: query
          name: include_evaluations
          required: false
          schema:
            default: false
            description: >-
              Include traces produced by offline-evaluation runs. Excluded by
              default so evaluation runs do not appear in the production trace
              list.
            title: Include Evaluations
            type: boolean
        - description: Filter by trace name (substring match)
          in: query
          name: name
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by trace name (substring match)
            title: Name
        - description: Filter by the user id recorded on the trace
          in: query
          name: user_id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by the user id recorded on the trace
            title: User Id
        - description: Search across trace_id, name, session_id, user_id
          in: query
          name: search_query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Search across trace_id, name, session_id, user_id
            title: Search Query
        - content:
            application/json:
              schema:
                items:
                  anyOf:
                    - additionalProperties: false
                      properties:
                        field:
                          const: trace_id
                          title: Trace ID
                          type: string
                        op:
                          enum:
                            - eq
                            - contains
                          type: string
                        value:
                          maxLength: 1024
                          minLength: 1
                          type: string
                      required:
                        - field
                        - op
                        - value
                      type: object
                    - additionalProperties: false
                      properties:
                        field:
                          const: signal_id
                          title: Signal ID
                          type: string
                        op:
                          enum:
                            - eq
                          type: string
                        value:
                          maxLength: 1024
                          minLength: 1
                          type: string
                      required:
                        - field
                        - op
                        - value
                      type: object
                    - additionalProperties: false
                      properties:
                        field:
                          const: model_name
                          title: Model
                          type: string
                        op:
                          enum:
                            - in
                          type: string
                        value:
                          items:
                            maxLength: 1024
                            type: string
                          minItems: 1
                          type: array
                      required:
                        - field
                        - op
                        - value
                      type: object
                    - additionalProperties: false
                      properties:
                        field:
                          const: environment
                          title: Environment
                          type: string
                        op:
                          enum:
                            - in
                          type: string
                        value:
                          items:
                            maxLength: 1024
                            type: string
                          minItems: 1
                          type: array
                      required:
                        - field
                        - op
                        - value
                      type: object
                    - additionalProperties: false
                      properties:
                        field:
                          const: span_kind
                          title: Span kind
                          type: string
                        op:
                          enum:
                            - in
                          type: string
                        value:
                          items:
                            maxLength: 1024
                            type: string
                          minItems: 1
                          type: array
                      required:
                        - field
                        - op
                        - value
                      type: object
                    - additionalProperties: false
                      properties:
                        field:
                          const: status
                          title: Status
                          type: string
                        op:
                          enum:
                            - in
                          type: string
                        value:
                          items:
                            maxLength: 1024
                            type: string
                          minItems: 1
                          type: array
                      required:
                        - field
                        - op
                        - value
                      type: object
                    - additionalProperties: false
                      properties:
                        field:
                          const: error_type
                          title: Error type
                          type: string
                        op:
                          enum:
                            - in
                          type: string
                        value:
                          items:
                            maxLength: 1024
                            type: string
                          minItems: 1
                          type: array
                      required:
                        - field
                        - op
                        - value
                      type: object
                    - additionalProperties: false
                      properties:
                        field:
                          const: name
                          title: Span name
                          type: string
                        op:
                          enum:
                            - in
                          type: string
                        value:
                          items:
                            maxLength: 1024
                            type: string
                          minItems: 1
                          type: array
                      required:
                        - field
                        - op
                        - value
                      type: object
                    - additionalProperties: false
                      properties:
                        field:
                          const: cost
                          title: Cost
                          type: string
                        op:
                          enum:
                            - eq
                            - gt
                            - gte
                            - lt
                            - lte
                          type: string
                        value:
                          maximum: 999999999
                          minimum: 0
                          type: number
                      required:
                        - field
                        - op
                        - value
                      type: object
                    - additionalProperties: false
                      properties:
                        field:
                          const: total_tokens
                          title: Tokens
                          type: string
                        op:
                          enum:
                            - eq
                            - gt
                            - gte
                            - lt
                            - lte
                          type: string
                        value:
                          maximum: 9223372036854776000
                          minimum: 0
                          type: integer
                      required:
                        - field
                        - op
                        - value
                      type: object
                    - additionalProperties: false
                      properties:
                        field:
                          const: duration_ms
                          title: Latency
                          type: string
                        op:
                          enum:
                            - eq
                            - gt
                            - gte
                            - lt
                            - lte
                          type: string
                        value:
                          maximum: 9223372036854776000
                          minimum: 0
                          type: integer
                      required:
                        - field
                        - op
                        - value
                      type: object
                    - additionalProperties: false
                      properties:
                        field:
                          const: errors
                          title: Errors
                          type: string
                        op:
                          enum:
                            - eq
                            - gt
                            - gte
                            - lt
                            - lte
                          type: string
                        value:
                          maximum: 18446744073709552000
                          minimum: 0
                          type: integer
                      required:
                        - field
                        - op
                        - value
                      type: object
                    - additionalProperties: false
                      properties:
                        field:
                          const: metadata
                          title: Metadata
                          type: string
                        key:
                          description: Which metadata key the value is compared against
                          maxLength: 256
                          minLength: 1
                          type: string
                        op:
                          enum:
                            - eq
                            - contains
                          type: string
                        value:
                          maxLength: 1024
                          minLength: 1
                          type: string
                      required:
                        - field
                        - key
                        - op
                        - value
                      type: object
                maxItems: 20
                type: array
          description: >-
            JSON array of typed filter predicates ({field, op, value}); the
            field catalog and per-field operators are defined in the schema
          in: query
          name: filters
          required: false
        - description: >-
            Target project for the request. Required when authenticating with a
            user session token (a user credential is only meaningful scoped to a
            project); for an API key it is optional and, if given, must match
            the key's project.
          in: query
          name: project_id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Target project for the request. Required when authenticating with
              a user session token (a user credential is only meaningful scoped
              to a project); for an API key it is optional and, if given, must
              match the key's project.
            title: Project Id
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicTraceListResponse'
          description: Successful Response
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Invalid filters parameter
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Authentication failed
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Failed to list traces
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Authentication service unavailable
      security:
        - BearerAuth: []
components:
  schemas:
    PublicTraceListResponse:
      description: Paginated list of traces for the public API.
      properties:
        data:
          items:
            $ref: '#/components/schemas/PublicTraceListItem'
          title: Data
          type: array
        meta:
          $ref: '#/components/schemas/PaginationMeta'
      required:
        - data
        - meta
      title: PublicTraceListResponse
      type: object
    ErrorResponse:
      description: >-
        The canonical public error envelope (matches the gateway's normalized
        shape).
      properties:
        detail:
          title: Detail
          type: string
      required:
        - detail
      title: ErrorResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    PublicTraceListItem:
      description: A trace list item plus a backend-built link to its UI detail view.
      properties:
        duration_ms:
          anyOf:
            - type: number
            - type: 'null'
          title: Duration Ms
        error_count:
          title: Error Count
          type: integer
        input:
          anyOf:
            - type: string
            - type: 'null'
          title: Input
        metadata_map:
          additionalProperties:
            type: string
          default: {}
          title: Metadata Map
          type: object
        name:
          title: Name
          type: string
        output:
          anyOf:
            - type: string
            - type: 'null'
          title: Output
        project_id:
          title: Project Id
          type: string
        session_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Session Id
        span_count:
          title: Span Count
          type: integer
        total_cost:
          anyOf:
            - type: number
            - type: 'null'
          default: 0
          title: Total Cost
        total_input_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          default: 0
          title: Total Input Tokens
        total_output_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          default: 0
          title: Total Output Tokens
        trace_id:
          title: Trace Id
          type: string
        trace_start_time:
          format: date-time
          title: Trace Start Time
          type: string
        trace_url:
          title: Trace Url
          type: string
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
      required:
        - trace_id
        - project_id
        - name
        - trace_start_time
        - user_id
        - session_id
        - span_count
        - duration_ms
        - error_count
        - input
        - output
        - trace_url
      title: PublicTraceListItem
      type: object
    PaginationMeta:
      description: Pagination metadata for list responses.
      properties:
        limit:
          title: Limit
          type: integer
        page:
          title: Page
          type: integer
        total:
          title: Total
          type: integer
      required:
        - page
        - limit
        - total
      title: PaginationMeta
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    BearerAuth:
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.