Retrieve Test Run
GEThttps://api.confident-ai.com/v1/test-runs/{testRunId}
Retrieves a list of test cases and their respective metrics from a test run.
curl -X GET "https://api.confident-ai.com/v1/test-runs/{testRunId}" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>"{
"success": true,
"data": {
"metricsScores": [
{
"metric": "Answer Correctness",
"scores": [
0
],
"passes": 0,
"fails": 1,
"errors": 0
}
],
"traceMetricsScores": [],
"conversational": false,
"identifier": "test-run-001",
"status": "COMPLETED",
"testsPassed": 0,
"testsFailed": 1,
"totalTests": 1,
"runDuration": 1.5,
"testCases": [
{
"id": "TEST-CASE-ID",
"name": "Test Case 1",
"input": "What's the capital of France?",
"expectedOutput": "Paris",
"actualOutput": "San Francisco",
"success": false,
"context": [
"The capital of France is Paris."
],
"retrievalContext": [
"The capital of France is Paris."
],
"runDuration": 1.2,
"evaluationCost": 0.001,
"metricsData": [
{
"id": "METRIC-ID",
"score": 0,
"reason": "The capital of France is Paris.",
"success": false,
"threshold": 0.5,
"evaluationModel": "gpt-4.1",
"strictMode": false,
"evaluationCost": 0.001,
"name": "Answer Correctness",
"verboseLogs": "..."
}
]
}
]
},
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Path parameters
testRunIdstringRequiredThe id of the test run you want to retrieve.
Response
successbooleanThis is true if the test run was successfully retrieved.
dataobjectShow 9 propertiesHide 9 properties
metricsScoreslist of objectsThe aggregated metric scores across all test cases.
Show 5 propertiesHide 5 properties
failsnumberThis is the number of times this metric failed to pass the threshold.
errorsnumberThis is the number of times this metric errored during evaluation.
metricstringThis is the name of the metric.
passesnumberThis is the number of times this metric passed the threshold.
scoreslist of numbersThis is an array of scores for the metric across test cases.
testCaseslist of object | objectThe test cases in this test run. Will contain either single-turn test cases or conversational test cases, but not both.
Show 2 variantsHide 2 variants
LLMTestCaseobjectShow 16 propertiesHide 16 properties
idstringThis is the id of the test case generated by Confident AI.
namestringThis is the name of the test case.
inputstringThis is the input of the test case.
actualOutputstringThis is the actual output of the test case.
contextlist of stringsThis is the context of the test case.
retrievalContextlist of stringsThis is the retrieval context of the test case.
expectedOutputstringThis is the expected output of the test case.
toolsCalledlist of objectsThis is the tools called of the test case.
Show 5 propertiesHide 5 properties
namestringThis is the name of the tool.
descriptionstringThis is the description of the tool.
inputParametersobjectThis is the input parameters that are passed to the tool.
outputstringThis is the output of the tool.
reasoningstringThis is the reasoning your LLM provided for the tool call.
expectedToolslist of objectsThis is the expected tools of the test case.
Show 5 propertiesHide 5 properties
namestringThis is the name of the tool.
descriptionstringThis is the description of the tool.
inputParametersobjectThis is the input parameters that are passed to the tool.
outputstringThis is the output of the tool.
reasoningstringThis is the reasoning your LLM provided for the tool call.
metricsDatalist of objectsThe metric evaluation results for this test case.
Show 21 propertiesHide 21 properties
idstringThe unique identifier of the metrics data entry.
projectIdstringThe project this metric data belongs to.
traceUuidstringThe UUID of the trace this metric data is associated with, if any.
spanUuidstringThe UUID of the span this metric data is associated with, if any.
testCaseIdstringThe ID of the test case this metric data is associated with, if any.
testRunIdstringThe ID of the test run this metric data is associated with, if any.
threadIdstringThe ID of the thread this metric data is associated with, if any.
namestringThe name of the metric.
multiTurnbooleanWhether this metric was evaluated on a multi-turn conversation.
scorenumberThe final metric score.
reasonstringThe reason for the metric score, generated by the evaluation model at evaluation time.
successbooleanWhether the metric score is above the threshold.
createdAtstringThe time the metric data was created.
evaluatedAtstringThe time the metric was evaluated.
thresholdnumberThe threshold for the metric, which determines if the metric is passing or failing.
strictModebooleanWhether the metric was run in strict mode, which outputs a binary score of 0 or 1.
skippedbooleanWhether the metric evaluation was skipped.
evaluationModelstringThe evaluation model used to run the evaluation.
errorstringThe error message if the evaluation failed.
evaluationCostnumberThe cost of running the evaluation.
verboseLogsstringThe verbose logs of the evaluation, which breaks down the metric score calculation into individual steps.
commentsstringAny comments associated with this test case.
additionalMetadataobjectAdditional metadata associated with this test case.
successbooleanWhether this test case passed all metric thresholds.
runDurationnumberThe duration of the test case evaluation in seconds.
evaluationCostnumberThe cost of evaluating this test case.
traceobjectThis is the trace dictionary of a test case.
Show 21 propertiesHide 21 properties
uuidstringThis is the unique identifier of the trace.
namestringThis is the name of the trace.
inputstringThis is the input to the trace.
outputstringThis is the output of the trace.
startTimestringThis is the time the trace started.
endTimestringThis is the time the trace ended.
environmentenumThis is the environment where your trace was posted, which helps with separating and debugging traces from different environments on the Confident AI platform.
Show 4 enum valuesHide 4 enum values
productiondevelopmentstagingtesting
metadataobjectThis is any additional metadata associated with the trace.
tagslist of stringsThis is any tags associated with the trace, which helps with grouping traces and filtering them on the Confident AI platform.
spanslist of object | object | object | object | objectThis is the list of base spans associated with the trace.
Show 5 variantsHide 5 variants
BaseSpanobject- OR
LlmSpanobject- OR
RetrieverSpanobject- OR
ToolSpanobject- OR
AgentSpanobject
threadIdstringThis is the unique identifier of the thread associated with the trace.
threadobjectThread-level fields applied to the thread record.
thread.idis an alternate way to specify the thread (must match top-levelthreadIdif both are provided).metadataandtagsonly take effect when a thread id is resolvable; successive ingestions merge metadata keys, while tags replace any prior value.Show 3 propertiesHide 3 properties
idstringThe thread id. Equivalent to top-level
threadId; if both are set they must match.metadataobjectCustom key/value metadata to attach to the thread. Values can be any JSON-serializable type and are stringified server-side. Successive ingestions for the same thread merge metadata keys.
tagslist of stringsTags to set on the thread. Replaces any previously stored tags.
userIdstringThis is the unique identifier for your end user for the trace.
metricCollectionstringThis is the metric collection you wish to use to evaluate the trace.
testRunIdstringThis is the unique identifier of the test run to associate the trace with. When set, the trace becomes one test case in that test run, and
metricCollectionis required. Create a test run with thePOST /v1/test-runsendpoint to get this id.retrievalContextlist of stringsThis is the retrieval context of your trace, which is to be used for evaluation.
contextlist of stringsThis is the ideal retrieval context of your trace, which is to be used for evaluation.
expectedOutputstringThis is the expected output of your trace, which is the ideal actual output and to be used for evaluation.
toolsCalledlist of objectsThis is the tools called by your trace, which is to be used for evaluation.
Show 5 propertiesHide 5 properties
namestringThis is the name of the tool.
descriptionstringThis is the description of the tool.
inputParametersobjectThis is the input parameters that are passed to the tool.
outputstringThis is the output of the tool.
reasoningstringThis is the reasoning your LLM provided for the tool call.
expectedToolslist of objectsThis is the expected tools to be called by the trace, which is to be used for evaluation.
Show 5 propertiesHide 5 properties
namestringThis is the name of the tool.
descriptionstringThis is the description of the tool.
inputParametersobjectThis is the input parameters that are passed to the tool.
outputstringThis is the output of the tool.
reasoningstringThis is the reasoning your LLM provided for the tool call.
attachmentsobjectMap of attachment ids to payloads for all
[DEEPEVAL:IMAGE:…]and[DEEPEVAL:PDF:…]markers in this trace. Define attachments at the trace level with same ids for same instances.
- OR
ConversationalTestCaseobjectShow 13 propertiesHide 13 properties
idstringThis is the id of the conversational test case generated by Confident AI.
namestringThis is the name of the conversational test case.
turnslist of objectsThe list of turns in the conversation.
Show 4 propertiesHide 4 properties
roleenumThe role of the turn, either user or assistant.
Show 2 enum valuesHide 2 enum values
userassistant
contentstringThe message content of the turn.
toolsCalledlist of objectsThe tools called to generate the LLM response for this turn.
Show 5 propertiesHide 5 properties
namestringThis is the name of the tool.
descriptionstringThis is the description of the tool.
inputParametersobjectThis is the input parameters that are passed to the tool.
outputstringThis is the output of the tool.
reasoningstringThis is the reasoning your LLM provided for the tool call.
retrievalContextlist of stringsThe contexts retrieved to generate the LLM response for this turn.
scenariostringA description of the conversation context.
expectedOutcomestringThe expected outcome or ideal conversation flow.
userDescriptionstringA description of the user in the conversation.
contextlist of stringsThe context provided for the conversation.
commentsstringAny comments associated with this test case.
additionalMetadataobjectAdditional metadata associated with this test case.
metricsDatalist of objectsThe metric evaluation results for this test case.
Show 21 propertiesHide 21 properties
idstringThe unique identifier of the metrics data entry.
projectIdstringThe project this metric data belongs to.
traceUuidstringThe UUID of the trace this metric data is associated with, if any.
spanUuidstringThe UUID of the span this metric data is associated with, if any.
testCaseIdstringThe ID of the test case this metric data is associated with, if any.
testRunIdstringThe ID of the test run this metric data is associated with, if any.
threadIdstringThe ID of the thread this metric data is associated with, if any.
namestringThe name of the metric.
multiTurnbooleanWhether this metric was evaluated on a multi-turn conversation.
scorenumberThe final metric score.
reasonstringThe reason for the metric score, generated by the evaluation model at evaluation time.
successbooleanWhether the metric score is above the threshold.
createdAtstringThe time the metric data was created.
evaluatedAtstringThe time the metric was evaluated.
thresholdnumberThe threshold for the metric, which determines if the metric is passing or failing.
strictModebooleanWhether the metric was run in strict mode, which outputs a binary score of 0 or 1.
skippedbooleanWhether the metric evaluation was skipped.
evaluationModelstringThe evaluation model used to run the evaluation.
errorstringThe error message if the evaluation failed.
evaluationCostnumberThe cost of running the evaluation.
verboseLogsstringThe verbose logs of the evaluation, which breaks down the metric score calculation into individual steps.
successbooleanWhether this test case passed all metric thresholds.
runDurationnumberThe duration of the test case evaluation in seconds.
evaluationCostnumberThe cost of evaluating this test case.
multiTurnbooleanWhether this test run contains multi-turn test cases.
identifierstringA unique identifier for the test run.
statusenumThe current status of the test run.
Show 4 enum valuesHide 4 enum values
IN_PROGRESSCOMPLETEDERROREDCANCELLED
testsPassednumberThe number of test cases that passed.
testsFailednumberThe number of test cases that failed.
totalTestsnumberThe total number of test cases in this test run.
runDurationnumberThe total duration of the test run in seconds.
deprecatedbooleanThis is true if this endpoint is deprecated.