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

# Run evaluation

> Evaluate a retriever's quality using a ground truth dataset. Returns immediately with a task ID - evaluation runs asynchronously.



## OpenAPI

````yaml post /v1/retrievers/{retriever_id}/evaluations
openapi: 3.1.0
info:
  title: Mixpeek API
  description: >-
    This is the Mixpeek API, providing access to various endpoints for data
    processing and retrieval.
  termsOfService: https://mixpeek.com/terms
  contact:
    name: Mixpeek Support
    url: https://mixpeek.com/contact
    email: info@mixpeek.com
  version: '0.82'
servers:
  - url: https://api.mixpeek.com
    description: Production
security:
  - BearerAuth: []
paths:
  /v1/retrievers/{retriever_id}/evaluations:
    post:
      tags:
        - Retriever Evaluations
      summary: Run evaluation
      description: >-
        Evaluate a retriever's quality using a ground truth dataset. Returns
        immediately with a task ID - evaluation runs asynchronously.
      operationId: start_evaluation_v1_retrievers__retriever_id__evaluations_post
      parameters:
        - name: retriever_id
          in: path
          required: true
          schema:
            type: string
            title: Retriever Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StartEvaluationRequest'
        description: >-
          Keys this body does not declare are refused with 422 extra_forbidden
          naming the accepted keys (since 2026-11-02).
        x-unknown-keys:
          until: '2026-11-02'
          then: 422 extra_forbidden
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StartEvaluationResponse'
        '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'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
          NamespaceHeader: []
components:
  schemas:
    StartEvaluationRequest:
      properties:
        dataset_name:
          type: string
          minLength: 1
          title: Dataset Name
          description: Name of the evaluation dataset to use
        evaluation_config:
          anyOf:
            - $ref: '#/components/schemas/EvaluationConfig'
            - type: 'null'
          description: Optional evaluation configuration (uses defaults if not provided)
      type: object
      required:
        - dataset_name
      title: StartEvaluationRequest
      description: Request to start an evaluation.
    StartEvaluationResponse:
      properties:
        task_id:
          type: string
          title: Task Id
          description: Task ID for tracking progress
        evaluation_id:
          type: string
          title: Evaluation Id
          description: Evaluation ID
        task_type:
          type: string
          title: Task Type
          description: Task type
          default: retriever.evaluation
        status:
          type: string
          title: Status
          description: Initial status
          default: pending
        created_at:
          type: string
          title: Created At
          description: Creation timestamp
      type: object
      required:
        - task_id
        - evaluation_id
        - created_at
      title: StartEvaluationResponse
      description: Response when starting an evaluation.
    ErrorResponse:
      properties:
        success:
          type: boolean
          title: Success
          description: Always false for error responses
          default: false
        status:
          type: integer
          title: Status
          description: HTTP status code for this error
        error:
          $ref: '#/components/schemas/ErrorDetail'
          description: Error details payload
      type: object
      required:
        - status
        - error
      title: ErrorResponse
      description: Error response model.
      examples:
        - error:
            details:
              id: ns_123
              resource: namespace
            message: Namespace not found
            type: NotFoundError
          status: 404
          success: false
    EvaluationConfig:
      properties:
        k_values:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
          title: K Values
          description: K values for Precision@K, Recall@K, NDCG@K, etc.
          default:
            - 1
            - 5
            - 10
            - 20
        metrics:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Metrics
          description: >-
            List of metrics to calculate. Available: precision, recall, f1, f2,
            map, ndcg, mrr. f2 is the recall-weighted F-beta (beta=2) — useful
            when missing a relevant doc costs more than a false positive.
          default:
            - precision
            - recall
            - f1
            - map
            - ndcg
            - mrr
        k_multiples_of_relevant:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
          title: K Multiples Of Relevant
          description: >-
            Also grade each query at its own k: this multiple of R, the number
            of entries in that query's relevant_documents. [1, 2] grades a query
            with 21 relevant documents at k=21 and k=42. Results use the suffix
            '1r', '2r': f2_at_2r in overall_metrics and in each query's metrics,
            and the key '2r' in metrics_by_k. k_values still apply. A query
            whose k exceeds the pagination limit of a retriever execution is
            skipped, with the reason in query_results.
          examples:
            - - 1
              - 2
      type: object
      title: EvaluationConfig
      description: Configuration for an evaluation run.
    ErrorDetail:
      properties:
        message:
          type: string
          title: Message
          description: Human-readable error message
        type:
          type: string
          title: Type
          description: Stable error type identifier (machine-readable)
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
          description: >-
            Fine-grained error code for programmatic handling (e.g.,
            namespace_name_taken, feature_extractor_not_found). Present only
            when consumers may need to branch on a specific error condition.
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
          description: >-
            Optional structured details to help debugging (validation errors,
            IDs, etc.)
      type: object
      required:
        - message
        - type
      title: ErrorDetail
      description: Error detail model.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Mixpeek API key, sent as `Authorization: Bearer mxp_sk_...`. Create one
        in Studio under Settings → API Keys, or with an admin key via `POST
        /v1/organizations/users/{user_email}/api-keys`. A missing, malformed,
        unknown, revoked, inactive or expired key returns 401; a key without the
        permission, scope or plan an operation needs returns 403.
    NamespaceHeader:
      type: apiKey
      in: header
      name: X-Namespace
      description: >-
        Namespace id (`ns_...`), not the namespace name. This scopes the request
        rather than authenticating it, and it is required on every operation
        marked `x-mixpeek-namespace-scoped`.

````

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