Skip to content
GitHubLog inStart free
cetra is not released yet. These docs describe the development version.

Run an evaluator once

POST
/api/v1/projects/{project}/evaluators/test
curl --request POST \
--url http://localhost:8080/api/v1/projects/example/evaluators/test \
--header 'Content-Type: application/json' \
--cookie cetra_session=<cetra_session> \
--data '{ "evaluator": { "config": {}, "kind": "llm_judge", "name": "example", "output_score": { "categories": [ "example" ], "data_type": "numeric", "name": "example" }, "webhook_secret": "example" }, "evaluator_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "span_id": "example", "trace_id": "example", "trace_start": "example", "variable_mapping": { "additionalProperty": "example" }, "variables": {} }'

Project members and above. API keys cannot call it. Runs synchronously, writes the judge trace (environment cetra-eval) and the judge usage, and writes no score. Shares the 10 per minute per user limit with connection tests.

project
required
string

Project UUID, URL-encoded org-slug/project-slug, or current.

Media typeapplication/json

POST /api/v1/projects/{project}/evaluators/test body.

Deserialize only: TimeParam has no Serialize. Its Debug prints flags and counts, not the variables, the mapping or the evaluator.

object
evaluator

The evaluator to run. With evaluator_id too, it is merged over the saved one.

object
config

The kind-specific configuration. Absent: the saved configuration, which needs evaluator_id. For a webhook, a present configuration needs webhook_secret too.

object
kind
required

What the evaluator does. Must match the saved evaluator’s kind.

string
Allowed values: llm_judge check webhook
name

Display name. Absent: the saved name, or Test.

string
output_score
required

The score the evaluator writes.

object
categories

Category labels of a categorical score. Omitted otherwise.

Array<string>
data_type
required

Score data type.

string
Allowed values: numeric boolean categorical text
name
required

Score name, 1 to 255 bytes.

string
webhook_secret

Signing secret of a webhook. Absent: the saved secret, which needs evaluator_id. Required with a webhook config.

string
evaluator_id

The saved evaluator to run. Needed unless evaluator is given.

string format: uuid
span_id

Span of the trace to target, 16 hex digits.

string
trace_id

Stored trace to load, 32 hex digits.

string
trace_start

Start of the trace, to narrow the lookup.

string
variable_mapping

Prompt variable to mapping expression, for a stored trace.

object
key
additional properties
string
variables

Literal prompt variables, instead of a stored trace. At most 32, 256 KiB in total.

object

The outcome. An evaluator failure is ok: false, not an error status.

Media typeapplication/json

POST /api/v1/projects/{project}/evaluators/test response. Also used when the evaluator failed.

object
error

The failure. Omitted when ok is true.

object
class
required

What the caller should do with the failure.

string
Allowed values: retryable pause permanent
message
required

The error text, without payload content or secrets.

string
judge_trace_id

The judge trace the run wrote (environment cetra-eval). Omitted when no judge trace was written.

string
/^[0-9a-fA-F]{32}$/
latency_ms
required

Time the run took, in milliseconds.

integer format: int64
ok
required

Whether the evaluator produced a value.

boolean
prompt

The rendered prompt. Omitted for checks, webhooks and failures before rendering.

string
reason

The judge’s explanation, when it gave one. Omitted otherwise.

string
trace_truncated
required

Whether the target trace was cut to fit the loading limits. Always false for literal variables.

boolean
usage

Judge usage. Omitted when the run made no LLM call.

object
cost_usd

Estimated cost in USD. Omitted when no price is known.

number format: double
input_tokens

Input tokens the provider counted. Omitted when unknown.

integer format: int64
output_tokens

Output tokens the provider counted. Omitted when unknown.

integer format: int64
value

The score value. Omitted unless ok.

One of:

A finite number.

object
data_type
required
string
Allowed values: numeric
value
required

A finite number.

number format: double
variables
required

Each prompt variable as rendered, cut to 2 000 characters. Empty when the run failed before rendering.

object
key
additional properties
string

Example

{
"error": {
"class": "retryable"
},
"value": {
"data_type": "numeric"
}
}

The request is malformed or a filter is invalid.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

No credentials, or the credentials are invalid.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

The credentials do not allow this operation, or the organization’s plan does not include it (code plan_required).

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

The resource does not exist.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

Too many requests.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

The server is busy or a dependency is unavailable. Retry later.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}