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

# List Trace Sessions

> Retrieve traces grouped by referenceId with aggregated metrics.



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/avido/openapi.documented.yml get /v0/traces/sessions
openapi: 3.1.1
info:
  title: Avido API
  description: >-
    Avido's API for LLM usage events, tool calls, trace management, webhook
    validation, and more. See each endpoint's request/response schema for
    details.
  version: 0.1.0
  contact:
    name: Avido Support
    email: support@avidoai.com
    url: https://avidoai.com/support
servers:
  - url: https://api.avidoai.com
    description: Production API
security:
  - ApiKey: []
    ApplicationId: []
paths:
  /v0/traces/sessions:
    get:
      tags:
        - Traces
      summary: List Trace Sessions
      description: Retrieve traces grouped by referenceId with aggregated metrics.
      operationId: listTraceSessions
      parameters:
        - in: query
          name: skip
          schema:
            description: Number of items to skip before starting to collect the result set.
            example: 0
            default: 0
            type: integer
            minimum: 0
            maximum: 9007199254740991
          description: Number of items to skip before starting to collect the result set.
        - in: query
          name: limit
          schema:
            description: Number of items to include in the result set.
            example: 25
            type: integer
            minimum: 1
            maximum: 100
          description: Number of items to include in the result set.
      responses:
        '200':
          description: Successfully retrieved trace sessions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedTraceSessionResponse'
        '400':
          description: bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '500':
          description: internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    PaginatedTraceSessionResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/TraceSessionOutput'
        pagination:
          type: object
          properties:
            skip:
              type: integer
              minimum: 0
              maximum: 9007199254740991
              description: Number of items skipped.
              example: 0
            limit:
              type: integer
              minimum: 1
              maximum: 9007199254740991
              description: Number of items per page.
              example: 25
            total:
              type: integer
              minimum: 0
              maximum: 9007199254740991
              description: Total number of items available.
              example: 100
            totalPages:
              type: integer
              minimum: 0
              maximum: 9007199254740991
              description: Total number of pages available.
              example: 4
            totalCount:
              description: >-
                Total number of items without filters applied. Used to
                distinguish between truly empty results and empty filtered
                results.
              example: 100
              type: integer
              minimum: 0
              maximum: 9007199254740991
          required:
            - skip
            - limit
            - total
            - totalPages
          additionalProperties: false
          title: PaginationResponse
          description: Pagination metadata returned in a paginated response.
      required:
        - data
        - pagination
      additionalProperties: false
      title: Paginated Trace Sessions
      description: Paginated response containing trace sessions
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: A human-readable error message explaining the error.
          example: Resource not found
      required:
        - message
      additionalProperties: false
      title: ErrorResponse
      description: Standard error format for failed API operations.
    ValidationErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: A human-readable error message indicating what went wrong.
          example: Invalid request data
        issues:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
              message:
                type: string
              path:
                type: array
                items:
                  type: string
            required:
              - code
              - message
              - path
            additionalProperties: false
          description: Array of detailed validation error objects.
          example:
            - code: invalid_string
              message: Invalid UUID
              path:
                - id
      required:
        - message
        - issues
      additionalProperties: false
      title: ValidationErrorResponse
      description: Details about validation errors in incoming requests.
    TraceSessionOutput:
      type: object
      properties:
        referenceId:
          type: string
          description: The reference identifier grouping multiple traces.
          example: ref-abc-123
        traceCount:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
          description: Number of traces in this session.
          example: 5
        firstSeen:
          description: Timestamp of the earliest trace in this session.
          example: '2025-01-05T12:00:00.000Z'
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        lastSeen:
          description: Timestamp of the latest trace in this session.
          example: '2025-01-05T12:34:56.789Z'
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        totalCost:
          anyOf:
            - type: number
            - type: 'null'
          description: Total cost across all traces in this session.
          example: 0.05
        totalPromptTokens:
          anyOf:
            - type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            - type: 'null'
          description: Total prompt tokens across all traces in this session.
          example: 500
        totalCompletionTokens:
          anyOf:
            - type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            - type: 'null'
          description: Total completion tokens across all traces in this session.
          example: 300
        hasError:
          type: boolean
          description: Whether any trace in this session has an error.
          example: false
      required:
        - referenceId
        - traceCount
        - firstSeen
        - lastSeen
        - totalCost
        - totalPromptTokens
        - totalCompletionTokens
        - hasError
      additionalProperties: false
      title: TraceSession
      description: A grouped view of traces sharing the same reference identifier.
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Your unique Avido API key
    ApplicationId:
      type: apiKey
      in: header
      name: x-application-id
      description: Your unique Avido Application ID

````