Running evals
Run a suite against a version, read the result, and know the difference between a good score and a pass.
A run executes one suite against one pinned agent version and grades every conversation with the suite's attached checks.
| Endpoint | What executes | Extra permission |
|---|---|---|
POST /eval-runs | Simulated conversations; tools stubbed (dry_run, default) or answered from fixtures (mocked) — no side effects | — |
POST /eval-runs/live | Simulated conversations, real tool execution | eval-runs:execute-live-tools |
POST /eval-runs/grade-calls | Nothing — finished production calls re-graded by the suite's checks | calls:read |
All three need eval-runs:create and the evals entitlement.
Simulated runs
The safe default for CI and promotion gates:
curl --fail-with-body -X POST "$KEJUE_API_BASE/eval-runs" \
-H "Authorization: Bearer $KEJUE_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: run-support-regression-20260906-01" \
--data "{
\"agent_id\": \"$AGENT_ID\",
\"agent_version_id\": \"$AGENT_VERSION_ID\",
\"suite_id\": \"$SUITE_ID\",
\"mode\": \"text\"
}"New simulated and live-tool runs require mode: "text"; requesting audio
returns 422 validation_failed with unsupported_value on mode.
Historical audio runs remain readable. Omit agent_version_id to pin the current
production version; supply it to gate a candidate. No production version
→ 409 no_agent_version; no active scenarios → 409 eval_suite_empty.
Optional runtime_profile is a JSON object of per-run overrides —
default {}, accepted on simulated and live runs alike. Pick models and
voices from the workspace catalog, then use their
platform UUIDs:
| Field | Value |
|---|---|
agent_model_ref | LLM model catalog id for the agent |
caller_model_ref | LLM model catalog id for the simulated caller |
scorer_model_ref | LLM model catalog id for grading |
caller_voice_ref | Voice catalog id for the simulated caller |
caller_tts_provider_ref | The catalog id of the service that owns that voice; send it with caller_voice_ref |
caller_language | Caller language override |
Omit model and voice overrides to use the configured defaults. Anything
that isn't an object returns 422 validation_failed. The run you read back
reports its effective profile; use the catalog references and display names
to identify selections, without depending on internal model or voice names.
Concurrency is clamped, not promised — requested concurrency
(0–1000; defaults to 4 for new text runs) is capped by workspace headroom and a
hard maximum of 20; read effective_concurrency from the response.
The 202 carries the run id, total scenarios, a Location to poll,
and Retry-After. On 429/503, retry with the same idempotency key —
never mint a new run to recover an ambiguous response.
Live-tool runs
POST /eval-runs/live is the same request shape, but tools really
execute — the eval can update your CRM like a production call. API keys
must use this dedicated endpoint: tool_policy: "live" on
POST /eval-runs is 403 forbidden naming the required permission and
endpoint — policy, not a retryable error. Grant
eval-runs:execute-live-tools only to a dedicated credential whose
owner approved the side effects; point live runs at staging upstreams
where you can.
Grading real calls
POST /eval-runs/grade-calls scores calls that already happened — e.g.
backfilling a new check over last month's traffic. Send suite_id plus
up to 5,000 calls as explicit call_ids or a call_filter
(agent_version_id, since, until, outcome); ids win when both are
supplied. A selection matching nothing is 409 eval_suite_empty up
front. Checks whose evidence isn't persisted on a call abstain rather
than pass — e.g. a tool-trace check on a call recorded before tool traces
were captured.
Poll and interpret
Poll GET /eval-runs/{id} (statuses queued, running, done,
failed, cancelled; honor Retry-After); GET /eval-runs lists runs
with status/mode filters. The run-level verdict:
| Field | Meaning |
|---|---|
score_weighted | 0–100 weighted mean of conversation scores; null while running or when nothing scored. |
passed | The gate: the share of passing conversations against the suite's threshold — not a function of score_weighted alone. |
unmocked_tool_calls | Tool calls that reached a real upstream. Non-zero on a mocked run means a tool escaped the fixtures. |
Per conversation, passed needs the pass threshold cleared and no
blocking-check failure; call summaries carry checks_passed,
failed_checks (blocking first), and abstained_checks. A run can score
high and still fail — one decisive check broken in enough conversations.
score_weighted is the quality trend; passed is the gate.
For evidence: GET /eval-calls (filter by run_id and derived status),
then GET /eval-calls/{id} — transcript, tool trace, and one verdict per
check (passed, score_0_100, selected_level_key, confidence,
reasoning, quoted evidence). insufficient_evidence: true means the
check abstained and is excluded from the weighted mean — "not measured",
never "passed". A conversation that errored or timed out never passes.
Eval diagnostics keep classified failures and support IDs; raw upstream diagnostic text isn't returned. Report the run and conversation IDs together with the status and stable failure code.
Cancel and archive
POST /eval-runs/{id}/cancel(no body; idempotency key required): a queued run cancels immediately; a running one finishes in-flight calls, skips the rest, goes terminal. Otherwise409 eval_run_not_cancelable.DELETE /eval-runs/{id}soft-archives (archiving live work also cancels it); unlike other eval archives, a repeat returns404 eval_run_not_found.