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

# List test metrics

> Returns the metrics available in your organization, optionally filtered by test agent. Each metric scores one aspect of a conversation or scenario run.



## OpenAPI

````yaml /openapi/source/external/inference/inference-ai-tests.json get /ai/tests/test_framework/v1/metrics
openapi: 3.1.0
info:
  version: 2.0.0
  title: Telnyx API
  x-latency-category: responsive
  x-endpoint-cost: light
  description: SIP trunking, SMS, MMS, Call Control and Telephony Data Services.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
    description: Version 2.0.0 of the Telnyx API
security:
  - bearerAuth: []
tags:
  - name: AI Tests
    description: >-
      Test agents, evaluator scenarios, metrics, and run results for the AI test
      framework.
paths:
  /ai/tests/test_framework/v1/metrics:
    get:
      tags:
        - AI Tests
      summary: List test metrics
      description: >-
        Returns the metrics available in your organization, optionally filtered
        by test agent. Each metric scores one aspect of a conversation or
        scenario run.
      operationId: list_test_metrics
      parameters:
        - name: agent_id
          in: query
          required: false
          description: Filter metrics attached to the specified test agent.
          schema:
            type: integer
        - name: assistant_id
          in: query
          required: false
          description: Filter metrics attached to the specified Telnyx assistant.
          schema:
            type: string
      responses:
        '200':
          description: List of test metrics.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiTestMetricListResponse'
              example:
                - id: 266881
                  slug: ai_interrupting_user
                  project: 16003
                  agent: null
                  agents: []
                  agent_names: []
                  name: AI interrupting user
                  description: >-
                    Tells if the AI (main agent) interrupted user (testing
                    agent) during the interaction.
                  function_name: get_main_agent_interruption
                  type: custom_code
                  eval_type: numeric
                  enum_values: []
                  audio_enabled: false
                  observability_enabled: true
                  simulation_enabled: true
                  sampling_enabled: false
                  sample_rate: null
                  prompt: ''
                  display_order: 1
                  evaluation_trigger: always
                  trigger_type: llm_judge
                  evaluation_trigger_prompt: ''
                  evaluation_trigger_custom_code: ''
                  priority_assignment_prompt: ''
                  configuration: {}
                  overall_score: 0
                  total_score: 0
                  kb_file_ids: []
                  knowledge_base_files: []
                  metric_cost: 0
                  alert_type: disabled
                  significant_change_alert_status: disabled
                  significant_change_alert_direction: ''
                  window_size: 50
                  std_multiplier: 2
                  ewma_alpha: 0.1
                  add_to_new_agents: true
                  alert_filters: {}
                  uses_llm_judge: false
                  user_defined: false
        '400':
          description: Bad Request. The AI Tests service rejected the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiTestsErrorResponse'
              example:
                errors:
                  - code: '10015'
                    title: Bad Request
                    detail: The AI Tests service rejected the request.
        '401':
          description: Unauthorized. Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiTestsErrorResponse'
              example:
                errors:
                  - code: '10003'
                    title: Unauthorized
                    detail: The API key is missing or invalid.
        '404':
          description: >-
            Not Found. The requested resource does not exist or is not enabled
            for your account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiTestsErrorResponse'
              example:
                errors:
                  - code: '10005'
                    title: Not Found
                    detail: The requested resource or URL could not be found.
        '422':
          description: Unprocessable Entity. A validation error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiTestsErrorResponse'
              example:
                errors:
                  - code: '10018'
                    title: Unprocessable Entity
                    detail: Validation failed for the request payload.
        '429':
          description: Too Many Requests. The AI Tests service rate-limited the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiTestsErrorResponse'
              example:
                errors:
                  - code: '10029'
                    title: Too Many Requests
                    detail: Too many requests; retry later.
        '503':
          description: Service Unavailable. The AI Tests service is unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiTestsErrorResponse'
              example:
                errors:
                  - code: '10063'
                    title: Service Unavailable
                    detail: The test framework service is temporarily unavailable.
components:
  schemas:
    AiTestMetricListResponse:
      type: array
      items:
        $ref: '#/components/schemas/AiTestMetric'
      example:
        - id: 266881
          slug: ai_interrupting_user
          project: 16003
          agent: null
          agents: []
          agent_names: []
          name: AI interrupting user
          description: >-
            Tells if the AI (main agent) interrupted user (testing agent) during
            the interaction.
          function_name: get_main_agent_interruption
          type: custom_code
          eval_type: numeric
          enum_values: []
          audio_enabled: false
          observability_enabled: true
          simulation_enabled: true
          sampling_enabled: false
          sample_rate: null
          prompt: ''
          display_order: 1
          evaluation_trigger: always
          trigger_type: llm_judge
          evaluation_trigger_prompt: ''
          evaluation_trigger_custom_code: ''
          priority_assignment_prompt: ''
          configuration: {}
          overall_score: 0
          total_score: 0
          kb_file_ids: []
          knowledge_base_files: []
          metric_cost: 0
          alert_type: disabled
          significant_change_alert_status: disabled
          significant_change_alert_direction: ''
          window_size: 50
          std_multiplier: 2
          ewma_alpha: 0.1
          add_to_new_agents: true
          alert_filters: {}
          uses_llm_judge: false
          user_defined: false
    AiTestsErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
                description: Telnyx error code.
              title:
                type: string
              detail:
                type: string
              source:
                type: object
                properties:
                  pointer:
                    type: string
            required:
              - code
              - title
      required:
        - errors
    AiTestMetric:
      type: object
      properties:
        id:
          type: integer
        slug:
          type:
            - string
            - 'null'
          description: Stable identifier of a built-in metric.
        project:
          type:
            - integer
            - 'null'
        agent:
          type:
            - integer
            - 'null'
        agents:
          type: array
          items:
            type: integer
          description: Test agent IDs the metric is attached to.
        agent_names:
          type: array
          items:
            type: string
        name:
          type: string
        description:
          type: string
        function_name:
          type:
            - string
            - 'null'
          description: Built-in evaluation function used by custom_code metrics.
        type:
          type: string
          description: 'How the metric is evaluated: custom_code or llm_judge.'
        eval_type:
          type: string
          description: >-
            What the metric scores: numeric, continuous_qualitative, or
            binary_workflow_adherence.
        enum_values:
          type: array
          items:
            type: string
          description: Allowed values for qualitative enum metrics.
        audio_enabled:
          type: boolean
        observability_enabled:
          type: boolean
        simulation_enabled:
          type: boolean
        sampling_enabled:
          type: boolean
        sample_rate:
          type:
            - number
            - 'null'
        prompt:
          type: string
          description: Judge prompt used by llm_judge metrics.
        display_order:
          type: integer
        evaluation_trigger:
          type: string
        trigger_type:
          type: string
        evaluation_trigger_prompt:
          type: string
        evaluation_trigger_custom_code:
          type: string
        priority_assignment_prompt:
          type: string
        configuration:
          type:
            - object
            - 'null'
          additionalProperties: true
        overall_score:
          type:
            - number
            - string
        total_score:
          type:
            - number
            - string
        kb_file_ids:
          type: array
          items:
            type: integer
        knowledge_base_files:
          type: array
          items:
            type: string
        metric_cost:
          type: number
        alert_type:
          type: string
        significant_change_alert_status:
          type: string
        significant_change_alert_direction:
          type: string
        window_size:
          type: integer
          description: Sliding window size the alert status is computed over.
        std_multiplier:
          type: number
          description: Standard-deviation multiplier for significant-change alerts.
        ewma_alpha:
          type: number
          description: Smoothing factor for the alert trend.
        add_to_new_agents:
          type:
            - boolean
            - 'null'
          description: >-
            Whether the metric is attached to newly created test agents by
            default.
        alert_filters:
          type:
            - object
            - 'null'
          additionalProperties: true
        uses_llm_judge:
          type: boolean
        user_defined:
          type: boolean
      required:
        - id
        - name
        - type
        - eval_type
      example:
        id: 266881
        slug: ai_interrupting_user
        project: 16003
        agent: null
        agents: []
        agent_names: []
        name: AI interrupting user
        description: >-
          Tells if the AI (main agent) interrupted user (testing agent) during
          the interaction.
        function_name: get_main_agent_interruption
        type: custom_code
        eval_type: numeric
        enum_values: []
        audio_enabled: false
        observability_enabled: true
        simulation_enabled: true
        sampling_enabled: false
        sample_rate: null
        prompt: ''
        display_order: 1
        evaluation_trigger: always
        trigger_type: llm_judge
        evaluation_trigger_prompt: ''
        evaluation_trigger_custom_code: ''
        priority_assignment_prompt: ''
        configuration: {}
        overall_score: 0
        total_score: 0
        kb_file_ids: []
        knowledge_base_files: []
        metric_cost: 0
        alert_type: disabled
        significant_change_alert_status: disabled
        significant_change_alert_direction: ''
        window_size: 50
        std_multiplier: 2
        ewma_alpha: 0.1
        add_to_new_agents: true
        alert_filters: {}
        uses_llm_judge: false
        user_defined: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````