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

# Create single-turn evaluations

> Create evaluations for single-turn interactions. See [Evaluations](https://docs.galtea.ai/concepts/product/version/session/evaluation).

> [!WARNING]
>
> You are reading the docs of Galtea 5.14. [Read this page in the latest version](https://docs.galtea.ai/api-reference/evaluations/create-single-turn-evaluations.md).


## OpenAPI

````yaml /v5.14/openapi.json post /evaluations/singleTurn
openapi: 3.0.0
info:
  version: 1.0.0
  title: Product Management Service API
  description: API documentation for Product Management Service
  contact:
    name: Galtea AI
servers:
  - url: https://api.galtea.ai
security:
  - bearerAuth: []
tags: []
externalDocs:
  description: Galtea Platform Documentation
  url: https://docs.galtea.ai
paths:
  /evaluations/singleTurn:
    post:
      tags:
        - evaluations
      summary: Create single-turn evaluations
      description: >-
        Create evaluations for single-turn interactions. See
        [Evaluations](https://docs.galtea.ai/concepts/product/version/session/evaluation).
      operationId: createSingleTurnEvaluations
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSingleTurnEvaluationsBody'
      responses:
        '201':
          description: Evaluations created successfully
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EvaluationCreated'
        '400':
          description: >-
            Bad request. A malformed body (no `metrics`, no `actualOutput`, or
            `input` and `testCaseId` against the `isProduction` rule) writes
            nothing. A metric refused once the turn is logged (an unknown
            metric, a self-hosted metric without a score, or a metric of another
            organization than the product's), or a `runId` that is refused
            (closed, deleted, opened by the platform, or of another product or
            version), keeps the session and its turn, with no evaluation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            The caller may not create evaluations on this product (for example a
            READER). No version, session, turn or evaluation is written.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    CreateSingleTurnEvaluationsBody:
      type: object
      properties:
        metrics:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                example: id_123
              name:
                type: string
                example: Example Name
              score:
                type: number
                example: 0.95
        versionId:
          type: string
          nullable: true
          example: ver_123
          description: >-
            Version to attach the evaluation to. Optional: when omitted, provide
            productId and the API reuses the product's latest version (creating
            a default first version if the product has none). One of versionId
            or productId is required.
        productId:
          type: string
          nullable: true
          example: prod_123
          description: >-
            Product to anchor the evaluation when versionId is omitted. Ignored
            when versionId is provided.
        testCaseId:
          type: string
          nullable: true
          example: tc_123
          description: >-
            Required when isProduction is false. Must be omitted when
            isProduction is true.
        actualOutput:
          type: string
          nullable: true
          example: Model response text
        input:
          type: string
          nullable: true
          example: What is the capital of France?
          description: >-
            User input/prompt. Required when isProduction is true. Must be
            omitted when isProduction is false.
        retrievalContext:
          type: string
          nullable: true
          description: RAG retrieval context used to generate the actual output
          example: Retrieved context document
        inputTokens:
          type: number
          nullable: true
          description: Input token count for the LLM call
        outputTokens:
          type: number
          nullable: true
          description: Output token count for the LLM call
        cacheReadInputTokens:
          type: number
          nullable: true
          description: Input tokens served from a prompt cache
        tokens:
          type: number
          nullable: true
          description: Total token count, when the caller has no breakdown
        cost:
          type: number
          nullable: true
          description: Total cost of the LLM call
        costPerInputToken:
          type: number
          nullable: true
          description: Price per input token
        costPerOutputToken:
          type: number
          nullable: true
          description: Price per output token
        costPerCacheReadInputToken:
          type: number
          nullable: true
          description: Price per cache-read input token
        conversationSimulatorVersion:
          type: string
          nullable: true
          description: >-
            Version of the conversation simulator that produced this turn, if
            simulated
        isProduction:
          type: boolean
          nullable: true
          description: >-
            When true, creates a production evaluation (input required,
            testCaseId must be omitted). When false (default), testCaseId is
            required and input must be omitted.
        runId:
          type: string
          nullable: true
          example: run_123
          description: >-
            Attribute this evaluation to a run you opened with POST /runs, and
            close that run yourself. Without it the API opens its own run and
            closes it when the launch finishes. A run the platform opened is
            refused.
      required:
        - metrics
        - actualOutput
    EvaluationCreated:
      type: object
      properties:
        id:
          type: string
          example: eval_123
        metricId:
          type: string
          example: metric_123
        sessionId:
          type: string
          example: session_123
        productId:
          type: string
          nullable: true
          example: product_123
        userId:
          type: string
          nullable: true
          example: user_123
        status:
          type: string
          enum:
            - PENDING
            - PENDING_HUMAN
            - SUCCESS
            - FAILED
            - SKIPPED
            - CANCELLED
            - OUTDATED
          example: SUCCESS
        inferenceResultId:
          type: string
          nullable: true
          example: ir_123
        score:
          type: number
          nullable: true
          example: 0.95
        reason:
          type: string
          nullable: true
        error:
          type: string
          nullable: true
        canRetry:
          type: boolean
        creditsUsed:
          type: integer
          nullable: true
        conversationSimulatorVersion:
          type: string
          nullable: true
        humanEvaluatorId:
          type: string
          nullable: true
        humanEvaluatorStartedAt:
          type: string
          format: date-time
          nullable: true
        humanScore:
          type: number
          nullable: true
        humanReason:
          type: string
          nullable: true
        humanEvaluatorFinishedAt:
          type: string
          format: date-time
          nullable: true
        failedTurns:
          type: array
          items:
            type: string
        createdAt:
          type: string
          format: date-time
        deletedAt:
          type: string
          format: date-time
          nullable: true
        evaluatedAt:
          type: string
          format: date-time
          nullable: true
        metricLegacyAt:
          type: string
          format: date-time
          nullable: true
        passed:
          type: boolean
          nullable: true
          description: >-
            Whether the reported score (the reviewer's when set, else the
            judge's) reaches the metric's pass threshold. Null when the
            evaluation has no reported score, is outdated or deleted, is a long
            classifier input, or its metric is not loaded.
        metricPassThreshold:
          type: number
          minimum: 0
          maximum: 1
          description: >-
            The pass threshold that decides `passed`: the metric's, copied onto
            the evaluation when it was created.
        metricDisabledAt:
          type: string
          format: date-time
          nullable: true
        runId:
          type: string
          nullable: true
        metricExcludedFromAnalyticsAt:
          type: string
          format: date-time
          nullable: true
        metricExcludedByUserId:
          type: string
          nullable: true
      required:
        - id
        - metricId
        - sessionId
        - productId
        - userId
        - status
        - inferenceResultId
        - score
        - reason
        - error
        - canRetry
        - creditsUsed
        - conversationSimulatorVersion
        - humanEvaluatorId
        - humanEvaluatorStartedAt
        - humanScore
        - humanReason
        - humanEvaluatorFinishedAt
        - failedTurns
        - deletedAt
        - evaluatedAt
        - metricLegacyAt
        - passed
        - metricPassThreshold
        - metricDisabledAt
        - runId
        - metricExcludedFromAnalyticsAt
        - metricExcludedByUserId
    Error:
      type: object
      properties:
        error:
          type: string
          example: Error type
        message:
          type: string
          example: Error message description
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authorization. Pass your API key in the Authorization header as
        a Bearer token. Both new (`gsk_*`) and legacy (`gsk-`) API keys are
        accepted, e.g. `Authorization: Bearer gsk_...` or `Authorization: Bearer
        gsk-...`.

````

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