Skip to main content
create and update also accept --input-json (inline JSON, @file, or - for stdin); explicit flags override fields from the JSON. See Input JSON.

List Metrics

Output columns: ID, NAME, TYPE, CREATED

Get Metric

Create Metric

Common options

Type-specific options

Each metric type requires the options marked in the Metric Types table. Options are grouped here by the type they configure. The following options configure other metric behaviours the API accepts; descriptions are taken from coval metrics create --help.

Additional fields through JSON

CLI 0.9.0 and later accept these additional metric fields on create and update through --input-json (audio_filter and dependency_metric_ids were added in CLI 0.9.1): Use fields appropriate to the metric type; JSON field names use underscores rather than flag-style hyphens. On update, aggregation_method: null resets aggregation to the default and unit: null clears the display unit. Omitting either field leaves it unchanged.

Metric Types

Examples

Duplicate Metric

Create a copy of an existing metric.

Update Metric

update accepts the same options as Create Metric; omitted options are left unchanged. Flags can only set a value. To clear audio_filter, ivr_flow, aggregation_method, or unit, send an explicit JSON null through --input-json; to clear dependency_metric_ids, send [] (or null):

Delete Metric

Test Metric

Run a metric against one or more simulation outputs to test its behavior. This is an asynchronous operation — it returns immediately with metric output IDs that you can use to track the result.

Metric Versions

List the version history of a metric definition.
Output columns: Version ID, #, Change Type, Label

Judge Models

List the models that can be used in --runtime-config when creating or updating a metric.
Output columns: Model ID, Display Name, Provider, Tier

Baselines

Baselines learn a metric’s normal value over time and flag anomalous deviations. All baseline commands are nested under coval metrics baselines <metric_id>.

List Baselines

Output columns: ID, Display Name, Status, Direction, Obs, Baseline

Get Baseline

Create Baseline

Update Baseline

Delete Baseline

Thresholds

A threshold turns a metric’s value into a pass/fail target. Each metric has at most one threshold, so get and update take no threshold ID. All threshold commands are nested under coval metrics thresholds <metric_id>.

List Thresholds

Output columns: Name, Operator, Upper, Lower, Source

Get Threshold

Create Threshold

Update Threshold

Accepts the same options as create. Omitted options are left unchanged.

Delete Threshold

Python Metric Drafts

CLI 0.10.0 and later provide python-metric-drafts commands. They work only when Python metrics are enabled for your Coval environment; otherwise the API returns 403 with Python metrics are not enabled. Author metrics in Python with a draft, preview, and publication workflow. A draft defines a Python evaluate(conversation) function; a preview runs it against a simulation output before publication.

Create Draft

The API requires display_name, source, and output_type. Supply them as flags or through --input-json (inline JSON, @file, or - for stdin). No individual flag is required when JSON supplies the field. Explicit flags override JSON fields; input requirement flags override the corresponding properties in --requirements or JSON input. See Input JSON.

Get Draft

Returns the draft, its current version, and fingerprint. The fingerprint identifies the exact definition approved by a preview. A draft is immutable: changing the source or input/output settings requires a new draft and new previews.

Create Preview

Run the draft against exactly one simulation output. Preview evaluation is asynchronous.

Get Preview

Poll until the preview reaches a terminal state and inspect status, value, explanation, and error. In Agent Mode, a COMPLETED status offers publication as the next action; a queued preview carrying an unconfirmed-admission warning may still run, so keep polling it before retrying. A terminal SKIPPED preview retains its diagnostic without offering polling or publication. A successful value can be numeric zero or boolean false; neither value alone indicates a failed preview. Numeric results must be finite; aggregation and timestamped subvalues are not supported by this workflow.

Cancel Preview

Cancels a pending preview. An already running evaluation cannot be cancelled retroactively.

Publish Draft

Publish the approved draft version. Requires the preview ID and the exact draft fingerprint from the draft create/get response (draft.fingerprint).
Publication returns the resulting metric_id and version_id.