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

# Query metrics from a run

> Returns time-series metrics from ClickHouse. Supports filtering by metric name, group, and step range. Uses reservoir sampling to limit data points.



## OpenAPI

````yaml /pluto/api-reference/openapi.json get /api/runs/metrics
openapi: 3.0.0
info:
  title: mlop API
  version: 1.0.0
  description: API for mlop - ML experiment tracking platform
servers:
  - url: https://pluto-api.trainy.ai
    description: API Server
security:
  - bearerAuth: []
paths:
  /api/runs/metrics:
    get:
      tags:
        - Runs
      summary: Query metrics from a run
      description: >-
        Returns time-series metrics from ClickHouse. Supports filtering by
        metric name, group, and step range. Uses reservoir sampling to limit
        data points.
      parameters:
        - schema:
            type: number
            nullable: true
            description: Numeric run ID
          required: false
          name: runId
          in: query
        - schema:
            type: string
            description: Project name
          required: true
          name: projectName
          in: query
        - schema:
            type: string
            description: Filter by metric name (e.g., train/loss)
          required: false
          name: logName
          in: query
        - schema:
            type: string
            description: Filter by metric group (e.g., train)
          required: false
          name: logGroup
          in: query
        - schema:
            type: number
            minimum: 1
            maximum: 10000
            default: 2000
            description: Maximum data points to return
          required: false
          name: limit
          in: query
        - schema:
            type: integer
            nullable: true
            minimum: 0
            description: >-
              Minimum step number (inclusive). Use with stepMax to query a
              specific range of steps.
          required: false
          name: stepMin
          in: query
        - schema:
            type: integer
            nullable: true
            minimum: 0
            description: >-
              Maximum step number (inclusive). Use with stepMin to query a
              specific range of steps.
          required: false
          name: stepMax
          in: query
      responses:
        '200':
          description: Metrics data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryMetricsResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    QueryMetricsResponse:
      type: object
      properties:
        metrics:
          type: array
          items:
            type: object
            properties:
              logName:
                type: string
              logGroup:
                type: string
              time:
                type: string
              step:
                type: number
              value:
                type: number
            required:
              - logName
              - logGroup
              - time
              - step
              - value
      required:
        - metrics
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key obtained from the mlop dashboard

````