> ## 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 several Classifier metrics at once (classifier metrics only)

> Creates CLASSIFIER metrics only. Each item takes a `classifierQuestion` and an optional `evaluatorModelName`, and no source or judge prompt. To create metrics of any source in one call, use `POST /metrics/batch`. Each metric gets the classifier model its item names, or the one selectable classifier model when the item names none, and is linked to the specifications it names. All or nothing, so a refused item creates no metric and no link. A name already used in the organization is refused with every taken name quoted in the message. Answers 400 where the deployment does not enable Classifier metrics, for a name that is not a selectable classifier model, and for an item that names none while several are selectable.



## OpenAPI

````yaml https://api.galtea.ai/openapi.json post /metrics/bulk
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:
  /metrics/bulk:
    post:
      tags:
        - metrics
      summary: Create several Classifier metrics at once (classifier metrics only)
      description: >-
        Creates CLASSIFIER metrics only. Each item takes a `classifierQuestion`
        and an optional `evaluatorModelName`, and no source or judge prompt. To
        create metrics of any source in one call, use `POST /metrics/batch`.
        Each metric gets the classifier model its item names, or the one
        selectable classifier model when the item names none, and is linked to
        the specifications it names. All or nothing, so a refused item creates
        no metric and no link. A name already used in the organization is
        refused with every taken name quoted in the message. Answers 400 where
        the deployment does not enable Classifier metrics, for a name that is
        not a selectable classifier model, and for an item that names none while
        several are selectable.
      operationId: createClassifierMetrics
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateClassifierMetricsBody'
      responses:
        '201':
          description: >-
            The created metrics, in request order. When the read after the
            create fails, `metrics` holds only the created ids (`[{ id }]`)
            instead
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/CreatedClassifierMetrics'
                  - type: object
                    properties:
                      metrics:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                          required:
                            - id
                          additionalProperties: false
                    required:
                      - metrics
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    CreateClassifierMetricsBody:
      type: object
      properties:
        metrics:
          type: array
          items:
            $ref: '#/components/schemas/ClassifierMetricInput'
          minItems: 1
          maxItems: 10
      required:
        - metrics
    CreatedClassifierMetrics:
      type: object
      properties:
        metrics:
          type: array
          items:
            $ref: '#/components/schemas/Metric'
          description: The created metrics, in request order.
      required:
        - metrics
    Error:
      type: object
      properties:
        error:
          type: string
          example: Error type
        message:
          type: string
          example: Error message description
    ClassifierMetricInput:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 200
        description:
          type: string
          nullable: true
          maxLength: 5000
        tags:
          type: array
          nullable: true
          items:
            type: string
        classifierQuestion:
          allOf:
            - $ref: '#/components/schemas/ClassifierQuestionInput'
            - description: >-
                The one question the classifier answers. evaluationParams is
                derived from its {{ param }} placeholders.
        evaluatorModelName:
          type: string
          nullable: true
          example: jev-1.13.0
          description: >-
            The selectable classifier model to run the question under, as listed
            by `GET /evaluatorModels` with `kind=CLASSIFIER` and
            `selectable=true`. Omitted or null, the one selectable classifier
            model is used. When several are selectable, the request is refused
            with 400 and this field must be sent.
        specificationIds:
          type: array
          nullable: true
          items:
            type: string
            minLength: 1
          description: >-
            POLICY or CAPABILITY specifications of your organization to link the
            metric to.
        passThreshold:
          type: number
          nullable: true
          minimum: 0
          maximum: 1
          example: 0.7
          description: >-
            Score from 0 to 1 at or above which an evaluation of this metric
            passes. Omitted or null, it defaults to 0.5.
        applicabilityScope:
          type: string
          nullable: true
          enum:
            - NONE
            - DEVELOPMENT
            - PRODUCTION
            - ALL
          example: PRODUCTION
          description: >-
            Which sessions get the applicability check before this metric is
            judged: `PRODUCTION`, `DEVELOPMENT`, `ALL` or `NONE` (no check). A
            session the check finds the metric does not apply to is skipped and
            no judge call is made. Omitted or null, it defaults to `PRODUCTION`.
            Fixed at create: a change creates a revision. A metric whose
            question reads `traces` is never checked, so it takes `NONE` and
            refuses any other value. The check runs only where the deployment
            enables it.
        applicabilityThreshold:
          type: number
          nullable: true
          minimum: 0
          maximum: 1
          example: 0.7
          description: >-
            The lowest probability, from 0 to 1, that the metric applies to a
            session at which it is judged. Below it, the session is skipped.
            Omitted or null, it defaults to 0.5. Refused for a metric whose
            question reads `traces`. Fixed at create: a change creates a
            revision. The check runs only where the deployment enables it.
      required:
        - name
        - classifierQuestion
    Metric:
      type: object
      properties:
        id:
          type: string
          example: metric_123
        metricGroupId:
          type: string
          readOnly: true
          example: metric_123
          description: >-
            Identifier shared by every metric in the same revision family.
            Server-managed — derived from `parentMetricId` on create (or
            generated for roots). Cannot be set by the caller.
        parentMetricId:
          type: string
          nullable: true
          example: metric_122
          description: >-
            Id of the direct parent metric. On create, providing this value
            turns the new metric into a revision: it joins the parent's family
            and (if the parent is active) flips the parent to legacy. Omit or
            null to create a root metric in a fresh group. On responses, this is
            the recorded parent edge (null for roots).
        organizationId:
          type: string
          nullable: true
          example: org_123
        userId:
          type: string
          nullable: true
          example: user_123
        name:
          type: string
          example: Accuracy
        evaluationParams:
          type: array
          items:
            type: string
          example:
            - input
            - actual_output
            - expected_output
          description: >-
            Ordered list of trace fields the evaluator needs, written in
            snake_case (e.g. `input`, `actual_output`, `expected_output`,
            `retrieval_context`). Determines which data the evaluation engine
            extracts from each trace. Full list of accepted values:
            https://docs.galtea.ai/concepts/metric/evaluation-parameters
        source:
          type: string
          nullable: true
          enum:
            - SELF_HOSTED
            - FULL_PROMPT
            - PARTIAL_PROMPT
            - HUMAN_EVALUATION
            - GEVAL
            - DEEPEVAL
            - DETERMINISTIC
            - CLASSIFIER
          example: PARTIAL_PROMPT
          description: >-
            Evaluation method for the metric. `FULL_PROMPT` is deprecated for
            creation — `POST /metrics` rejects it with a 400. Use
            `PARTIAL_PROMPT` for new AI Evaluation metrics. The value remains in
            the enum because existing FULL_PROMPT metrics are still returned by
            reads and filters. `CLASSIFIER` is the Classifier judge, accepted
            only where the deployment enables it.
        judgePrompt:
          type: string
          nullable: true
          example: Evaluate the accuracy of the response
        tags:
          type: array
          items:
            type: string
          example:
            - accuracy
            - quality
        description:
          type: string
          nullable: true
          example: Measures the accuracy of responses
        documentationUrl:
          type: string
          nullable: true
          example: https://docs.example.com/metrics/accuracy
        evaluatorModelName:
          type: string
          nullable: true
          example: GPT-4
        areEvalParamsTop:
          type: boolean
          nullable: true
          description: >-
            When true, evaluationParams are injected at the top level of the
            evaluator prompt instead of nested inside the conversation context.
        isBeingOptimized:
          type: boolean
          readOnly: true
          description: Whether the metric is currently being optimized.
        optimizationStatus:
          type: string
          nullable: true
          enum:
            - OPTIMIZING
            - READY_FOR_REVIEW
            - FAILED
            - NO_IMPROVEMENT
            - DECLINED
            - ACTIVATED
          readOnly: true
          example: READY_FOR_REVIEW
          description: >-
            Where an optimization attempt stands. Null for a metric that did not
            come from an optimization. A candidate waiting for review is legacy
            until it is activated.
        judgeGenerationSettings:
          type: object
          nullable: true
          properties:
            temperature:
              type: number
              nullable: true
              minimum: 0
              example: 0.3
            topP:
              type: number
              nullable: true
              minimum: 0
              maximum: 1
              example: 0.9
            maxOutputTokens:
              type: integer
              nullable: true
              minimum: 1
              example: 512
              description: >-
                A new metric needs at least 256, so the judge's structured
                answer fits. A metric stored before that floor keeps its cap.
            reasoningEffort:
              type: string
              nullable: true
              example: low
          additionalProperties: false
          description: >-
            The generation settings this metric's judge runs with. Null runs the
            platform defaults. Immutable: changing one creates a revision.
        passThreshold:
          type: number
          minimum: 0
          maximum: 1
          example: 0.7
          description: >-
            Score from 0 to 1 at or above which an evaluation of this metric
            passes. Immutable: changing it creates a revision.
        applicabilityScope:
          type: string
          enum:
            - NONE
            - DEVELOPMENT
            - PRODUCTION
            - ALL
          example: PRODUCTION
          description: >-
            Which sessions get the applicability check before this metric is
            judged. `NONE` for a metric the platform does not score. A metric
            that scores `traces` is never checked, so it takes `NONE` and
            refuses any other value. A FULL_PROMPT metric whose judge prompt
            reads `traces` but does not list it in evaluationParams is stored as
            checked, yet the evaluator judges it without the check. Immutable:
            changing it creates a revision. The check runs only where the
            deployment enables it.
        applicabilityThreshold:
          type: number
          nullable: true
          minimum: 0
          maximum: 1
          example: 0.7
          description: >-
            The lowest probability that the metric applies to a session at which
            it is judged. Null means the platform default, 0.5. Immutable:
            changing it creates a revision.
        classifierQuestion:
          allOf:
            - $ref: '#/components/schemas/ClassifierQuestion'
            - nullable: true
              description: >-
                The one question of a CLASSIFIER metric; null for every other
                source.
        optimizationValidation:
          type: object
          nullable: true
          properties:
            used:
              type: boolean
              description: >-
                Whether any evaluation was held out for validation. False when
                none was: too few annotated evaluations and no session kept from
                an earlier attempt, or no session was eligible for the hold-out.
            heldOutEvaluationIds:
              type: array
              items:
                type: string
              description: >-
                Evaluations held out of the search. Empty when no validation set
                was used.
              example:
                - evaluation_123
            results:
              type: object
              nullable: true
              properties:
                optimization:
                  type: object
                  properties:
                    rowsScored:
                      type: integer
                      minimum: 0
                      description: Rows both prompts scored. Only these rows are compared.
                      example: 25
                    rowsTotal:
                      type: integer
                      minimum: 0
                      description: Rows in the set.
                      example: 25
                    source:
                      type: object
                      properties:
                        correct:
                          type: integer
                          minimum: 0
                          description: >-
                            Rows where the AI verdict matches the human label. A
                            score at or above the metric's pass threshold is a
                            positive verdict.
                          example: 20
                        alignment:
                          type: number
                          nullable: true
                          description: >-
                            Alignment between the AI scores and the human labels
                            on the compared rows. Null when undefined.
                          example: 0.71
                      required:
                        - correct
                        - alignment
                      additionalProperties: false
                    candidate:
                      type: object
                      properties:
                        correct:
                          type: integer
                          minimum: 0
                          description: >-
                            Rows where the AI verdict matches the human label. A
                            score at or above the metric's pass threshold is a
                            positive verdict.
                          example: 20
                        alignment:
                          type: number
                          nullable: true
                          description: >-
                            Alignment between the AI scores and the human labels
                            on the compared rows. Null when undefined.
                          example: 0.71
                      required:
                        - correct
                        - alignment
                      additionalProperties: false
                  required:
                    - rowsScored
                    - rowsTotal
                    - source
                    - candidate
                  additionalProperties: false
                validation:
                  type: object
                  properties:
                    rowsScored:
                      type: integer
                      minimum: 0
                      description: Rows both prompts scored. Only these rows are compared.
                      example: 25
                    rowsTotal:
                      type: integer
                      minimum: 0
                      description: Rows in the set.
                      example: 25
                    source:
                      type: object
                      properties:
                        correct:
                          type: integer
                          minimum: 0
                          description: >-
                            Rows where the AI verdict matches the human label. A
                            score at or above the metric's pass threshold is a
                            positive verdict.
                          example: 20
                        alignment:
                          type: number
                          nullable: true
                          description: >-
                            Alignment between the AI scores and the human labels
                            on the compared rows. Null when undefined.
                          example: 0.71
                      required:
                        - correct
                        - alignment
                      additionalProperties: false
                    candidate:
                      type: object
                      properties:
                        correct:
                          type: integer
                          minimum: 0
                          description: >-
                            Rows where the AI verdict matches the human label. A
                            score at or above the metric's pass threshold is a
                            positive verdict.
                          example: 20
                        alignment:
                          type: number
                          nullable: true
                          description: >-
                            Alignment between the AI scores and the human labels
                            on the compared rows. Null when undefined.
                          example: 0.71
                      required:
                        - correct
                        - alignment
                      additionalProperties: false
                  required:
                    - rowsScored
                    - rowsTotal
                    - source
                    - candidate
                  additionalProperties: false
              required:
                - optimization
                - validation
              additionalProperties: false
              description: >-
                Both prompts scored on the rows the search used and on the
                held-out rows. Null when the optimizer reported nothing.
            rows:
              type: array
              nullable: true
              items:
                type: object
                properties:
                  evaluationId:
                    type: string
                    example: evaluation_123
                  humanScore:
                    type: number
                    description: The human label.
                    example: 1
                  sourceScore:
                    type: number
                    nullable: true
                    description: >-
                      The source prompt's judge score on this row, or null when
                      it failed. A score at or above the metric's pass threshold
                      is a positive verdict.
                    example: 0
                  candidateScore:
                    type: number
                    nullable: true
                    description: >-
                      The optimized prompt's judge score on this row, or null
                      when it failed. A score at or above the metric's pass
                      threshold is a positive verdict.
                    example: 1
                required:
                  - evaluationId
                  - humanScore
                  - sourceScore
                  - candidateScore
                additionalProperties: false
              description: >-
                One entry per held-out row the optimizer reported; a score is
                null when that prompt failed on the row. Null when the optimizer
                reported nothing.
          required:
            - used
            - heldOutEvaluationIds
            - results
            - rows
          additionalProperties: false
          readOnly: true
          description: >-
            How an optimization attempt was validated: the held-out evaluations
            and, once the optimizer reported, both prompts scored on the search
            rows and on the held-out rows. Set on an optimization attempt only,
            and null for any other metric, for an attempt that predates it, and
            for an attempt copied from another organization.
        optimizationRun:
          type: object
          nullable: true
          properties:
            strategies:
              type: array
              items:
                type: string
                enum:
                  - FIX_FALSE_POSITIVES
                  - FIX_FALSE_NEGATIVES
                  - ADD_RUBRIC
                  - SIMPLIFY
                  - BROADEN
              description: The strategies the run wrote candidates with.
              example:
                - ADD_RUBRIC
                - SIMPLIFY
            maxSteps:
              type: integer
              minimum: 1
              description: >-
                The run's step budget, after the optimizer applied its own
                ceiling.
              example: 6
            stepsUsed:
              type: integer
              minimum: 0
              description: >-
                The search steps the run took. 0 when the source prompt already
                met the target.
              example: 4
          required:
            - strategies
            - maxSteps
            - stepsUsed
          additionalProperties: false
          readOnly: true
          description: >-
            What an optimization attempt ran: the strategies, the step budget
            and the steps used. Null while the attempt runs, and when it was not
            reported: an attempt from before the report existed, one run by an
            older optimizer, a failed run, an attempt copied from another
            organization, or a metric that is not an optimization attempt. Null
            never means a run of 0 steps.
        specificationIds:
          type: array
          items:
            type: string
          description: >-
            Specifications linked to this metric. A MEMBER, READER or
            HUMAN_EVALUATOR caller sees only the specifications of the products
            it can read.
          example:
            - spec_123
        userGroupIds:
          type: array
          items:
            type: string
          example:
            - ug_123
        createdAt:
          type: string
          format: date-time
        legacyAt:
          type: string
          nullable: true
          format: date-time
          readOnly: true
          description: >-
            Earliest non-null of this metric's own legacy date and its evaluator
            model's `unselectableAt`, so a model no longer selectable makes
            every metric linked to it report as legacy even though the metric
            row itself is untouched. Present only once that date has passed: a
            scheduled future cutoff reports null, because the metric is still
            active until then. Unlike `disabledAt`, this field never carries a
            future date.
        disabledAt:
          type: string
          nullable: true
          format: date-time
          readOnly: true
          description: >-
            Earliest non-null of this metric's own disabled date and its
            evaluator model's `disabledAt` — a disabled model makes every metric
            linked to it report as disabled even though the metric row itself is
            untouched.
        excludedFromAnalyticsAt:
          type: string
          nullable: true
          format: date-time
          readOnly: true
          description: >-
            When set, results produced by this metric revision do not feed
            analytics.
        excludedByUserId:
          type: string
          nullable: true
          readOnly: true
          description: User who last excluded this metric revision from analytics.
      required:
        - id
        - metricGroupId
        - parentMetricId
        - organizationId
        - userId
        - name
        - evaluationParams
        - source
        - judgePrompt
        - tags
        - description
        - documentationUrl
        - evaluatorModelName
        - areEvalParamsTop
        - isBeingOptimized
        - optimizationStatus
        - judgeGenerationSettings
        - passThreshold
        - applicabilityScope
        - applicabilityThreshold
        - classifierQuestion
        - optimizationValidation
        - optimizationRun
        - specificationIds
        - userGroupIds
        - createdAt
        - legacyAt
        - disabledAt
        - excludedFromAnalyticsAt
        - excludedByUserId
    ClassifierQuestionInput:
      type: object
      properties:
        type:
          type: string
          enum:
            - yes_no
            - scale
        instructions:
          type: string
          maxLength: 2000
          description: >-
            The question, in English, naming at least one {{ evaluation_param
            }}.
        goodAnswer:
          type: string
          nullable: true
          enum:
            - 'yes'
            - 'no'
          description: yes_no only, and required there.
        criteria:
          type: object
          nullable: true
          properties:
            'yes':
              type: string
              nullable: true
              maxLength: 1000
            'no':
              type: string
              nullable: true
              maxLength: 1000
          description: 'yes_no only: what yes and no mean.'
        levels:
          type: array
          nullable: true
          items:
            type: object
            properties:
              description:
                type: string
                maxLength: 1000
              score:
                type: number
                nullable: true
                description: >-
                  From 0 to 1. Omit it on every level to space the scores evenly
                  from 0 (worst) to 1 (best).
            required:
              - description
          maxItems: 10
          description: >-
            scale only: the scored levels, worst first, with non-decreasing
            scores.
        doesNotApply:
          type: string
          nullable: true
          maxLength: 1000
          description: >-
            scale only: the text of an extra level that skips the evaluation
            when the classifier picks it.
      required:
        - type
        - instructions
    ClassifierQuestion:
      type: object
      properties:
        type:
          type: string
          enum:
            - yes_no
            - scale
        instructions:
          type: string
        goodAnswer:
          type: string
          enum:
            - 'yes'
            - 'no'
        criteria:
          type: object
          nullable: true
          properties:
            'yes':
              type: string
              nullable: true
            'no':
              type: string
              nullable: true
          required:
            - 'yes'
            - 'no'
        levels:
          type: array
          items:
            type: object
            properties:
              description:
                type: string
              score:
                type: number
            required:
              - description
              - score
        doesNotApply:
          type: string
          nullable: true
      required:
        - type
        - instructions
  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.