Read a run's results over HTTP
This example finds an evaluation’s latest run, reads each cell’s average score and pages through each task’s result.
What a run, its cells and its scores mean is explained once, in Read results. This page pulls them into your own tools.
Before you start
CONTEXT_APP_ORIGINand a read-onlyCONTEXT_API_KEY, set as in the quickstart.- The ID of a benchmark that has run (the API’s paths call a benchmark’s ID
evaluationId). List evaluations returns them (sendworkspaceScopeas in the quickstart), or usecontext evals benchmark list, whose rows carryrunCount.
Steps
Code
-
Find the latest run
List an evaluation’s runs returns them newest first; the examples sort by
createdAtso the order doesn’t depend on that. A run’sstatusends asCOMPLETED,FAILEDorSTOPPED; scores are final only once it has ended.Code -
Read each cell’s score
Get a run’s status returns the run, with its
cells, and astatsentry per cell. Join the two oncellIdto see which model or agent each score belongs to.avgScoreis from 0 to 1, andnulluntil something has been graded.Code -
Page through each task’s result
List a run’s task results takes a
cellIdand returns up to 50 tasks a page. Each row has the task’sscore, itsoutputpreview,outputStatus(whether a recorded answer is available),costUsd,latencyMs, and the outcomes of its first 8 criteria undercriteria.entries;criteria.totalCountsays how many it has. PassnextCursorback ascursoruntil it isnull.Get one task’s result, with the same
cellId, returns one task’s full answer and every criterion’s outcome with its reasoning.
Related
- Read results: what the Activity tab and a run’s scorecard show.
- Runs in the API reference: every field of these responses.
- Errors and Limits and requests: status codes, the rate limit and paging.