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

# Get Experiment Stats

> Fetches aggregated stats for every root-level trace log in an experiment.



## OpenAPI

````yaml get /api/parea/v1/experiment/{experiment_uuid}/stats
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security: []
paths:
  /api/parea/v1/experiment/{experiment_uuid}/stats:
    get:
      summary: Get Experiment Stats Api
      description: >-
        Fetches aggregated stats for every root-level trace log in an
        experiment.
      operationId: >-
        get_experiment_stats_api_api_parea_v1_experiment__experiment_uuid__stats_get
      parameters:
        - name: experiment_uuid
          in: path
          required: true
          schema:
            type: string
            title: Experiment Uuid
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExperimentStatsSchema'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
        - APIKeyHeader: []
        - APIKeyHeader: []
components:
  schemas:
    ExperimentStatsSchema:
      properties:
        parent_trace_stats:
          items:
            $ref: '#/components/schemas/TraceStatsSchema'
          type: array
          title: Parent Trace Stats
          description: Stats of root-level trace logs of an experiment
      type: object
      required:
        - parent_trace_stats
      title: ExperimentStatsSchema
      description: Contains aggregated stats of all root trace logs of an experiment.
      examples:
        - parent_trace_stats:
            - cost: 0.5
              input_tokens: 100
              latency: 0.5
              output_tokens: 200
              scores:
                - name: accuracy
                  score: 0.5
              total_tokens: 300
              trace_id: sasdc-csd-rnFesaeCpqcXJ_yL3wi
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TraceStatsSchema:
      properties:
        trace_id:
          type: string
          title: Trace Id
          description: UUID of top-level trace log
        latency:
          anyOf:
            - type: number
            - type: 'null'
          title: Latency
          description: Latency of this log in seconds.
          default: 0
        input_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Input Tokens
          description: Number of input tokens for all LLM calls in trace (incl. children).
          default: 0
        output_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Output Tokens
          description: Number of output tokens for all LLM calls in trace (incl. children).
          default: 0
        total_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total Tokens
          description: Total number of tokens for all LLM calls in trace (incl. children).
          default: 0
        cost:
          anyOf:
            - type: number
            - type: 'null'
          title: Cost
          description: Total cost of all LLM calls in trace (incl. children).
        scores:
          anyOf:
            - items:
                $ref: '#/components/schemas/EvaluationScoreSchema'
              type: array
            - type: 'null'
          title: Scores
          description: Scores of all logs in trace (incl. children).
      type: object
      required:
        - trace_id
      title: TraceStatsSchema
      description: Aggregates stats for a trace and its children.
      examples:
        - cost: 0.5
          input_tokens: 100
          latency: 0.5
          output_tokens: 200
          scores:
            - name: accuracy
              score: 0.5
          total_tokens: 300
          trace_id: sasdc-csd-rnFesaeCpqcXJ_yL3wi
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    EvaluationScoreSchema:
      properties:
        name:
          type: string
          title: Name
          description: Name of the score / evaluation
        score:
          type: number
          title: Score
          description: Value of the score
        evaluation_metric_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Evaluation Metric Id
          description: >-
            Will be automatically populated if this score was from a deployed
            evaluation metric.
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
          description: Reason for this score
      type: object
      required:
        - name
        - score
      title: EvaluationScoreSchema
      examples:
        - name: Answer Matches Target
          reason: The answer is mostly correct but lacks aspect A & B.
          score: 0.8
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-user-id

````