Submit Result
POSThttps://api.confident-ai.com/v2/test-runs/evaluate/{testCaseId}
Submits the result for a single test case in a long-running agent evaluation. Confident AI evaluates the test case and finalizes the test run once every result has been received; a repeated submission for the same test case is ignored and reported as already_received. Long-running mode is available for single-turn AI connection evaluations only. Responds 410 when the testCaseId is unknown or its result window has closed, 404 when its test run is not in this project, 409 when the test run is no longer accepting results, and 400 when the test run is multi-turn or has no metric collection.
curl -X POST "https://api.confident-ai.com/v2/test-runs/evaluate/{testCaseId}" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"actualOutput": "Mount Everest is 8,848 metres tall.",
"retrievalContext": [
"Everest is 8,848 metres tall."
],
"toolsCalled": [
{
"name": "get_landmark_info",
"type": "FUNCTION",
"description": "This tool gives information about a mountain.",
"inputParameters": {
"mountain": "Everest"
},
"output": "8,848 metres",
"reasoning": "The user asked for the height of a mountain."
}
],
"expectedTools": [
{
"name": "get_landmark_info",
"type": "FUNCTION",
"description": "This tool gives information about a mountain.",
"inputParameters": {
"mountain": "Everest"
},
"output": "8,848 metres",
"reasoning": "The user asked for the height of a mountain."
}
],
"tokenCost": 0.002,
"inputTokenCount": 24,
"outputTokenCount": 12,
"metadata": {
"region": "Nepal"
}
}'{
"success": true,
"data": {
"testCaseId": "<TEST-CASE-ID>",
"status": "accepted"
},
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Path parameters
testCaseIdstringRequiredThe test case id Confident AI sent to your AI connection as
confident.testCaseIdwhen it dispatched this golden.
Request body
actualOutputstringThe actual output produced by your agent.
retrievalContextlist of stringsThe retrieval context your agent used, if any.
toolsCalledlist of objectsThe tools your agent called while producing the output.
Show 6 propertiesHide 6 properties
namestringRequiredThis is the name of the tool.
typeenumThe type of the tool call, either a function or an MCP tool.
Show 2 enum valuesHide 2 enum values
FUNCTIONMCP
descriptionstringThis is the description of the tool.
inputParametersobject | nullThis is the input parameters that are passed to the tool.
outputanyThis is the output of the tool.
reasoningstringThis is the reasoning your LLM provided for the tool call.
expectedToolslist of objectsThe tools you expected to be called for this test case.
Show 6 propertiesHide 6 properties
namestringRequiredThis is the name of the tool.
typeenumThe type of the tool call, either a function or an MCP tool.
Show 2 enum valuesHide 2 enum values
FUNCTIONMCP
descriptionstringThis is the description of the tool.
inputParametersobject | nullThis is the input parameters that are passed to the tool.
outputanyThis is the output of the tool.
reasoningstringThis is the reasoning your LLM provided for the tool call.
tokenCostnumberThis is the cost of the tokens used to produce the output.
inputTokenCountintegerThis is the number of input tokens passed to the LLM model.
outputTokenCountintegerThis is the number of output tokens generated by the LLM model.
metadataobjectOptional additional metadata to attach to the test case.
Response
Submit Result succeeded.
successbooleanIndicates if the request was successful.
dataobjectThe recorded test case id and whether its result was accepted.
Show 2 propertiesHide 2 properties
testCaseIdstringThe test case id the result was recorded for.
statusenumacceptedwhen the result was queued for evaluation;already_receivedwhen a result for this test case had already been recorded and this retry was ignored.Show 2 enum valuesHide 2 enum values
acceptedalready_received
deprecatedbooleanIndicates if this endpoint is deprecated.