Create metric
Create a new custom evaluation metric.
Required fields vary by metric type:
| Metric Type | Required Fields |
|---|---|
| METRIC_LLM_BINARY | prompt |
| METRIC_CATEGORICAL | prompt, categories |
| METRIC_NUMERICAL_LLM_JUDGE | prompt, min_value, max_value |
| METRIC_AUDIO_LLM_BINARY | prompt |
| METRIC_AUDIO_LLM_CATEGORICAL | prompt, categories |
| METRIC_AUDIO_LLM_NUMERICAL | prompt, min_value, max_value |
| METRIC_TOOLCALL | prompt |
| METRIC_METADATA_FIELD | metadata_field_type, metadata_field_key |
| METRIC_TRANSCRIPT_REGEX | regex_pattern |
| METRIC_PAUSE_ANALYSIS | min_pause_duration_seconds |
Authorizations
API key for authentication
Body
Create metric request
Display name
1 - 200Metric description
1 - 1000Metric evaluation type.
METRIC_LLM_BINARY- Yes/no LLM evaluationMETRIC_CATEGORICAL- Multi-class classificationMETRIC_NUMERICAL_LLM_JUDGE- Numerical scoring (1-N)METRIC_AUDIO_LLM_BINARY- Audio-based yes/noMETRIC_AUDIO_LLM_CATEGORICAL- Audio-based classificationMETRIC_AUDIO_LLM_NUMERICAL- Audio-based scoringMETRIC_TOOLCALL- Tool/function call evaluationMETRIC_METADATA_FIELD- Extract metadata fieldMETRIC_TRANSCRIPT_REGEX- Regex pattern matchingMETRIC_PAUSE_ANALYSIS- Speech pause detection
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 LLM evaluation prompt. Required for LLM-based metrics.
Categories for classification. Required for categorical metrics.
2 - 50 elementsMinimum score. Required for numerical metrics.
Maximum score. Required for numerical metrics.
Field type. Required for METRIC_METADATA_FIELD.
STRING, NUMBER, BOOLEAN Metadata key. Required for METRIC_METADATA_FIELD.
Regex pattern. Required for METRIC_TRANSCRIPT_REGEX.
Speaker role filter. Optional for METRIC_TRANSCRIPT_REGEX.
agent, user Min pause duration in seconds. Required for METRIC_PAUSE_ANALYSIS.
x >= 0.5Inject OTel trace context into the LLM judge prompt during evaluation.
Supported for LLM judge metric types only (METRIC_LLM_BINARY, METRIC_CATEGORICAL,
METRIC_NUMERICAL_LLM_JUDGE, METRIC_AUDIO_LLM_BINARY, METRIC_AUDIO_LLM_CATEGORICAL,
METRIC_AUDIO_LLM_NUMERICAL).
Override the LLM model used for metric evaluation. If omitted, the platform default
model is used. 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 for metric evaluation
- Option 1
- Option 2
Tags to associate with this metric. Null or omitted creates the metric with no tags. Pass [] for an empty tag list.
["production"]Response
Metric created
Metric resource

