Calibrate a suite's judge
POST /v1/prompt-eval-suites/{prompt_eval_suite_id}/calibrations
| Property | Value |
|---|---|
| Operation | create_prompt_eval_calibration |
| 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 evaluations.prompt_eval_calibration.create (mutation) |
| Released in | 1.63.0 |
| Phase 0 host | Served (the hosted api pins 1.65.0) |
Creates a calibration of the suite's current judge and answers 201 with it (1.63.0; prompt-manager.md section 9.1 rule 5): from run_id, a sample drawn at random from the completed run's simulated verdicts that kept their transcript, labelling until every entry is labelled; from from_calibration_id, the labelled sample of an earlier calibration, queued at once as a prompt.calibration job. The job judges each labelled transcript again and compares the judge with the labels; a completed calibration becomes the suite's calibration record, and its judged results stop being advisory once a record meets the target (0.9 agreement on at least 30 must items, targets) with the judge that produced them. The judge's tokens count against the evaluation quota (429 evaluation_quota_reached). Every issue is a detail of 422 validation_failed (PromptEvalCalibrationIssueCode).
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_.../calibrations" \
-H "Authorization: Bearer $VOCAL_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{}'const response = await fetch(`${process.env.VOCAL_API}/v1/prompt-eval-suites/pes_.../calibrations`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.VOCAL_API_KEY}`,
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
});
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_.../calibrations",
headers={
"Authorization": f"Bearer {os.environ['VOCAL_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={},
)
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: PromptEvalCalibrationCreateRequest.
| Field | Type | Required | Description |
|---|---|---|---|
from_calibration_id | PromptEvalCalibrationId | no | An earlier calibration of the suite whose sample is fully labelled, reused with its labels; the new calibration queues at once. |
run_id | PromptEvalRunId | no | A completed run of the suite to sample; exactly one of it and from_calibration_id. |
sample_size | integer | no | 50 when omitted (a target); fewer when the run holds fewer. |
Responses
| Status | Content type | Shape | Error codes |
|---|---|---|---|
201 | application/json | PromptEvalCalibration | |
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 |
422 | application/json | ErrorEnvelope | validation_failed |
429 | application/json | ErrorEnvelope | evaluation_quota_reached, rate_limited |
500 | application/json | ErrorEnvelope | internal_error |
Fields of the 201 answer
The shape is PromptEvalCalibration.
| Field | Type | Required | Description |
|---|---|---|---|
agreement | PromptEvalAgreement or null | yes | Null until completed. |
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 | |
from_calibration_id | PromptEvalCalibrationId or null | yes | The calibration whose labelled sample this one reuses; null when it drew its own. |
id | PromptEvalCalibrationId | yes | |
job_id | JobId or null | yes | The prompt.calibration job that compares; null while labelling. |
judge | StageRef | yes | |
labelled | integer | yes | The entries that carry a label. |
meets_target | boolean or null | yes | Whether the agreement met the target (calibrationMeetsTarget); null until completed. |
object | "prompt_eval_calibration" | yes | |
run_id | PromptEvalRunId | yes | The run the sample was drawn from. |
sample | array of PromptEvalCalibrationEntry | yes | |
started_at | Timestamp or null | yes | |
status | PromptEvalCalibrationStatus | yes | |
suite_id | PromptEvalSuiteId | yes | |
suite_revision | integer | yes | |
target | PromptEvalCalibrationTarget | yes |