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

# Log run batch

> Log a batch of metrics, params, and tags for a run.
If any data failed to be persisted, the server will respond with an error (non-200 status code).
In case of error (due to internal server error or an invalid request), partial data may be written.

You can write metrics, params, and tags in interleaving fashion, but within a given entity type are guaranteed to follow the order specified in the request body. That is, for an API request like
.. code-block:: json


  {
     "run_id": "2a14ed5c6a87499199e0106c3501eab8",
     "metrics": [
       {"key": "mae", "value": 2.5, "timestamp": 1552550804},
       {"key": "rmse", "value": 2.7, "timestamp": 1552550804},
     ],
     "params": [
       {"key": "model_class", "value": "LogisticRegression"},
     ]
  }

the server is guaranteed to write metric "rmse" after "mae", though it may write param
"model_class" before both metrics, after "mae", or after both metrics.

The overwrite behavior for metrics, params, and tags is as follows:

- Metrics: metric values are never overwritten. Logging a metric (key, value, timestamp) appends to the set of values for the metric with the provided key.

- Tags: tag values can be overwritten by successive writes to the same tag key. That is, if multiple tag values with the same key are provided in the same API request, the last-provided tag value is written. Logging the same tag (key, value) is permitted - that is, logging a tag is idempotent.

- Params: once written, param values cannot be changed (attempting to overwrite a param value will result in an error). However, logging the same param (key, value) is permitted - that is, logging a param is idempotent.

Request Limits
--------------
A single JSON-serialized API request may be up to 1 MB in size and contain:

- No more than 1000 metrics, params, and tags in total
- Up to 1000 metrics
- Up to 100 params
- Up to 100 tags

For example, a valid request might contain 900 metrics, 50 params, and 50 tags, but logging
900 metrics, 50 params, and 51 tags is invalid. The following limits also apply
to metric, param, and tag keys and values:

- Metric, param, and tag keys can be up to 250 characters in length
- Param and tag values can be up to 250 characters in length



## OpenAPI

````yaml /api-specs/cloud/public-api.json post /api/2.0/mlflow/runs/log-batch
openapi: 3.0.3
info:
  title: Domino Public API
  description: Reference for Domino's public REST API endpoints.
  version: 6.4.0
  x-catalog-key: nucleus
servers:
  - url: https://mycluster.domino.tech
    description: >-
      Replace 'mycluster.domino.tech' with your Domino cluster hostname. For
      Domino Cloud customers, that is `your-subdomain`.domino.tech (e.g.,
      acme.domino.tech). For self-hosted deployments, it is the hostname you
      reach the Domino UI at.
security: []
tags:
  - name: Projects
  - name: Project templates
  - name: Workspaces
  - name: Jobs
  - name: HPC Jobs
  - name: Environments
  - name: Hardware Tiers
  - name: Datasets
  - name: Data Sources
  - name: GenAI
  - name: AI Systems
  - name: MLflow experiments and runs
  - name: MLflow models
  - name: MLflow artifacts
  - name: MLflow traces
  - name: Apps
  - name: App versions
  - name: App instances
  - name: Model APIs
  - name: Registered models
  - name: Model deployment
  - name: Extensions
  - name: Cost and billing
  - name: Users and organizations
  - name: Service accounts
  - name: Personal Access Tokens
  - name: Personal Access Tokens (admin)
  - name: Audit Trail
  - name: Custom metrics
  - name: PPM
  - name: Model Monitoring models
  - name: Model Monitoring drift and quality
  - name: Model Monitoring settings
  - name: Model Monitoring authentication
  - name: Governance bundles
  - name: Governance policies
  - name: Governance evidence and results
  - name: Governance operations
  - name: NetApp Volumes
  - name: NetApp Volumes snapshots
  - name: NetApp Volumes filesystems
  - name: NetApp Volumes transfers
  - name: Tags
  - name: Properties
externalDocs:
  description: OpenAPI
  url: https://swagger.io/resources/open-api/
paths:
  /api/2.0/mlflow/runs/log-batch:
    post:
      tags:
        - MLflow experiments and runs
      description: >-
        Log a batch of metrics, params, and tags for a run.

        If any data failed to be persisted, the server will respond with an
        error (non-200 status code).

        In case of error (due to internal server error or an invalid request),
        partial data may be written.


        You can write metrics, params, and tags in interleaving fashion, but
        within a given entity type are guaranteed to follow the order specified
        in the request body. That is, for an API request like

        .. code-block:: json


          {
             "run_id": "2a14ed5c6a87499199e0106c3501eab8",
             "metrics": [
               {"key": "mae", "value": 2.5, "timestamp": 1552550804},
               {"key": "rmse", "value": 2.7, "timestamp": 1552550804},
             ],
             "params": [
               {"key": "model_class", "value": "LogisticRegression"},
             ]
          }

        the server is guaranteed to write metric "rmse" after "mae", though it
        may write param

        "model_class" before both metrics, after "mae", or after both metrics.


        The overwrite behavior for metrics, params, and tags is as follows:


        - Metrics: metric values are never overwritten. Logging a metric (key,
        value, timestamp) appends to the set of values for the metric with the
        provided key.


        - Tags: tag values can be overwritten by successive writes to the same
        tag key. That is, if multiple tag values with the same key are provided
        in the same API request, the last-provided tag value is written. Logging
        the same tag (key, value) is permitted - that is, logging a tag is
        idempotent.


        - Params: once written, param values cannot be changed (attempting to
        overwrite a param value will result in an error). However, logging the
        same param (key, value) is permitted - that is, logging a param is
        idempotent.


        Request Limits

        --------------

        A single JSON-serialized API request may be up to 1 MB in size and
        contain:


        - No more than 1000 metrics, params, and tags in total

        - Up to 1000 metrics

        - Up to 100 params

        - Up to 100 tags


        For example, a valid request might contain 900 metrics, 50 params, and
        50 tags, but logging

        900 metrics, 50 params, and 51 tags is invalid. The following limits
        also apply

        to metric, param, and tag keys and values:


        - Metric, param, and tag keys can be up to 250 characters in length

        - Param and tag values can be up to 250 characters in length
      operationId: runs.LogBatch
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/mlflow-proxy_LogBatchRequest'
      responses:
        '200':
          description: Run batch logged successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/mlflow-proxy_LogBatchResponse'
        default:
          $ref: '#/components/responses/mlflow-proxy_MLflowNativeError'
components:
  schemas:
    mlflow-proxy_LogBatchRequest:
      properties:
        metrics:
          description: >-
            Metrics to log. A single request can contain up to 1000 metrics, and
            up to 1000

            metrics, params, and tags in total.
          items:
            $ref: '#/components/schemas/mlflow-proxy_Metric'
          type: array
        params:
          description: >-
            Params to log. A single request can contain up to 100 params, and up
            to 1000

            metrics, params, and tags in total.
          items:
            $ref: '#/components/schemas/mlflow-proxy_Param'
          type: array
        run_id:
          description: ID of the run to log under
          type: string
        tags:
          description: >-
            Tags to log. A single request can contain up to 100 tags, and up to
            1000

            metrics, params, and tags in total.
          items:
            $ref: '#/components/schemas/mlflow-proxy_Tag'
          type: array
      required:
        - run_id
      type: object
    mlflow-proxy_LogBatchResponse:
      properties: {}
      type: object
    mlflow-proxy_Metric:
      properties:
        key:
          description: Key identifying this metric.
          type: string
        step:
          default: '0'
          description: Step at which to log the metric.
          type: integer
          format: int64
        timestamp:
          description: The timestamp at which this metric was recorded.
          oneOf:
            - format: int64
              type: integer
            - type: string
        value:
          description: Value associated with this metric.
          oneOf:
            - format: double
              type: number
            - type: string
      required:
        - key
        - value
        - step
        - timestamp
      type: object
    mlflow-proxy_Param:
      properties:
        key:
          description: Key identifying this param.
          type: string
        value:
          description: Value associated with this param.
          type: string
      required:
        - key
        - value
      type: object
    mlflow-proxy_Tag:
      properties:
        key:
          description: >-
            Name of the tag. Maximum size depends on storage backend.

            If a tag with this name already exists, its preexisting value will
            be replaced by the specified value. All storage backends are
            guaranteed to support key values up to 250 bytes in size. This field
            is required.
          type: string
        value:
          description: >-
            String value of the tag being logged. Maximum size depends on
            storage backend.

            All storage backends are guaranteed to support key values up to 5000
            bytes in size. This field is required.
          type: string
      required:
        - key
        - value
      type: object
    mlflow-proxy_ErrorResponse:
      properties:
        error_code:
          $ref: '#/components/schemas/mlflow-proxy_ErrorCode'
        message:
          description: Error message
          type: string
      required:
        - error_code
        - message
      type: object
    mlflow-proxy_ErrorCode:
      description: Error code
      enum:
        - INTERNAL_ERROR
        - INVALID_STATE
        - DATA_LOSS
        - NOT_IMPLEMENTED
        - TEMPORARILY_UNAVAILABLE
        - DEADLINE_EXCEEDED
        - CANCELLED
        - RESOURCE_EXHAUSTED
        - REQUEST_LIMIT_EXCEEDED
        - ABORTED
        - RESOURCE_CONFLICT
        - ALREADY_EXISTS
        - NOT_FOUND
        - ENDPOINT_NOT_FOUND
        - RESOURCE_DOES_NOT_EXIST
        - PERMISSION_DENIED
        - CUSTOMER_UNAUTHORIZED
        - UNAUTHENTICATED
        - BAD_REQUEST
        - RESOURCE_ALREADY_EXISTS
        - INVALID_PARAMETER_VALUE
      type: string
  responses:
    mlflow-proxy_MLflowNativeError:
      description: The client issued a bad request to the server
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/mlflow-proxy_ErrorResponse'

````

## Related topics

- [Run batch jobs](/cloud/platform-capabilities/features/llms/llm-gateway/batch-jobs.md)
- [Track and monitor experiments](/cloud/platform-capabilities/features/development/track-monitor.md)
- [Configure batch scoring Job](/cloud/platform-capabilities/features/models/batch-scoring.md)
- [View Project spend](/cloud/admin/operations/control-center/view-project-spend.md)
