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

# Ingest Metrics

> Log metric records for a run. Retrying the same body is safe.

202 once the upload is validated and queued; its points are readable once
the worker has stored them, usually within seconds.



## OpenAPI

````yaml https://api.primeintellect.ai/openapi.json post /api/v1/metrics
openapi: 3.1.0
info:
  title: PI API
  version: 0.1.0
servers:
  - url: https://api.primeintellect.ai
security: []
paths:
  /api/v1/metrics:
    post:
      tags:
        - metrics
      summary: Ingest Metrics
      description: >-
        Log metric records for a run. Retrying the same body is safe.


        202 once the upload is validated and queued; its points are readable
        once

        the worker has stored them, usually within seconds.
      operationId: ingest_metrics_api_v1_metrics_post
      requestBody:
        content:
          application/json:
            schema:
              properties:
                run_id:
                  type: string
                  minLength: 1
                  title: Run Id
                producer:
                  type: string
                  title: Producer
                  default: ''
                records:
                  items:
                    additionalProperties: true
                    type: object
                    description: >-
                      One `log_metrics` call: required `_timestamp` (Unix
                      seconds, when it was logged), optional `step`
                      (non-negative int), plus metric keys. Numbers and bools
                      are stored; nested objects are flattened with `/`; other
                      values are dropped and counted.
                    example:
                      _timestamp: 1760300000.1
                      loss: 0.41
                      step: 120
                  type: array
                  title: Records
              additionalProperties: false
              type: object
              required:
                - run_id
                - records
              title: MetricsUpload
        required: true
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricsAccepted'
        '401':
          description: Authorization failed
        '422':
          description: Invalid request data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    MetricsAccepted:
      properties:
        accepted_points:
          type: integer
          title: Accepted Points
        dropped_non_numeric:
          type: integer
          title: Dropped Non Numeric
          default: 0
      type: object
      required:
        - accepted_points
      title: MetricsAccepted
    ErrorResponse:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Errors
      type: object
      required:
        - errors
      title: ErrorResponse
    ErrorDetail:
      properties:
        param:
          type: string
          title: Param
        details:
          type: string
          title: Details
      type: object
      required:
        - param
        - details
      title: ErrorDetail
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````

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