Run Dataset Evaluation
POSThttps://api.confident-ai.com/v1/datasets/{alias}/run
Starts an evaluation of a dataset's finalized goldens against a metric collection asynchronously, then returns a link to the test run.
Optionally generate the outputs on the fly with either an AI connection or a prompt (by alias and commit) — provide at most one. When not provided, the goldens' stored actual outputs are evaluated by default.
curl -X POST "https://api.confident-ai.com/v1/datasets/{alias}/run" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"metricCollection": "Answer Quality",
"identifier": "Nightly regression"
}'{
"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"
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Path parameters
aliasstringRequiredThe unique alias of the dataset to evaluate.
Request body
metricCollectionstringRequiredThe name of the metric collection to evaluate against.
identifierstringAn optional label for the resulting test run.
versionstringThe dataset version to evaluate. Defaults to the latest version.
aiConnectionIdstringThe ID of the AI connection used to generate outputs, you can find this in the Project Settings → AI Connections on the platform. Required for
AI_CONNECTIONmode.promptAliasstringThe alias of the prompt used to generate outputs. Required for
PROMPTmode.promptCommitstringThe prompt commit hash to generate with. Defaults to the latest commit on the prompt's main branch.
generationModeenumThe generation source. Optional when at most one of
aiConnectionIdorpromptAliasis provided.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 a dataset custom column key. Only applies when generating from a prompt.includeSimulationbooleanWhether to simulate a conversation per golden before evaluating, for multi-turn datasets. Goldens need a
scenariowhen this is enabled, andturnswhen it is disabled.maxConcurrentGenerationintegerThe maximum number of generation calls to run in parallel. An AI connection's own concurrency limit takes precedence over this.
generationTimeoutintegerThe number of seconds to wait for a generation before it is marked as errored.
numGenerationsintegerThe number of times to run each golden. Defaults to the AI connection's configured default, otherwise 1.
mcpServerIdslist of stringsThe IDs of the MCP servers to attach. A tool call whose name matches a tool exposed by one of these servers is labeled an MCP tool call instead of a function call.
Response
successbooleanIndicates if the evaluation was started.
dataobjectShow 2 propertiesHide 2 properties
idstringThe unique identifier of the created test run.
testCaseCountintegerThe number of test cases the evaluation was started with.
linkstringA link to view the test run.