Retrieve a test metric
Returns the specified metric.
curl --request GET \
--url https://api.telnyx.com/v2/ai/tests/test_framework/v1/metrics/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.telnyx.com/v2/ai/tests/test_framework/v1/metrics/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.telnyx.com/v2/ai/tests/test_framework/v1/metrics/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.telnyx.com/v2/ai/tests/test_framework/v1/metrics/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.telnyx.com/v2/ai/tests/test_framework/v1/metrics/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.telnyx.com/v2/ai/tests/test_framework/v1/metrics/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.telnyx.com/v2/ai/tests/test_framework/v1/metrics/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"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
}{
"errors": [
{
"code": "10015",
"title": "Bad Request",
"detail": "The AI Tests service rejected the request."
}
]
}{
"errors": [
{
"code": "10003",
"title": "Unauthorized",
"detail": "The API key is missing or invalid."
}
]
}{
"errors": [
{
"code": "10005",
"title": "Not Found",
"detail": "The requested resource or URL could not be found."
}
]
}{
"errors": [
{
"code": "10018",
"title": "Unprocessable Entity",
"detail": "Validation failed for the request payload."
}
]
}{
"errors": [
{
"code": "10029",
"title": "Too Many Requests",
"detail": "Too many requests; retry later."
}
]
}{
"errors": [
{
"code": "10063",
"title": "Service Unavailable",
"detail": "The test framework service is temporarily unavailable."
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Numeric ID of the metric.
Response
Test metric detail.
How the metric is evaluated: custom_code or llm_judge.
What the metric scores: numeric, continuous_qualitative, or binary_workflow_adherence.
Stable identifier of a built-in metric.
Test agent IDs the metric is attached to.
Built-in evaluation function used by custom_code metrics.
Allowed values for qualitative enum metrics.
Judge prompt used by llm_judge metrics.
Sliding window size the alert status is computed over.
Standard-deviation multiplier for significant-change alerts.
Smoothing factor for the alert trend.
Whether the metric is attached to newly created test agents by default.
Was this page helpful?
curl --request GET \
--url https://api.telnyx.com/v2/ai/tests/test_framework/v1/metrics/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.telnyx.com/v2/ai/tests/test_framework/v1/metrics/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.telnyx.com/v2/ai/tests/test_framework/v1/metrics/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.telnyx.com/v2/ai/tests/test_framework/v1/metrics/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.telnyx.com/v2/ai/tests/test_framework/v1/metrics/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.telnyx.com/v2/ai/tests/test_framework/v1/metrics/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.telnyx.com/v2/ai/tests/test_framework/v1/metrics/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"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
}{
"errors": [
{
"code": "10015",
"title": "Bad Request",
"detail": "The AI Tests service rejected the request."
}
]
}{
"errors": [
{
"code": "10003",
"title": "Unauthorized",
"detail": "The API key is missing or invalid."
}
]
}{
"errors": [
{
"code": "10005",
"title": "Not Found",
"detail": "The requested resource or URL could not be found."
}
]
}{
"errors": [
{
"code": "10018",
"title": "Unprocessable Entity",
"detail": "Validation failed for the request payload."
}
]
}{
"errors": [
{
"code": "10029",
"title": "Too Many Requests",
"detail": "Too many requests; retry later."
}
]
}{
"errors": [
{
"code": "10063",
"title": "Service Unavailable",
"detail": "The test framework service is temporarily unavailable."
}
]
}