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

# Run evaluator scenarios

> Runs the selected evaluator scenarios against their test agents and creates a run batch. Returns the ID of the created batch, whose results can be listed with the test-run-results endpoints.



## OpenAPI

````yaml /openapi/source/external/inference/inference-ai-tests.json post /ai/tests/test_framework/v1/scenarios/run_scenarios
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/scenarios/run_scenarios:
    post:
      tags:
        - AI Tests
      summary: Run evaluator scenarios
      description: >-
        Runs the selected evaluator scenarios against their test agents and
        creates a run batch. Returns the ID of the created batch, whose results
        can be listed with the test-run-results endpoints.
      operationId: run_evaluator_scenarios
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunScenariosRequest'
            example:
              agent_id: 1259
              scenarios:
                - 9512
              tags:
                - regression
              mode: same_number
              concurrency_limit: 3
      responses:
        '200':
          description: Run batch created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunScenariosResponse'
              example:
                status: in_queue
                id: 10119
        '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:
    RunScenariosRequest:
      type: object
      properties:
        agent_id:
          type: integer
        assistant_id:
          type: string
        scenarios:
          type:
            - array
            - string
          items: {}
          description: Scenario IDs to run, or the literal string 'all'.
        tags:
          type: array
          items:
            type: string
        frequency:
          type: integer
        name:
          type: string
        outbound_phone_number:
          type: string
        personality_ids:
          type: array
          items:
            type: integer
        test_profile_ids:
          type: array
          items:
            type: integer
        mode:
          type: string
          enum:
            - same_number
            - different_numbers
        agent_number:
          type: string
        concurrency_limit:
          type: integer
          description: Maximum number of concurrent simulated calls.
      example:
        agent_id: 1259
        scenarios:
          - 9512
        tags:
          - regression
        mode: same_number
        concurrency_limit: 3
    RunScenariosResponse:
      type: object
      properties:
        status:
          type: string
          description: Initial status of the run batch.
        id:
          type: integer
          description: ID of the created test-run batch whose results can be polled.
      required:
        - id
        - status
      example:
        status: in_queue
        id: 10119
    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
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````