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

# Generate inference results from test cases

> Triggers async inference generation for specified test cases using the version's endpoint connection. 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 inferences run 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 [Inference Results](https://docs.galtea.ai/concepts/product/version/session/inference-result).




## OpenAPI

````yaml https://api.galtea.ai/openapi.json post /inferenceResults/generate
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:
  /inferenceResults/generate:
    post:
      tags:
        - inference-results
      summary: Generate inference results from test cases
      description: >
        Triggers async inference generation for specified test cases using the
        version's endpoint connection. 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
        inferences run 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
        [Inference
        Results](https://docs.galtea.ai/concepts/product/version/session/inference-result).
      operationId: generateInferenceResults
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                testIds:
                  type: array
                  example:
                    - test_123
                    - test_456
                  items:
                    type: string
                  description: >-
                    Array of test IDs to generate inferences for (will process
                    all test cases in these tests)
                testCaseIds:
                  type: array
                  example:
                    - tc_123
                    - tc_456
                  items:
                    type: string
                  description: Array of test case IDs to generate inferences for
                versionId:
                  type: string
                  description: >-
                    Version ID containing the endpoint connection configuration.
                    Provide this or `productId`.
                  example: ver_123
                productId:
                  type: string
                  description: >
                    Product ID to run against when no `versionId` is given. The
                    product's latest properly configured version is cloned and
                    inferences run against the clone.
                  example: prod_123
                metricIds:
                  type: array
                  example:
                    - metric_123
                    - metric_456
                  items:
                    type: string
                  description: >-
                    Optional array of metric IDs to evaluate after inference
                    generation. If provided, evaluations will be triggered
                    automatically.
      responses:
        '202':
          description: Inference generation 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.
                  message:
                    type: string
                  testCaseCount:
                    type: integer
        '400':
          description: Bad request - missing required parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          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-...`.

````