Skip to content

Evaluations ​

13 operations. Paths are relative to https://api.frege.io.

The environment's evaluation cases ​

GET/v1/projects/{id}/evals/cases

The suite and the drafts live in one table and are different collections. scope=suite is what runs and what a pass rate is measured over; scope=drafts is what has been generated and not yet accepted. The default lists both, so a caller that does not care still sees everything.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID
scopequerystringall (default), suite, or drafts One of: all, suite, drafts.

Responses

StatusDescriptionBody
200OKdata
422Unprocessable Entityerror envelope

Add an evaluation case ​

POST/v1/projects/{id}/evals/cases

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Request body (application/json)

Schema: api.caseRequest.

FieldTypeDescription
checksevals.Check[]
namestring
promptstring

Responses

StatusDescriptionBody
201Createddata
409Conflicterror envelope

Edit an evaluation case ​

PUT/v1/projects/{id}/evals/cases/{caseID}

Editing a generated case marks it authored: somebody has now read it, which is the difference the origin records.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID
caseID (required)pathintegerCase ID

Request body (application/json)

Schema: api.caseRequest.

FieldTypeDescription
checksevals.Check[]
namestring
promptstring

Responses

StatusDescriptionBody
200OKdata

Delete an evaluation case ​

DELETE/v1/projects/{id}/evals/cases/{caseID}

Runs that already measured it keep their record: the iteration rows hold the case's name, so history survives the case.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID
caseID (required)pathintegerCase ID

Responses

StatusDescriptionBody
204No Content

Put a drafted case into the suite ​

POST/v1/projects/{id}/evals/cases/{caseID}/accept

Only accepted cases run and only accepted cases move a pass rate. A case somebody wrote is accepted when it is written; a generated one stays a draft until this is called, and editing it does not accept it — that is a decision somebody makes, not a side effect of typing. Idempotent: accepting an accepted case does not move the date it has counted since.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID
caseID (required)pathintegerCase ID

Responses

StatusDescriptionBody
200OKdata
404Not Founderror envelope

Keep a run as an evaluation case ​

POST/v1/projects/{id}/evals/cases/from-run/{runID}

Turns an exchange that actually happened into a case: the real prompt, and expectations pre-filled from what the agent actually did. It arrives as a DRAFT — capturing an exchange is not agreeing with it, and the usual reason to keep one is that the agent did the wrong thing, so the expectations describe what happened and are yours to correct before you accept it. Only a run that has a prompt can be captured; a raw tool session has nothing to replay.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID
runID (required)pathintegerRun ID

Responses

StatusDescriptionBody
201Createddata
404Not Founderror envelope
422Unprocessable Entityerror envelope

Past model comparisons for this environment ​

GET/v1/projects/{id}/evals/comparisons

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Responses

StatusDescriptionBody
200OKdata

Run the suite on several models and compare them ​

POST/v1/projects/{id}/evals/comparisons

The measured half of choosing a model: the same accepted cases, the same customer, one run per model (1–10), at most two at a time because each one spends that customer's credential upstream. Returns at once with every run "running"; poll GET …/evals/comparisons/{comparisonID}.

Weights (0–5) rank the finished runs: accuracy is the share of graded attempts passed, speed the median attempt time, cost the run's tokens at the catalogue's list price. All zero means accuracy 5, speed 1, cost 1. Recommendations from POST /projects/{id}/models/recommend are the usual source of models.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Request body (application/json)

Schema: api.startComparisonRequest.

FieldTypeDescription
client_idinteger
iterationsinteger
modelsstring[]
weightsevals.CompareWeights

Responses

StatusDescriptionBody
202Accepteddata
422Unprocessable Entityerror envelope

A comparison's runs, ranked ​

GET/v1/projects/{id}/evals/comparisons/{comparisonID}

Each model's run with its standing. A run still going has no counts yet, so it has no score; winner appears once every run has finished.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID
comparisonID (required)pathintegerComparison ID

Responses

StatusDescriptionBody
200OKdata
404Not Founderror envelope

Past evaluation runs for this environment ​

GET/v1/projects/{id}/evals/runs

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Responses

StatusDescriptionBody
200OKdata

Run every case against this environment's MCP server ​

POST/v1/projects/{id}/evals/runs

Each case is driven by a model whose tool calls execute through a real MCP session, so grants, the write policy and the upstream all apply. With agent_id, each case is instead one turn of that agent as the client: its instructions, model (model replaces it), guardrails, masking and write policy apply, and a write it proposes waits for approval rather than running, which an asked_approval check reads. Returns immediately with a run whose status is "running"; poll the run for the verdict.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Request body (application/json)

Schema: api.startRunRequest.

FieldTypeDescription
agent_idstringAgentID runs each case as a turn of this agent; with model, that model in place of its own (ADR-0057).
client_idinteger
identitystring
iterationsinteger
modelstring

Responses

StatusDescriptionBody
202Accepteddata
400Bad Requesterror envelope

One run, with every iteration ​

GET/v1/projects/{id}/evals/runs/{runID}

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID
runID (required)pathintegerRun ID

Responses

StatusDescriptionBody
200OKdata

Suggest evaluation cases from a conversation ​

POST/v1/projects/{id}/evals/suggest

The assistant reads the tools an evaluation run gives the agent, asks what customers really ask, and proposes cases — each put to the agent before it is stored, and stored as a draft. Nothing is kept of the conversation itself: the client sends the whole of it with every turn. The reply is a server-sent event stream in the chat's format: text_delta, tool_call, tool_result, error, done.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Request body (application/json)

Schema: api.suggestCasesRequest.

FieldTypeDescription
messagesapi.suggestTurn[]

Responses

StatusDescriptionBody
200event stream
400Bad Request
503Service Unavailable