Skip to main content
PATCH

Authorizations

X-API-Key
string
header
required

API key for authentication

Path Parameters

metric_id
string
required

22-character metric ID

Pattern: ^[a-zA-Z0-9]{22}$

Body

application/json

Update metric request (partial update)

metric_name
string
Required string length: 1 - 200
description
string
Required string length: 1 - 1000
metric_type
enum<string>

Metric evaluation type.

  • METRIC_LLM_BINARY - Yes/no LLM evaluation
  • METRIC_CATEGORICAL - Multi-class classification
  • METRIC_NUMERICAL_LLM_JUDGE - Numerical scoring (1-N)
  • METRIC_AUDIO_LLM_BINARY - Audio-based yes/no
  • METRIC_AUDIO_LLM_CATEGORICAL - Audio-based classification
  • METRIC_AUDIO_LLM_NUMERICAL - Audio-based scoring
  • METRIC_TOOLCALL - Tool/function call evaluation
  • METRIC_METADATA_FIELD - Extract metadata field
  • METRIC_TRANSCRIPT_REGEX - Regex pattern matching
  • METRIC_PAUSE_ANALYSIS - Speech pause detection
  • METRIC_SQL_FLOAT - Custom SQL query over the simulation's data (set sql_query)
  • METRIC_COMPOSITE_EVALUATION - Judges a list of criteria independently and reports how many were met (set criteria_source, and criteria_path or criteria to match)
Available options:
METRIC_LLM_BINARY,
METRIC_CATEGORICAL,
METRIC_NUMERICAL_LLM_JUDGE,
METRIC_AUDIO_LLM_BINARY,
METRIC_AUDIO_LLM_CATEGORICAL,
METRIC_AUDIO_LLM_NUMERICAL,
METRIC_TOOLCALL,
METRIC_METADATA_FIELD,
METRIC_TRANSCRIPT_REGEX,
METRIC_PAUSE_ANALYSIS,
METRIC_SQL_FLOAT,
METRIC_COMPOSITE_EVALUATION,
METRIC_CUSTOM_AGENT_FAILS_TO_RESPOND,
METRIC_CUSTOM_AGENT_NEEDS_REPROMPTING,
METRIC_CUSTOM_AUDIO_FREQUENCY,
METRIC_CUSTOM_AUDIO_SENTIMENT,
METRIC_CUSTOM_END_REASON,
METRIC_MATCH_EXPECTED_OUTPUT,
METRIC_SPEAKING_TIME_PERCENTAGE,
METRIC_SPECTROGRAM_PITCH_ANALYSIS,
METRIC_VOLUME_PITCH_MISALIGNMENT,
METRIC_WORDS_PER_MESSAGE_WITH_THRESHOLD
prompt
string
categories
string[]
Required array length: 2 - 50 elements
min_value
number
max_value
number
metadata_field_type
enum<string>

Data type for metadata field extraction

Available options:
STRING,
NUMBER,
BOOLEAN
metadata_field_key
string
regex_pattern
string
role
enum<string>
Available options:
agent,
persona,
user,
assistant
min_pause_duration_seconds
number
Required range: x >= 0.5
max_silence_duration_seconds
number
Required range: x > 0
min_silence_gap_seconds
number
Required range: x > 0
frequency_threshold
number
Required range: x > 0
direction
enum<string>
Available options:
above,
below
success_sentiments
enum<string>[]
Minimum array length: 1
Available options:
Neutral,
Happy,
Angry,
Sad
percent_above
number
Required range: 0 <= x <= 100
success_end_reasons
enum<string>[]
Minimum array length: 1
Available options:
UNKNOWN,
IDLE_TIMEOUT,
PERSONA_DISCONNECTED,
AGENT_DISCONNECTED,
PIPELINE_ERROR,
REPETITION_LOOP,
AUDIO_UPLOAD_PLAYBACK_COMPLETED,
SCRIPT_COMPLETED,
SCRIPT_DIVERGED
observation_name
string
Minimum string length: 1
expected_body
Minimum string length: 1
match_path
string

Optional dot path; brackets must contain an integer index or comma-separated key=value filters.

Minimum string length: 1
min_volume_change_for_pitch_misalignment
number
Required range: x > 0
threshold
integer
Required range: x >= 0
operator
enum<string>
Available options:
<,
<=,
>,
>=,
==,
!=
sql_query
string

SQL query that defines the metric (for METRIC_SQL_FLOAT).

Maximum string length: 50000
criteria_source
enum<string>

Where a METRIC_COMPOSITE_EVALUATION metric reads its criteria from.

Available options:
test_case,
test_case_attribute,
metric_metadata
criteria_path
string

Path to the criteria on the source, when criteria_source is test_case or test_case_attribute.

Maximum string length: 200
criteria
string[]

Literal list of criteria, when criteria_source is metric_metadata.

reporting_method
enum<string>

How per-criterion verdicts aggregate into the metric's value.

Available options:
percentage_of_criteria_met,
count_of_criteria_met,
all_criteria_met
base_prompt_template
string

Custom prompt template used to evaluate each criterion.

Maximum string length: 50000
include_traces
boolean | null

Inject OTel trace context into the LLM judge prompt during evaluation. Supported for LLM judge metric types and METRIC_COMPOSITE_EVALUATION.

runtime_config
object | null

Override the LLM model used for metric evaluation. Set to null to revert to the platform default. Use GET /v1/models/metric to list available models. Not supported for audio metric types (METRIC_AUDIO_LLM_BINARY, METRIC_AUDIO_LLM_CATEGORICAL, METRIC_AUDIO_LLM_NUMERICAL), which always use the platform-default audio model.

target_condition
object

Target condition for metric evaluation

Example:
tags
string[] | null

Tags to associate with this metric. Null or omitted leaves tags unchanged. Pass [] to clear all tags.

Example:

Response

Metric updated

metric
object
required

Metric resource