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

# Evaluate a version

> Automatically evaluates a version by resolving its product's specifications, their linked metrics, and their linked tests. Creates inference generation jobs for every test case across all linked tests. Specifications without tests or without metrics are silently skipped. Provide either `versionId` or `productId`. When `productId` is given without a `versionId`, the product's latest properly configured version (one with a conversation-endpoint, phone, or WebRTC connection) is cloned and the evaluation runs against the clone; the product must already have such a version. Omitting `versionId` clones a version, so it requires permission to create versions (a caller lacking it gets a 403). See [Evaluations](https://docs.galtea.ai/concepts/product/version/session/evaluation).




## OpenAPI

````yaml https://api.galtea.ai/openapi.json post /evaluations/fromVersion
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/fromVersion:
    post:
      tags:
        - evaluations
      summary: Evaluate a version
      description: >
        Automatically evaluates a version by resolving its product's
        specifications, their linked metrics, and their linked tests. Creates
        inference generation jobs for every test case across all linked tests.
        Specifications without tests or without metrics are silently skipped.
        Provide either `versionId` or `productId`. When `productId` is given
        without a `versionId`, the product's latest properly configured version
        (one with a conversation-endpoint, phone, or WebRTC connection) is
        cloned and the evaluation runs against the clone; the product must
        already have such a version. Omitting `versionId` clones a version, so
        it requires permission to create versions (a caller lacking it gets a
        403). See
        [Evaluations](https://docs.galtea.ai/concepts/product/version/session/evaluation).
      operationId: evaluateVersion
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                versionId:
                  type: string
                  description: The version ID to evaluate. Provide this or `productId`.
                  example: ver_123
                productId:
                  type: string
                  description: >
                    Product ID to evaluate when no `versionId` is given. The
                    product's latest properly configured version is cloned and
                    the evaluation runs against the clone.
                  example: prod_123
                specificationIds:
                  type: array
                  description: >-
                    Optional list of specification IDs to evaluate. If omitted,
                    all product specifications with linked metrics and tests are
                    used.
                  example:
                    - spec_123
                    - spec_456
                  items:
                    type: string
      responses:
        '202':
          description: Evaluation job queued successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  jobId:
                    type: string
                  versionId:
                    type: string
                    description: >-
                      The version the job runs against — the passed `versionId`,
                      or the id of the clone created when only `productId` was
                      given.
                  testCaseCount:
                    type: integer
                  message:
                    type: string
                  specifications:
                    type: array
                    description: Summary of specifications that were evaluated
                    items:
                      type: object
                      properties:
                        specificationId:
                          type: string
                        testCount:
                          type: integer
                        metricCount:
                          type: integer
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Version not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    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-...`.

````