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

Compare experiments

GET
/api/v1/projects/{project}/experiments/compare
curl --request GET \
--url 'http://localhost:8080/api/v1/projects/example/experiments/compare?ids=example&only=regressed&limit=50' \
--cookie cetra_session=<cetra_session>

Project members, a read personal access token or a read key (D-J-5). Two to four experiments of one dataset, the first the baseline: their summaries, the deltas of each candidate to the baseline, and one page of items with a cell per experiment.

project
required
string

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

ids
required
string

Two to four distinct experiment ids, comma-separated; the first is the baseline.

threshold
number format: double

The regression threshold, absolute, 0 to 1000 (default 0.1).

only

only of GET …/experiments/compare: keep the items with a cell of this kind.

string
Allowed values: regressed improved changed

Keep only the items with a regressed, improved or changed cell. Omitted keeps every item.

limit

Page size. Default 50, accepted range 1–1000.

Spec 09 § Conventions.

integer format: int32
default: 50 >= 1 <= 1000

Maximum number of items to return (1–1000, default 50).

cursor
string

Opaque cursor from a previous page.

The comparison and one page of its items.

Media typeapplication/json

GET …/experiments/compare: two to four experiments of one dataset, the first the baseline.

object
deltas
required

The deltas of each candidate.

Array<object>

The deltas of one candidate, per score name.

object
experiment_id
required

The candidate.

string format: uuid
improved_items
required

The items the baseline also has whose candidate cell improved (see CompareCell).

integer format: int64
regressed_items
required

The items the baseline also has whose candidate cell regressed (see CompareCell).

integer format: int64
scores
required

One delta per score name with at least one compared item.

object
key
additional properties

One score’s delta of a candidate to the baseline.

object
delta
required

The candidate’s mean minus the baseline’s, over the items both ran without error.

number format: double
improved
required

The compared items whose candidate value is higher by more than the threshold.

integer format: int64
n_compared
required

The items that were compared.

integer format: int64
regressed
required

The compared items whose candidate value is lower by more than the threshold.

integer format: int64
experiments
required

The experiments in request order; the first is the baseline.

Array<object>

The results of one experiment, aggregated.

object
cost_total

The sum of the traces’ costs. Omitted when no trace has a cost.

number format: double
error_count
required

Results with an error.

integer format: int64
experiment
required

The experiment.

object
created_at
required

Creation time. JSON is RFC 3339.

string format: date-time
dataset_id

The dataset. Omitted once the dataset is deleted.

string format: uuid
dataset_name
required

The dataset’s name when the experiment was created.

string
dataset_version
required

The dataset version the experiment is pinned to.

integer format: int64
description

Free text. Omitted when unset.

string
error

The error the experiment finished with. Omitted when none.

string
finished_at

When the experiment finished. Omitted while it runs. JSON is RFC 3339.

string format: date-time
id
required

Experiment id.

string format: uuid
item_count
required

Live items of the pinned version.

integer format: int64
metadata
required
object
key
additional properties
any
name
required

Not unique. 1 to 200 characters.

string
repetitions
required

Repetitions of every item, 1 to 20.

integer format: int64
result_count
required

Results stored so far.

integer format: int64
status
required

running, completed or failed.

string
Allowed values: running completed failed
latency_mean_ns

The mean latency. Omitted when no result has one.

integer format: int64
latency_p50_ns

The median latency, by nearest rank. Omitted when no result has one.

integer format: int64
latency_p95_ns

The 95th percentile latency, by nearest rank. Omitted when no result has one.

integer format: int64
result_count
required

Results stored.

integer format: int64
scores
required

One entry per score name, sorted by name.

Array<object>

One score of an experiment, over its rows.

object
count
required

Rows with at least one score of this name.

integer format: int64
data_type
required

The data type the experiment’s scores of this name mostly carry.

string
Allowed values: numeric boolean categorical text
histogram
required

Numeric scores only: the rows per bucket, 10 equal-width buckets from min to max (one bucket when min equals max); empty for other types.

Array<integer>
labels
required

Categoricals only: the rows per label.

object
key
additional properties
integer format: int64
max

The largest value. Omitted when none.

number format: double
mean

Numeric and categorical scores: the mean over the rows that have a value. Omitted when none.

number format: double
median

The median of the same values. Omitted when none.

number format: double
min

The smallest value. Omitted when none.

number format: double
name
required

The score’s name.

string
pass_rate

Booleans only: the share of rows that passed (the mean of 0 and 1). Omitted otherwise.

number format: double
next_cursor
required

The cursor of the next page, or null on the last page. Always present.

string | null
rows
required

One page of items, by item id.

Array<object>

One dataset item, with each experiment’s cell.

object
cells
required

One cell per experiment that has a result for the item, in request order. Match cells by experiment_id, never by position (D-J-13).

Array<object>

One experiment’s answer for one item.

object
error

The error of the item, from its lowest repetition or another one. Omitted when none.

string
experiment_id
required

The experiment.

string format: uuid
improved
required

Whether this cell improved on the baseline’s cell of the same item. Always false for the baseline.

boolean
latency_ns

The latency of the item’s lowest repetition, in nanoseconds. Omitted when unknown.

integer format: int64
output

Any JSON value.

regressed
required

Whether this cell regressed against the baseline’s cell of the same item. Always false for the baseline.

boolean
scores
required

The mean over repetitions, per score name.

object
key
additional properties
number format: double
trace_id

The trace of the item’s lowest repetition. Omitted when none.

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

The dataset item.

string format: uuid
expected_output

Any JSON value.

input
required

Any JSON value.

warnings
required

Notes on the comparison, such as differing dataset versions or items left out of the deltas.

Array<string>

Example

{
"experiments": [
{
"experiment": {
"status": "running"
},
"scores": [
{
"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"
}

The query took longer than its time limit, needed more memory or temporary disk space than allowed, a filter deletion matched more than 100,000 traces, or the owner cannot be that user (code owner_not_allowed).

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"
}