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

# Get traces

> Get a list of traces with filtering and pagination. See [Traces](https://docs.galtea.ai/sdk/api/trace/service).



## OpenAPI

````yaml https://api.galtea.ai/openapi.json get /traces
openapi: 3.0.0
info:
  version: 1.0.0
  title: Product Management Service API
  description: API documentation for Product Management Service
  contact:
    name: Galtea AI
servers:
  - url: https://api.galtea.ai
security:
  - bearerAuth: []
tags: []
externalDocs:
  description: Galtea Platform Documentation
  url: https://docs.galtea.ai
paths:
  /traces:
    get:
      tags:
        - traces
      summary: Get traces
      description: >-
        Get a list of traces with filtering and pagination. See
        [Traces](https://docs.galtea.ai/sdk/api/trace/service).
      operationId: getTraces
      parameters:
        - name: ids
          in: query
          style: form
          explode: true
          description: Filter by trace IDs
          schema:
            type: array
            items:
              type: string
        - name: inferenceResultIds
          in: query
          style: form
          explode: true
          description: Filter by inference result IDs
          schema:
            type: array
            items:
              type: string
        - name: sessionIds
          in: query
          style: form
          explode: true
          description: Filter by session IDs (via inference result relationship)
          schema:
            type: array
            items:
              type: string
        - name: types
          in: query
          style: form
          explode: true
          description: >-
            Filter by trace types (SPAN, GENERATION, EVENT, AGENT, TOOL, CHAIN,
            RETRIEVER, EVALUATOR, EMBEDDING, GUARDRAIL)
          schema:
            type: array
            items:
              type: string
              enum:
                - SPAN
                - GENERATION
                - EVENT
                - AGENT
                - TOOL
                - CHAIN
                - RETRIEVER
                - EVALUATOR
                - EMBEDDING
                - GUARDRAIL
        - name: names
          in: query
          style: form
          explode: true
          description: Filter by trace names
          schema:
            type: array
            items:
              type: string
        - name: sort
          in: query
          style: form
          explode: true
          description: Sort format createdAt,asc or createdAt,desc
          schema:
            type: array
            items:
              type: string
        - name: offset
          in: query
          description: Number of items to skip
          schema:
            type: integer
        - name: limit
          in: query
          description: Maximum number of items to return
          schema:
            type: integer
        - name: fromStartTime
          in: query
          description: Filter traces started at or after this timestamp (ISO 8601 format)
          schema:
            type: string
            format: date-time
        - name: toStartTime
          in: query
          description: Filter traces started at or before this timestamp (ISO 8601 format)
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: Traces retrieved successfully
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Trace'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    Trace:
      type: object
      properties:
        id:
          type: string
          example: trace_123
        inferenceResultId:
          type: string
          example: ir_123
        name:
          type: string
          example: fetch_user_data
        type:
          type: string
          enum:
            - SPAN
            - GENERATION
            - EVENT
            - AGENT
            - TOOL
            - CHAIN
            - RETRIEVER
            - EVALUATOR
            - EMBEDDING
            - GUARDRAIL
          nullable: true
          example: TOOL
        description:
          type: string
          nullable: true
          example: Fetches user data from the database by ID
          description: Human-readable description of the operation. Maximum 1MB.
        inputData:
          type: object
          nullable: true
          example:
            user_id: '123'
          description: Input parameters passed to the operation
        outputData:
          type: object
          nullable: true
          example:
            name: John Doe
            email: john@example.com
          description: Result returned by the operation
        error:
          type: string
          nullable: true
          example: Connection timeout
          description: Error message if failed
        latencyMs:
          type: number
          nullable: true
          example: 45.5
          description: Execution time in milliseconds
        metadata:
          type: object
          nullable: true
          example:
            model: gpt-4
            temperature: 0.7
          description: Additional custom metadata
        parentTraceId:
          type: string
          nullable: true
          example: trace_parent_123
          description: ID of parent trace for hierarchical relationships
        startTime:
          type: string
          format: date-time
          nullable: true
        endTime:
          type: string
          format: date-time
          nullable: true
        createdAt:
          type: string
          format: date-time
        deletedAt:
          type: string
          format: date-time
          nullable: true
    Error:
      type: object
      properties:
        error:
          type: string
          example: Error type
        message:
          type: string
          example: Error message description
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authorization. Pass your API key in the Authorization header as
        a Bearer token. Both new (`gsk_*`) and legacy (`gsk-`) API keys are
        accepted, e.g. `Authorization: Bearer gsk_...` or `Authorization: Bearer
        gsk-...`.

````