Run an evaluation suite
POST /v1/prompt-eval-suites/{prompt_eval_suite_id}/runs
| Property | Value |
|---|---|
| Operation | create_prompt_eval_run |
| Group | Prompt evaluations and experiments |
| Scope | prompts:write |
| Route class | control |
| Idempotency | Idempotency-Key accepted: a retry with the same key replays the first answer |
| Audit | Audited prompts.prompt_eval_run.create (mutation) |
| Released in | 1.55.0 |
| Phase 0 host | Served (the hosted api pins 1.65.0) |
Runs the suite's scenarios, or those scenario_ids names, against the candidate and the baseline as a prompt.evaluation job, and answers 202 with the run queued, its job_id and its Location (1.55.0; prompt-manager.md section 9.1). Each scenario repeats as the suite says, as a test Call with purpose: "evaluation" on the headless Engine. A request whose suite revision, candidate, baseline and scenarios equal those of a run still queued or running answers that run. Until a dedicated evaluation quota exists the Calls count against the daily allowance of test Calls (429 test_daily_cap_reached); from 1.63.0 they count against both, the evaluation quota refusing with 429 evaluation_quota_reached, and a run with model_families runs each scenario once per family. Until the headless Engine runs evaluation Calls the request is refused with 422 capability_not_available and the detail evaluation_engine_not_available. The job emits job.succeeded or job.failed, and a completed run prompt_evaluation.completed.
Request
Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the prompts:write scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.
curl -X POST "$VOCAL_API/v1/prompt-eval-suites/pes_.../runs" \
-H "Authorization: Bearer $VOCAL_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"candidate": {
"agent_version": 1
}
}'const response = await fetch(`${process.env.VOCAL_API}/v1/prompt-eval-suites/pes_.../runs`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.VOCAL_API_KEY}`,
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({
"candidate": {
"agent_version": 1
}
}),
});
console.log(response.status, await response.text());import os
import uuid
import requests
response = requests.post(
f"{os.environ['VOCAL_API']}/v1/prompt-eval-suites/pes_.../runs",
headers={
"Authorization": f"Bearer {os.environ['VOCAL_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"candidate": {
"agent_version": 1,
},
},
)
print(response.status_code, response.text)Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
prompt_eval_suite_id | path | PromptEvalSuiteId | yes | The id of an evaluation suite: pes_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log. |
idempotency-key | header | string | no | A client-chosen key, kept 24 hours per Organization, environment and route. A replay returns the stored response. |
Request body
Content type application/json, required: PromptEvalRunCreateRequest.
| Field | Type | Required | Description |
|---|---|---|---|
baseline | PromptEvalBaselineInput or PromptEvalBaselineChoice | no | A version, active or none; active when omitted. A choice rather than null, so a client that dumps unset fields as null cannot drop the baseline by accident. |
candidate | PromptEvalCandidateInput | yes | |
model_families | array of ModelFamily | no | The model families to evaluate (1.56.0; prompt-manager.md section 5 rule 3), each a model_family of an llm descriptor the candidate's chain reaches (prompt_eval_model_family_unreachable otherwise); the family of the chain's primary when omitted. From 1.63.0 each scenario and repetition runs once per family named. |
repetitions | integer | no | The suite's repetitions when omitted. |
scenario_ids | array of PromptEvalScenarioId | no | The scenarios to run; every scenario of the suite when omitted. |
Responses
| Status | Content type | Shape | Error codes |
|---|---|---|---|
202 | application/json | PromptEvalRun | |
400 | application/json | ErrorEnvelope | invalid_request |
401 | application/json | ErrorEnvelope | unauthenticated |
403 | application/json | ErrorEnvelope | forbidden, org_suspended |
404 | application/json | ErrorEnvelope | not_found |
409 | application/json | ErrorEnvelope | prompt_eval_suite_archived, idempotency_in_progress, idempotency_key_reused, agent_version_unavailable |
422 | application/json | ErrorEnvelope | validation_failed, capability_not_available |
429 | application/json | ErrorEnvelope | test_daily_cap_reached, evaluation_quota_reached, rate_limited |
500 | application/json | ErrorEnvelope | internal_error |
Fields of the 202 answer
The shape is PromptEvalRun.
| Field | Type | Required | Description |
|---|---|---|---|
advisory | boolean | yes | True when the judged results gate nothing, because the judge is not checked against human labels (section 9.1 rule 5); true for every run of 1.55.0. From 1.63.0 false only when the suite's latest calibration met its target with the run's judge (promptEvalJudgeAdvisory), and false for a run that judged nothing. |
agent_id | AgentId | yes | |
baseline | PromptEvalRunTarget or null | yes | |
by_family | array or null | no | One entry per evaluated family and arm (1.63.0), once completed; null before. Absent from an api before 1.63.0. |
by_item | array or null | no | One entry per scenario, rubric item and arm (1.63.0), once completed; null before. Absent from an api before 1.63.0. |
candidate | PromptEvalRunTarget | yes | |
cost_lines | array of PromptEvalCostLine | yes | |
created_at | Timestamp | yes | |
created_by | ActorRef | yes | |
error_code | string or null | yes | |
finished_at | Timestamp or null | yes | |
gate | PromptEvalGateOutcome or null | no | How the run fares against its suite's publish gate (1.63.0), once completed; null for a suite with no gate and before completion. Absent from an api before 1.63.0. |
id | PromptEvalRunId | yes | |
job_id | JobId | yes | The prompt.evaluation job that runs it. |
judge | StageRef or null | yes | The judge the run used; null with none. |
model_families | array of ModelFamily | no | The model families the run evaluated (1.63.0): the request's model_families, or the family of the chain's primary. Absent from an api before 1.63.0. |
object | "prompt_eval_run" | yes | |
repetitions | integer | yes | |
scenario_count | integer | yes | |
started_at | Timestamp or null | yes | |
status | PromptEvalRunStatus | yes | |
suite_id | PromptEvalSuiteId | yes | |
suite_revision | integer | yes | |
summary | array or null | yes | One entry per arm, the candidate first, once completed; null before. |