Skip to Content
Eval checks

Create an eval check

Permissioneval-checks:createAdd-onEvaluationsRetriesIdempotency-Key requiredAuthentication
POST
/eval-checks

Creates a reusable check in the workspace library. Attach it to a suite or scenario to run it.

kind (judge, tool or flow) and slug are fixed after creation. slug is workspace-unique — a duplicate returns 409 eval_check_slug_taken.

Config

config is required and validated against the kind and, for tool and flow checks, against the config's rule. See EvalCheckConfig for every rule's keys; an unknown, missing or mistyped key returns 422 validation_failed with its field path.

template_key only records provenance — copy the template's config into config yourself.

Limits — the encoded config is capped at 131,072 bytes and the complete request body at 262,144 bytes.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Use a Voice API key or connected-app OAuth access token. Authentication.

Header Parameters

Idempotency-Key*string

Required. Reuse the same key to retry this write safely. Retries and idempotency.

Match^[A-Za-z0-9!#$%&'*+.^_`|~-]+$
Length1 <= length <= 255

Request Body

application/json
  1. body
slug*string
Match^[a-z0-9][a-z0-9_-]{1,63}$
Length2 <= length <= 64
name*string
Length1 <= length <= 200
description?|
Lengthlength <= 2000
kind*string
Value in"judge""tool""flow"
config*||||||||||||||||||||||||

A check's assertion. Exactly one shape applies: a judge check takes EvalCheckJudgeConfig (no rule); a tool or flow check takes the schema for its rule. Every key is closed — the server rejects an unknown key, a missing required key, or a wrong type with 422 validation_failed and the field path (for example config.expected), because the evaluator would otherwise ignore the key and silently grade against a default. Tool rules: called (tool, phase?, min?, max?), not_called (tool, phase?), called_with (tool, args, phase?, match?), called_before (tool, other_tool), succeeded (tool, phase?), failed (tool, phase?, error_kind?), result_matches (tool, expected, jsonpath?, phase?), no_unexpected_tools (allowlist), phase (tool, expected_phase). Flow rules: terminal_node (value), path_contains (value), slot_recorded (slot, expected?), max_turns (max), end_reason (value), transcript_matches (pattern, speaker?, expect?), pre_call_status (tool, status?), pre_call_var_set (value), pre_call_aborted (expect?). A few rules also accept a legacy spelling of their key (node, var, value) — send one spelling, not both.

template_key?|

Records which template the check started from. It does not copy the template's config — send config too (list_eval_check_templates returns it).

Lengthlength <= 128

Response Body

Check created; Location names it.

application/json
  1. response

One library check: the list projection plus its kind-specific config.

id*string
Formatuuid
slug*string
Match^[a-z0-9][a-z0-9_-]{1,63}$
Length2 <= length <= 64
name*string
Length1 <= length <= 200
description*|
Lengthlength <= 2000
kind*string
Value in"judge""tool""flow"
source_template_key*|
Lengthlength <= 128
archived_at*|
Formatdate-time
created_at*string
Formatdate-time
updated_at*string
Formatdate-time
config*

A check's config exactly as stored. Every check created or edited since config validation shipped conforms to EvalCheckConfig; a check last edited before that may still carry keys outside it until its config is next updated (the update is validated in full).

Example Request
curl -X POST 'https://api.kejue.co/v1/eval-checks' \  -H 'Idempotency-Key: string' \  -H 'Content-Type: application/json' \  -d '{  "slug": "string",  "name": "string",  "kind": "judge",  "config": {    "instruction": "string"  }}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "slug": "string",  "name": "string",  "description": "string",  "kind": "judge",  "source_template_key": "string",  "archived_at": "2019-08-24T14:15:22Z",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z",  "config": {}}