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

# Explain a score gap between two models

> Writes one or two sentences explaining why two models scored differently on the same evaluator, from the judge's own notes. Uses a small platform-funded model call against your organization's platform allowance; when that isn't available or fails, returns a factual description of the score difference with `source: "heuristic"`.

**Auth:** session. **Permission:** `run_agents` or `manage_agents`.



## OpenAPI

````yaml /api-reference/openapi.json post /projects/{projectId}/evaluations/explain
openapi: 3.1.0
info:
  title: CorePillar API
  version: 1.0.0
  description: >-
    REST API for AgentHub and ModelHub. Ingestion endpoints authenticate with a
    project tracing key; all other endpoints use the signed-in user's browser
    session.
servers:
  - url: https://pillarforge.corepillar.ai/api/v1
    description: AgentHub
security: []
tags:
  - name: Ingestion
    description: 'Send traces with a tracing key: JSON ingest and OpenTelemetry (OTLP).'
  - name: Traces
    description: Read traces and spans.
  - name: Evaluations
    description: Evaluate traces with evaluator collections.
  - name: Evaluators
    description: Built-in and custom evaluators.
  - name: Evaluator collections
    description: Ordered groups of evaluators.
  - name: Organizations
    description: Organizations you belong to.
  - name: Members
    description: Organization members, invites and roles.
  - name: Projects
    description: Projects inside an organization.
  - name: SSO
    description: Okta SSO configuration.
  - name: Tracing keys
    description: Create, list and revoke project tracing keys.
  - name: Cost calculator
    description: Estimate, generate and execute scenario runs.
  - name: Synthetic
    description: Synthetic agent and data setup from source material.
  - name: Chat
    description: ModelHub chat. Served at https://modelhub.corepillar.ai/api/v1.
  - name: Auth
    description: Sign-in helpers.
  - name: E2E
    description: Internal end-to-end encryption key directory.
paths:
  /projects/{projectId}/evaluations/explain:
    post:
      tags:
        - Evaluations
      summary: Explain a score gap between two models
      description: >-
        Writes one or two sentences explaining why two models scored differently
        on the same evaluator, from the judge's own notes. Uses a small
        platform-funded model call against your organization's platform
        allowance; when that isn't available or fails, returns a factual
        description of the score difference with `source: "heuristic"`.


        **Auth:** session. **Permission:** `run_agents` or `manage_agents`.
      operationId: explainScoreGap
      parameters:
        - name: projectId
          in: path
          required: true
          description: Project id.
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - evaluator_name
                - model_a
                - model_b
              properties:
                evaluator_name:
                  type: string
                  minLength: 1
                  maxLength: 160
                model_a:
                  $ref: '#/components/schemas/ExplainSide'
                model_b:
                  $ref: '#/components/schemas/ExplainSide'
      responses:
        '200':
          description: Explanation.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      explanation:
                        type: string
                        maxLength: 400
                      source:
                        type: string
                        enum:
                          - model
                          - heuristic
        '400':
          description: Validation failed. `error.code` is `VALIDATION_ERROR`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '401':
          description: Not signed in (`UNAUTHORIZED`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '403':
          description: >-
            Not a member of the organization, or missing the required permission
            (`FORBIDDEN`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '404':
          description: Project not found or not visible to you (`PROJECT_NOT_FOUND`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '500':
          description: Unexpected server error (`INTERNAL_ERROR`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
      security:
        - session: []
components:
  schemas:
    ExplainSide:
      type: object
      required:
        - label
        - score
        - passed
      properties:
        label:
          type: string
          minLength: 1
          maxLength: 120
        score:
          type: number
          minimum: 0
          maximum: 100
        passed:
          type: boolean
        reasoning:
          type: string
          maxLength: 2000
          default: ''
        criteria:
          type: array
          maxItems: 8
          default: []
          items:
            type: object
            required:
              - name
              - score
            properties:
              name:
                type: string
                minLength: 1
                maxLength: 64
              score:
                type: number
                minimum: 0
                maximum: 1
              note:
                type: string
                maxLength: 240
                default: ''
        issues:
          type: array
          maxItems: 6
          default: []
          items:
            type: object
            required:
              - category
              - severity
            properties:
              category:
                type: string
                minLength: 1
                maxLength: 64
              severity:
                type: string
                enum:
                  - none
                  - low
                  - medium
                  - high
                  - critical
              detail:
                type: string
                maxLength: 240
                default: ''
        evidence:
          type: array
          maxItems: 4
          default: []
          items:
            type: string
            maxLength: 240
    ErrorEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Stable machine-readable code. Branch on this, not on `message`.
              examples:
                - VALIDATION_ERROR
            message:
              type: string
              description: Human-readable description. May change.
            details:
              type: object
              additionalProperties: true
              description: Extra context; often empty.
  securitySchemes:
    session:
      type: apiKey
      in: cookie
      name: session
      description: >-
        The session cookie set when you sign in to AgentHub or ModelHub in a
        browser. The cookie name shown here is illustrative. There are no API
        tokens for these endpoints.

````

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