> ## 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.

# Finalize Evaluation

> Mark an evaluation as complete and compute final statistics.



## OpenAPI

````yaml https://api.primeintellect.ai/openapi.json post /api/v1/evaluations/{evaluation_id}/finalize
openapi: 3.1.0
info:
  title: PI API
  version: 0.1.0
servers:
  - url: https://api.primeintellect.ai
security: []
paths:
  /api/v1/evaluations/{evaluation_id}/finalize:
    post:
      tags:
        - evals
      summary: Finalize Evaluation
      description: Mark an evaluation as complete and compute final statistics.
      operationId: finalize_evaluation_api_v1_evaluations__evaluation_id__finalize_post
      parameters:
        - name: evaluation_id
          in: path
          required: true
          schema:
            type: string
            title: Evaluation Id
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/FinalizeEvaluationRequest'
                - type: 'null'
              title: Request
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FinalizeEvaluationResponse'
        '401':
          description: Authorization failed
        '422':
          description: Invalid request data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    FinalizeEvaluationRequest:
      properties:
        metrics:
          anyOf:
            - type: object
            - type: 'null'
          title: Metrics
          description: Final metrics to attach to the evaluation
      type: object
      title: FinalizeEvaluationRequest
      description: Request to finalize an evaluation (optional, can include final metrics)
    FinalizeEvaluationResponse:
      properties:
        evaluation_id:
          type: string
          title: Evaluation Id
        status:
          $ref: '#/components/schemas/EvaluationStatus'
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
        total_samples:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total Samples
        avg_score:
          anyOf:
            - type: number
            - type: 'null'
          title: Avg Score
        min_score:
          anyOf:
            - type: number
            - type: 'null'
          title: Min Score
        max_score:
          anyOf:
            - type: number
            - type: 'null'
          title: Max Score
        viewer_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Viewer Url
      type: object
      required:
        - evaluation_id
        - status
      title: FinalizeEvaluationResponse
      description: Response after finalizing an evaluation
    ErrorResponse:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Errors
      type: object
      required:
        - errors
      title: ErrorResponse
    EvaluationStatus:
      type: string
      enum:
        - PENDING
        - RUNNING
        - PROCESSING
        - COMPLETED
        - FAILED
        - TIMEOUT
        - CANCELLED
      title: EvaluationStatus
      description: Evaluation status enum
    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

````