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

# Reward

> Evaluate LLM output against specified criteria. Score on a continuous 0-1 scale.



## OpenAPI

````yaml https://platform.composo.ai/api/evals-docs/openapi.json post /api/v1/evals/reward
openapi: 3.1.0
info:
  title: Evals API Documentation
  description: API documentation for the evaluation endpoints
  version: 1.0.0
servers:
  - url: https://platform.composo.ai
    description: Production server
security: []
paths:
  /api/v1/evals/reward:
    post:
      tags:
        - Evals
      summary: Reward
      description: >-
        Evaluate LLM output against specified criteria. Score on a continuous
        0-1 scale.
      operationId: reward_api_v1_evals_reward_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RewardRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScoreResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                properties:
                  detail:
                    type: string
                    description: Details about the bad request error
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                properties:
                  detail:
                    type: string
                    description: Details about the unauthorized error
                type: object
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                properties:
                  detail:
                    type: string
                    description: Details about the rate limiting error
                type: object
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                properties:
                  detail:
                    type: string
                    description: Details about the internal server error
                type: object
        '524':
          description: Request Timeout
          content:
            application/json:
              schema:
                properties:
                  detail:
                    type: string
                    description: Details about the gateway timeout error
                type: object
      security:
        - CaseInsensitiveAPIKeyHeader: []
components:
  schemas:
    RewardRequest:
      properties:
        evaluation_criteria:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Evaluation Criteria
          description: >-
            Criteria used for evaluation. Begins with one of the following:
            Reward, Penalize, Passes if, Fails ifNote, align-lightning-20251127
            only supports Passes/Fails criteria. Mutually exclusive with
            evaluator_name.
        evaluator_name:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Evaluator Name
          description: >-
            Name of an existing evaluator (group_id) to use for evaluation.
            Mutually exclusive with evaluation_criteria. 
        model_core:
          $ref: '#/components/schemas/ModelCore'
          description: >-
            The model core for reward evaluation. Defaults to align-20251111 if
            not specified.
          default: align-20251111
        tags:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Tags
          description: >-
            Optional key-value pairs to tag and categorize the request. All tag
            values must be strings.
          default: {}
        trace_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Trace Id
          description: >-
            Optional trace ID to associate this evaluation with an existing
            trace.
        messages:
          items:
            additionalProperties: true
            type: object
          type: array
          minItems: 2
          title: Messages
          description: >-
            A list of chat messages in
            [OpenAI](https://platform.openai.com/docs/api-reference/chat/create#chat-create-messages)
            or
            [Anthropic](https://platform.claude.com/docs/en/api/messages#message_param)
            messages format
        system:
          anyOf:
            - type: string
            - type: 'null'
          title: System
          description: System message is separate for Anthropic-style LLM calls. Optional.
        tools:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Tools
          description: >-
            List of tools available for the assistant to call in
            [OpenAI](https://platform.openai.com/docs/api-reference/chat/create#chat_create-tools)
            or
            [Anthropic](https://platform.claude.com/docs/en/api/messages#tool_union)
            format. Optional.
        evaluate_latest:
          type: boolean
          title: Evaluate Latest
          description: >-
            Whether to evaluate only the latest response or all responses. Only
            True is supported for `align-lightning` model cores.
          default: true
        explanation_cleaning:
          anyOf:
            - type: string
              const: end_user
            - type: 'null'
          title: Explanation Cleaning
          description: >-
            When set to "end_user", the response will include a
            `cleaned_explanation` field that rewrites the explanation to only
            reference content visible in user and assistant messages.
      additionalProperties: false
      type: object
      required:
        - messages
      title: RewardRequest
      description: >-
        Request model for reward score evaluation of LLM responses against
        specified criteria.
    ScoreResponse:
      properties:
        score:
          anyOf:
            - type: number
            - type: 'null'
          title: Score
          description: >-
            Evaluation score between 0 and 1. If null, the criteria was deemed
            not applicable.
        explanation:
          type: string
          title: Explanation
          description: Explanation of the evaluation score
        cleaned_explanation:
          anyOf:
            - type: string
            - type: 'null'
          title: Cleaned Explanation
          description: >-
            A rewrite of `explanation` that only references content visible in
            user and assistant messages. Only present when
            `explanation_cleaning` is set to "end_user" in the request.
        sources:
          anyOf:
            - items:
                $ref: '#/components/schemas/Source'
              type: array
            - type: 'null'
          title: Sources
          description: >-
            Sources referenced in the evaluation, e.g. memories, annotations, or
            documents.
      type: object
      required:
        - explanation
      title: ScoreResponse
      description: Response model for evaluation scores.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ModelCore:
      type: string
      enum:
        - align-20251111
        - align-20250529
        - align-20260109
        - align-lightning-20251127
        - align-lightning-20250731
      title: ModelCore
    Source:
      properties:
        id:
          type: string
          title: Id
          description: Identifier of the source.
        type:
          type: string
          title: Type
          description: Type of the source.
      type: object
      required:
        - id
        - type
      title: Source
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    CaseInsensitiveAPIKeyHeader:
      type: apiKey
      in: header
      name: API-Key

````