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

# Retrieve a test agent

> Returns the specified test agent.



## OpenAPI

````yaml /openapi/source/external/inference/inference-ai-tests.json get /ai/tests/test_framework/v1/aiagents/{id}
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/aiagents/{id}:
    get:
      tags:
        - AI Tests
      summary: Retrieve a test agent
      description: Returns the specified test agent.
      operationId: retrieve_test_agent
      parameters:
        - name: id
          in: path
          required: true
          description: Numeric ID of the test agent.
          schema:
            type: integer
      responses:
        '200':
          description: Test agent detail.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestAgent'
              example:
                id: 1259
                agent_name: Support Bot Under Test
                contact_number: '+13125550123'
                inbound: false
                description: Evaluates the support assistant against generated callers.
                language: en
                assistant_id: e1a2b3c4-d5e6-f7a8-b9c0-d1e2f3a4b5c6
                chat_assistant_id: ''
                llm_system_prompt: You are calling a customer support line.
                llm_model: openai/gpt-oss-120b
                llm_temperature: 0.7
                llm_max_tokens: 512
                outbound_auto_call: false
                sip_endpoint: ''
                sip_auth: null
                knowledge_base_files: []
                enabled_personalities:
                  - 4567
                auto_update_dropoff_nodes: false
                auto_update_topic_nodes: false
                hallucination_metric_kb_files: []
                outbound_numbers: []
                created_at: '2026-10-13T18:04:05.123456Z'
                updated_at: '2026-10-13T18:04:05.123456Z'
        '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.
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Telnyx from 'telnyx';


            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });


            const TestAgent = await
            client.ai.tests.testFramework.v1.aiagents.retrieve('id');


            console.log(TestAgent.id);
        - lang: Python
          source: |
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            test_agent = client.ai.tests.test_framework.v1.aiagents.retrieve(
                "id",
            )
            print(test_agent.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\taiagent, err := client.AI.Tests.TestFramework.V1.Aiagents.Get(\n\t\tcontext.TODO(),\n\t\t\"id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", aiagent.Data)\n}\n"
        - lang: Java
          source: |-
            package com.telnyx.sdk.example;

            import com.telnyx.sdk.client.TelnyxClient;
            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    var response = client.ai().tests().testFramework().v1().aiagents().retrieve("id");
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


            telnyx = Telnyx::Client.new(api_key: "My API Key")


            test_agent =
            telnyx.ai.tests.test_framework.v1.aiagents.retrieve("id")


            puts(test_agent)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Telnyx\Client;

            use Telnyx\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API
            Key');


            try {
              $test_agent = $client->ai->tests->testFramework->v1->aiagents->retrieve(
                'id',
              );

              var_dump($test_agent);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx ai:tests:test-framework:v1:aiagents retrieve \
              --api-key 'My API Key' \
              --id id
components:
  schemas:
    TestAgent:
      type: object
      properties:
        id:
          type: integer
        agent_name:
          type: string
          description: Name of the test agent.
        contact_number:
          type: string
          description: Contact phone number for the test agent.
        inbound:
          type: boolean
          description: Whether the test agent accepts inbound calls.
        description:
          type: string
        language:
          type: string
          description: ISO language code the test agent converses in.
        assistant_id:
          type: string
          description: ID of the Telnyx AI assistant under test.
        chat_assistant_id:
          type: string
          description: ID of the chat assistant under test, when testing text channels.
        llm_system_prompt:
          type: string
        llm_model:
          type: string
          description: Model used to drive the test agent's side of the conversation.
        llm_temperature:
          type: number
        llm_max_tokens:
          type: integer
        outbound_auto_call:
          type: boolean
        sip_endpoint:
          type: string
        sip_auth:
          type:
            - object
            - 'null'
          additionalProperties:
            type: string
        knowledge_base_files:
          type: array
          items: {}
          description: Knowledge-base files associated with the test agent.
        enabled_personalities:
          type: array
          items:
            type: integer
          description: IDs of the test personalities enabled for this agent.
        auto_update_dropoff_nodes:
          type: boolean
        auto_update_topic_nodes:
          type: boolean
        hallucination_metric_kb_files:
          type: array
          items:
            type: integer
        outbound_numbers:
          type:
            - array
            - 'null'
          items: {}
          description: Outbound numbers associated with the test agent.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - agent_name
        - assistant_id
        - created_at
        - updated_at
      example:
        id: 1259
        agent_name: Support Bot Under Test
        contact_number: '+13125550123'
        inbound: false
        description: Evaluates the support assistant against generated callers.
        language: en
        assistant_id: e1a2b3c4-d5e6-f7a8-b9c0-d1e2f3a4b5c6
        chat_assistant_id: ''
        llm_system_prompt: You are calling a customer support line.
        llm_model: openai/gpt-oss-120b
        llm_temperature: 0.7
        llm_max_tokens: 512
        outbound_auto_call: false
        sip_endpoint: ''
        sip_auth: null
        knowledge_base_files: []
        enabled_personalities:
          - 4567
        auto_update_dropoff_nodes: false
        auto_update_topic_nodes: false
        hallucination_metric_kb_files: []
        outbound_numbers: []
        created_at: '2026-10-13T18:04:05.123456Z'
        updated_at: '2026-10-13T18:04:05.123456Z'
    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

````