Skip to main content
Create a new metric definition. The calculationType field selects the variant: LLM_JUDGE (LLM-evaluated), FORMULA (computed from a math expression over other metrics), or PATTERN (detects a trigger→outcome pattern within a window). To create a threshold on top of an existing metric, use POST /metric/definitions/{idOrSlug}/thresholds instead.
Calls POST /v1/metric/definitions

Request body

This endpoint accepts one of several request shapes, so the body is supplied as JSON through --data or on standard input rather than as individual flags.
object
Requires calculationType, name, outputType
object
Requires calculationType, name, outputType, formula, sources
object
Requires calculationType, name, operation, outcome

Example

Every command also takes the global options and sets one of the exit codes.