Appearance
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
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
scope | query | string | all (default), suite, or drafts One of: all, suite, drafts. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 422 | Unprocessable Entity | error envelope |
Add an evaluation case
POST/v1/projects/{id}/evals/cases
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Request body (application/json)
Schema: api.caseRequest.
| Field | Type | Description |
|---|---|---|
checks | evals.Check[] | |
name | string | |
prompt | string |
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Created | data |
| 409 | Conflict | error 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
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
caseID (required) | path | integer | Case ID |
Request body (application/json)
Schema: api.caseRequest.
| Field | Type | Description |
|---|---|---|
checks | evals.Check[] | |
name | string | |
prompt | string |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
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
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
caseID (required) | path | integer | Case ID |
Responses
| Status | Description | Body |
|---|---|---|
| 204 | No 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
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
caseID (required) | path | integer | Case ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error 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
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
runID (required) | path | integer | Run ID |
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Created | data |
| 404 | Not Found | error envelope |
| 422 | Unprocessable Entity | error envelope |
Past model comparisons for this environment
GET/v1/projects/{id}/evals/comparisons
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
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
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Request body (application/json)
Schema: api.startComparisonRequest.
| Field | Type | Description |
|---|---|---|
client_id | integer | |
iterations | integer | |
models | string[] | |
weights | evals.CompareWeights |
Responses
| Status | Description | Body |
|---|---|---|
| 202 | Accepted | data |
| 422 | Unprocessable Entity | error 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
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
comparisonID (required) | path | integer | Comparison ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error envelope |
Past evaluation runs for this environment
GET/v1/projects/{id}/evals/runs
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
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
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Request body (application/json)
Schema: api.startRunRequest.
| Field | Type | Description |
|---|---|---|
agent_id | string | AgentID runs each case as a turn of this agent; with model, that model in place of its own (ADR-0057). |
client_id | integer | |
identity | string | |
iterations | integer | |
model | string |
Responses
| Status | Description | Body |
|---|---|---|
| 202 | Accepted | data |
| 400 | Bad Request | error envelope |
One run, with every iteration
GET/v1/projects/{id}/evals/runs/{runID}
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
runID (required) | path | integer | Run ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
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
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Request body (application/json)
Schema: api.suggestCasesRequest.
| Field | Type | Description |
|---|---|---|
messages | api.suggestTurn[] |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | event stream | |
| 400 | Bad Request | |
| 503 | Service Unavailable |