Generate or complete metric configuration with AI
Two modes, selected by the request body:
- Spec mode (provide
specificationIds): generates 1-3 metric configurations per specification, optionally creating the metrics automatically. - Completion mode (“Complete With AI”, provide
name+description+evaluationType): completes a single metric the user is authoring. The name/description/evaluationType/tags are the source of truth; only the judge prompt, evaluation params, and evaluator model are generated.specificationIdsmay carry at most one id as optional context.
See Metrics.
Authorizations
API key authorization. Pass your API key in the Authorization header as a Bearer token. Both new (gsk_*) and legacy (gsk-) API keys are accepted, e.g. Authorization: Bearer gsk_... or Authorization: Bearer gsk-....
Body
Spec mode - IDs of the specifications to generate metrics for. Completion mode - at most one id used as context.
["spec_123", "spec_456"]Spec mode only - when true, creates metrics from generated config
false
Spec mode only - maximum number of metrics to generate per specification
Spec mode only - whether this is an onboarding flow
false
Completion mode - the user-authored metric name (source of truth)
Completion mode - the user-authored metric description (the criteria to evaluate)
Completion mode - PARTIAL_PROMPT (binary LLM judge) or HUMAN_EVALUATION (0-100 annotator guidelines)
PARTIAL_PROMPT, HUMAN_EVALUATION Completion mode - user-provided tags (source of truth, optional)
Completion mode - optional product id for additional context
Response
Metric configuration generated successfully
Generated metric configuration suggestion