List Metric Versions
(v2)GET
Lists a custom metric's definition history, newest first, so the first entry is the definition new evaluations run. Versions are append-only: updating a metric with a changed definition adds one, and an update that changes nothing adds none.
curl -X GET "https://api.confident-ai.com/v2/metrics/{metricId}/versions" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>"{
"success": true,
"data": {
"versions": [
{
"id": "<METRIC-VERSION-ID>",
"version": "00.00.02",
"sequence": 2,
"createdAt": "2025-01-18T16:45:00.000Z",
"algorithm": "DEFAULT",
"criteria": "Determine if the actual output is correct based on the expected output.",
"evaluationSteps": null,
"rubric": [
{
"scoreRange": [
8,
10
],
"expectedOutcome": "The answer is factually correct and complete."
}
],
"dag": {
"nodes": {
"root": {
"type": "BinaryJudgementNode",
"criteria": "Does the actual output answer the input?",
"evaluation_params": [
"input",
"actual_output"
],
"children": [
"pass",
"fail"
]
},
"pass": {
"type": "VerdictNode",
"verdict": true,
"score": 10
},
"fail": {
"type": "VerdictNode",
"verdict": false,
"score": 0
}
}
},
"questions": [
{
"type": "noul",
"question": "Does the actual output answer the input?",
"weight": 2
}
],
"promptConfig": {
"messages": [
{
"role": "system",
"content": "You grade support answers."
},
{
"role": "user",
"content": "QUESTION: {{question}}\nANSWER: {{answer}}"
}
],
"variables": {
"question": {
"field": "input",
"path": [
"messages",
0,
"content"
]
},
"answer": {
"field": "output",
"path": [
"messages",
-1,
"content"
]
}
}
},
"requireInput": false,
"requireActualOutput": false,
"requireExpectedOutput": false,
"requireContext": false,
"requireExpectedTools": false,
"requireContent": false,
"requireRole": false,
"requireScenario": false,
"requireExpectedOutcome": false,
"requireAudio": false,
"requireRetrievalContext": false,
"requireToolsCalled": false,
"requireMetadata": false,
"requireTags": false,
"codeDefinition": {
"language": "PYTHON",
"code": "def measure(test_case): return 1.0"
}
}
],
"totalMetricVersions": 2,
"page": 1,
"pageSize": 25
},
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Path parameters
metricIdstringRequiredThe unique id of the metric.
Query parameters
pageintegerdefault: 1The page to return. Defaults to 1.
pageSizeintegerdefault: 25The number of versions per page, at most 100. Defaults to 25.
Response
List Metric Versions succeeded.
successbooleanIndicates if the request was successful.
dataobjectOne page of a metric's definition history, with the total across all pages.
Show 4 propertiesHide 4 properties
versionslist of objectsThe metric's definition history for the current page, newest version first, so the first entry of the first page is the current definition.
Show 26 propertiesHide 26 properties
idstringThis is the unique id of the version.
versionstringThis is the human-readable label for
sequence, written as three two-digit groups that roll over at 100, so sequence 2 is00.00.02and sequence 100 is00.01.00.sequenceintegerThis is the position of the version in the metric's history, counting from 1. The highest sequence is the definition new evaluations run.
createdAtstringThis is when the version was saved.
algorithmenum | nullThe algorithm the metric is evaluated with.
GEVALscores against criteria or evaluation steps,DAGwalks a decision graph,JEVALasks a decision model bounded questions,PROMPTsends your own judge prompt to the evaluation model,CODEruns your own code, andDEFAULTis a built-in metric.Show 6 enum valuesHide 6 enum values
DEFAULTDAGGEVALJEVALCODEPROMPT
criteriastring | nullThis is the criteria the version scores against, or null when it uses evaluation steps.
evaluationStepsarray | nullThese are the steps the version follows to score, or null when it uses criteria.
rubricarray | nullThese are the score ranges that anchor how the version scores, or null.
Show 2 propertiesHide 2 properties
scoreRangelist of anyThe inclusive start and end of the score range this outcome describes, each between 0 and 10, with the start no greater than the end.
expectedOutcomestringWhat a response scoring in this range looks like.
dagobject | nullThe decision graph of a
DAGmetric. It is validated on write, and metric references are resolved against the metrics in your project.Show 1 propertyHide 1 property
nodesobjectThe graph's nodes keyed by node id, as serialized by deepeval's
DAGmetric. Judgement nodes list theirchildrenby id; verdict nodes carry averdictand ascore, or point at another metric bymetric_name.
questionslist of object | object | object | nullShow 3 variantsHide 3 variants
Jev Noul QuestionobjectA question the decision model answers
trueorfalse.trueDescriptionandfalseDescriptiontell it what each answer means.Show 5 propertiesHide 5 properties
typeenumMarks this as a
noulquestion.Show 1 enum valueHide 1 enum value
noul
questionstringThe question the decision model answers.
weightnumberHow heavily this question counts towards the metric's score, relative to the metric's other questions.
trueDescriptionstringWhat a
trueanswer to this question means.falseDescriptionstringWhat a
falseanswer to this question means.
- OR
Jev Score QuestionobjectA question the decision model answers by picking one of
levels, which are ordered worst first.Show 4 propertiesHide 4 properties
typeenumMarks this as a
scorequestion.Show 1 enum valueHide 1 enum value
score
questionstringThe question the decision model answers.
weightnumberHow heavily this question counts towards the metric's score, relative to the metric's other questions.
levelslist of stringsBetween 2 and 10 ordered levels, worst first.
- OR
Jev Choice QuestionobjectA question the decision model answers by picking one of
options, each carrying the credit that answer earns.Show 4 propertiesHide 4 properties
typeenumMarks this as a
choicequestion.Show 1 enum valueHide 1 enum value
choice
questionstringThe question the decision model answers.
weightnumberHow heavily this question counts towards the metric's score, relative to the metric's other questions.
optionsobjectEach option maps to a credit between 0 and 1, or
nullto mark the question not applicable when that option is likely.
promptConfigobject | nullThe judge prompt of a
PROMPTmetric, and how its variables are filled. The judge scores from 0 to 10 and the score is normalized to 0 to 1.Show 2 propertiesHide 2 properties
messageslist of objectsThe judge prompt, as one or more messages.
Show 2 propertiesHide 2 properties
roleenumWho the message is from. A system message is only allowed first.
Show 3 enum valuesHide 3 enum values
systemuserassistant
contentstringThe message text. Use
{{name}}to insert a mapped variable.
variablesobjectMaps every
{{name}}used in the messages to the data it is filled with.
requireInputbooleanThis is true when the metric needs the test case's
input.requireActualOutputbooleanThis is true when the metric needs the test case's
actualOutput.requireExpectedOutputbooleanThis is true when the metric needs the test case's
expectedOutput.requireContextbooleanThis is true when the metric needs the test case's
context.requireExpectedToolsbooleanThis is true when the metric needs the test case's
expectedTools.requireContentbooleanThis is true when the metric needs the test case's
content.requireRolebooleanThis is true when the metric needs the test case's
role.requireScenariobooleanThis is true when the metric needs the test case's
scenario.requireExpectedOutcomebooleanThis is true when the metric needs the test case's
expectedOutcome.requireAudiobooleanThis is true when the metric needs the test case's
audio.requireRetrievalContextbooleanThis is true when the metric needs the test case's
retrievalContext.requireToolsCalledbooleanThis is true when the metric needs the test case's
toolsCalled.requireMetadatabooleanThis is true when the metric needs the test case's
metadata.requireTagsbooleanThis is true when the metric needs the test case's
tags.codeDefinitionobject | nullThe code a CODE metric runs to score a test case.
Show 2 propertiesHide 2 properties
languageenumThis is the language the code is written in.
Show 1 enum valueHide 1 enum value
PYTHON
codestringThis is the source code the metric runs.
totalMetricVersionsintegerThe number of versions this metric has, across every page.
pageintegerThe page this response covers.
pageSizeintegerThe number of versions per page.
deprecatedbooleanIndicates if this endpoint is deprecated.