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

# Evaluate

> Run an AI evaluator



## OpenAPI

````yaml https://api.getcargo.io/openapi.json post /ai/evaluator/evaluate
openapi: 3.1.0
info:
  title: Cargo API
  version: 1.0.0
  description: Cargo Platform API v1
servers:
  - url: https://api.getcargo.io/v1
    description: Cargo API
security:
  - bearerAuth: []
paths:
  /ai/evaluator/evaluate:
    post:
      tags:
        - AI - Evaluator
      summary: Evaluate
      description: Run an AI evaluator
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                messageUuid:
                  title: Message UUID
                  description: >-
                    When set, the output to grade is read from this message's
                    text.
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$
                output:
                  title: Output
                  description: >-
                    Text to grade directly. Used when `messageUuid` is not
                    provided.
                  type: string
                rubric:
                  type: string
                  minLength: 1
                  title: Rubric
                  description: >-
                    Natural-language criteria describing what a good output
                    looks like.
                context:
                  title: Context
                  description: Optional extra context to ground the evaluation.
                  type: string
              required:
                - rubric
              additionalProperties: false
              title: Request body
              description: >-
                Body schema for the evaluator evaluate endpoint. Provide either
                `messageUuid` or `output` as the thing to grade.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  evaluation:
                    type: object
                    properties:
                      score:
                        type: number
                        minimum: 0
                        maximum: 1
                      passed:
                        type: boolean
                      criteria:
                        type: array
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                            passed:
                              type: boolean
                            reason:
                              type: string
                          required:
                            - name
                            - passed
                            - reason
                          additionalProperties: false
                      summary:
                        type: string
                    required:
                      - score
                      - passed
                      - criteria
                      - summary
                    additionalProperties: false
                required:
                  - evaluation
                additionalProperties: false
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '404':
          description: Not found
        '500':
          description: Internal server error
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````