curl -X POST http://localhost:4700/api/v1/custom-agent-evaluations/runs/rK7dP2qWx9TzB4mV6nJcE/finalize \
-H "x-api-key: agtx_local_0f3c9a17d2b84e6a5c01b9f4e7d8a2c6431b5f97a0e2d4c8"
{
"runId": "rK7dP2qWx9TzB4mV6nJcE",
"status": "completed",
"liveStatistics": {
"averageRating": 7.8,
"minRating": 5,
"maxRating": 10,
"ratedCount": 8,
"skippedCount": 0,
"failedCount": 0
}
}
CI Gate
Finalize CI Run
Close the run before computing the CI gate
POST
/
api
/
v1
/
custom-agent-evaluations
/
runs
/
{runId}
/
finalize
curl -X POST http://localhost:4700/api/v1/custom-agent-evaluations/runs/rK7dP2qWx9TzB4mV6nJcE/finalize \
-H "x-api-key: agtx_local_0f3c9a17d2b84e6a5c01b9f4e7d8a2c6431b5f97a0e2d4c8"
{
"runId": "rK7dP2qWx9TzB4mV6nJcE",
"status": "completed",
"liveStatistics": {
"averageRating": 7.8,
"minRating": 5,
"maxRating": 10,
"ratedCount": 8,
"skippedCount": 0,
"failedCount": 0
}
}
Marks the run
"completed" and returns the final rating aggregate. Finalize after every result
batch has been submitted and before calling the gate - the
gate reads whatever ratings are stored, and finalizing pins the run so nothing lands after the
verdict. This is the same endpoint as
Finalize Run; see that page for the full reference.
Finalizing is idempotent, so a retried pipeline step is harmless: a second call returns the
same "completed" response, and a "failed" run stays failed (returned as
status: "failed", not an error).
Authentication
Path Parameters
Response
Final aggregate:
{ averageRating, minRating, maxRating, ratedCount, skippedCount, failedCount }. A nonzero skippedCount in CI usually means the judge could not score
(e.g. missing judge provider key) - the gate would then fail with “no rated results”, so
check this before gating.Errors
| Status | Body | Meaning |
|---|---|---|
404 | { "error": "Run not found" } | No run with this id in the project |
curl -X POST http://localhost:4700/api/v1/custom-agent-evaluations/runs/rK7dP2qWx9TzB4mV6nJcE/finalize \
-H "x-api-key: agtx_local_0f3c9a17d2b84e6a5c01b9f4e7d8a2c6431b5f97a0e2d4c8"
{
"runId": "rK7dP2qWx9TzB4mV6nJcE",
"status": "completed",
"liveStatistics": {
"averageRating": 7.8,
"minRating": 5,
"maxRating": 10,
"ratedCount": 8,
"skippedCount": 0,
"failedCount": 0
}
}

