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

# Preview Metric

> Preview metric evaluation on call logs or runs before creating it. Supports up to 10 items. Returns progress_id to poll for results.



## OpenAPI

````yaml post /test_framework/v1/metrics/preview/
openapi: 3.1.0
info:
  title: Cekura API
  version: v1
  description: >-
    Complete API documentation for the Cekura platform. This API provides
    endpoints for testing, observing, and evaluating AI voice agents — including
    managing agents, running evaluators, defining metrics, and analyzing call
    quality.
servers:
  - url: https://api.cekura.ai
security: []
paths:
  /test_framework/v1/metrics/preview/:
    post:
      tags:
        - test_framework
      description: >-
        Preview metric evaluation on call logs or runs before creating it.
        Supports up to 10 items. Returns progress_id to poll for results.
      operationId: metrics-preview-create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MetricPreview'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MetricPreview'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MetricPreview'
        required: true
      responses:
        '200':
          description: Returns progress_id for tracking progress
      security:
        - api_key: []
components:
  schemas:
    MetricPreview:
      type: object
      properties:
        agent_id:
          type: integer
          description: Agent ID - all call logs/runs must belong to this agent
        project_id:
          type: integer
          description: Project ID - all call logs/runs must belong to this project
        call_log_ids:
          type: array
          items:
            type: integer
          description: >-
            List of call log IDs to evaluate (maximum 10, required if run_ids
            not provided)
          maxItems: 10
          minItems: 1
        run_ids:
          type: array
          items:
            type: integer
          description: >-
            List of run IDs to evaluate (maximum 10, required if call_log_ids
            not provided)
          maxItems: 10
          minItems: 1
        metric_data:
          allOf:
            - $ref: '#/components/schemas/MetricPreviewData'
          description: Metric configuration to evaluate
      required:
        - metric_data
    MetricPreviewData:
      type: object
      properties:
        name:
          type: string
          description: Name of the metric
          maxLength: 255
        type:
          enum:
            - basic
            - custom_prompt
            - custom_code
            - llm_judge
          type: string
          x-spec-enum-id: b44700c0a6443b40
          description: >-
            Type of metric: basic, custom_prompt, or custom_code


            * `basic` - Basic (Deprecated in favor of LLM Judge)

            * `custom_prompt` - Custom Prompt ( Deprecated in favor of LLM
            Judge)

            * `custom_code` - Custom Code

            * `llm_judge` - LLM Judge
        eval_type:
          enum:
            - binary_workflow_adherence
            - binary_qualitative
            - continuous_qualitative
            - numeric
            - enum
          type: string
          x-spec-enum-id: 1e3e27b342bfd8ec
          description: >-
            Evaluation type: binary_workflow_adherence, binary_qualitative,
            continuous_qualitative, numeric, or enum


            * `binary_workflow_adherence` - Binary Workflow Adherence

            * `binary_qualitative` - Binary Qualitative

            * `continuous_qualitative` - Continuous Qualitative

            * `numeric` - Numeric

            * `enum` - Enum
        evaluation_trigger:
          enum:
            - always
            - automatic
            - custom
          type: string
          x-spec-enum-id: ecd3c02e0e393ef5
          default: always
          description: |-
            When to trigger evaluation: always, automatic, or custom

            * `always` - Always
            * `automatic` - Automatic
            * `custom` - Custom
        trigger_type:
          enum:
            - llm_judge
            - custom_code
          type: string
          x-spec-enum-id: 2adad4b8df61914f
          default: llm_judge
          description: >-
            Type of trigger evaluation: llm_judge or custom_code (only used when
            evaluation_trigger is custom)


            * `llm_judge` - LLM Judge

            * `custom_code` - Custom Code
        evaluation_trigger_prompt:
          type: string
          default: ''
          description: >-
            Prompt for evaluation trigger (required for custom trigger with
            llm_judge)
        evaluation_trigger_custom_code:
          type: string
          default: ''
          description: >-
            Python code for trigger evaluation (required for custom trigger with
            custom_code)
        description:
          type: string
          default: ''
          description: Description of what the metric measures (required for basic type)
        prompt:
          type: string
          default: ''
          description: Custom prompt for evaluation (required for custom_prompt type)
        custom_code:
          type: string
          default: ''
          description: Python code for custom evaluation (required for custom_code type)
        enum_values:
          type: array
          items:
            type: string
          description: List of possible enum values (required when eval_type is enum)
      required:
        - eval_type
        - name
        - type
  securitySchemes:
    api_key:
      type: apiKey
      name: X-CEKURA-API-KEY
      in: header
      description: >-
        API Key Authentication. It should be included in the header of each
        request.

````