Run Evaluation
POSThttps://api.confident-ai.com/v2/datasets/{datasetId}/run
Starts an evaluation of the dataset's finalized goldens against a metric collection and returns the test run it is evaluated in. The evaluation runs asynchronously, so this returns as soon as the run is created. By default the goldens' stored actual outputs are evaluated; supply aiConnectionId or promptAlias, never both, to generate them first.
curl -X POST "https://api.confident-ai.com/v2/datasets/{datasetId}/run" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"metricCollection": "Answer Quality",
"identifier": "Nightly regression",
"version": "00.00.01",
"aiConnectionId": "<AI-CONNECTION-ID>",
"promptAlias": "capital-lookup",
"promptCommit": "bab04ce",
"generationMode": "AI_CONNECTION",
"variablesMapping": {
"question": "Input"
},
"includeSimulation": false,
"maxConcurrentGeneration": 5,
"generationTimeout": 60,
"numGenerations": 1,
"mcpServerIds": [
"<MCP-SERVER-ID>"
]
}'{
"success": true,
"data": {
"id": "<TEST-RUN-ID>",
"testCaseCount": 42
},
"link": "https://app.confident-ai.com/project/<PROJECT-ID>/test-runs/<TEST-RUN-ID>/test-cases",
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Path parameters
datasetIdstringRequiredThe unique id of the dataset.
Request body
metricCollectionstringRequiredThe name of the metric collection to evaluate against. Names come from the list metric collections endpoint.
identifierstringA label for the resulting test run, used to recognise it in the test runs list.
versionstringThe dataset version to evaluate. Omit this field to evaluate the latest version.
aiConnectionIdstringThe id of the AI connection used to generate the actual outputs before evaluating them. Required when
generationModeis AI_CONNECTION, and not allowed together withpromptAlias.promptAliasstringThe alias of the prompt used to generate the actual outputs before evaluating them. Required when
generationModeis PROMPT, and not allowed together withaiConnectionId.promptCommitstringThe prompt commit hash to generate with. Requires
promptAlias. Omit this field to generate with the latest commit on the prompt's main branch.generationModeenumWhere the actual outputs come from when running a dataset: AI_CONNECTION generates them with an AI connection, PROMPT with a prompt. Omit it when you supply at most one of
aiConnectionIdorpromptAlias, and Confident AI infers the mode from whichever you sent.Show 2 enum valuesHide 2 enum values
AI_CONNECTIONPROMPT
variablesMappingobjectMaps each variable in the prompt to the golden field it is interpolated with, such as
InputorExpected Output, or to a dataset custom column key. This field applies only when generating from a prompt.includeSimulationbooleanWhether to simulate a conversation for each golden before evaluating it, for multi-turn datasets. Every golden needs a
scenariowhen this is enabled, andturnswhen it is disabled.maxConcurrentGenerationintegerThe maximum number of generation calls to run in parallel. An AI connection's own
maxConcurrencytakes precedence over this value.generationTimeoutintegerThe number of seconds to wait for a single generation before it is marked as errored.
numGenerationsintegerHow many times to run each golden, so a single outlier response does not skew the results. Omit this field to use the AI connection's
defaultNumGenerations, which is 1 when the connection does not set one.mcpServerIdslist of stringsThe ids of the MCP servers to attach to the run. A tool call whose name matches a tool exposed by one of these servers is labeled an MCP tool call rather than a function call.
Response
Run Evaluation succeeded.
successbooleanIndicates if the request was successful.
dataobjectShow 2 propertiesHide 2 properties
idstringThis is the unique id of the test run the dataset is evaluated in, generated by Confident AI and not to be confused with the identifier you supplied.
testCaseCountintegerThe number of test cases the evaluation was started with.
linkstringThis is the URL of the resource on the Confident AI platform.
deprecatedbooleanIndicates if this endpoint is deprecated.