Skip to main content
POST
JavaScript

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

projectId
string
required

The ID of the Project to create the Metric in.

Example:

"314"

Body

application/json

A Metric with AI evaluation and integer output.

name
string
required

The name of the Metric.

evalType
string
required

AI-based evaluation type.

Allowed value: "ai"
promptTemplate
string
required

The complete prompt template for AI evaluation. Should include placeholders for dynamic content.

outputType
string
required

Integer output type.

Allowed value: "int"
description
string | null

The description of the Metric.

guidelines
string

Guidelines for AI evaluation on how to score the metric.

evalModelName
string
default:gpt-4o

The AI model to use for evaluation.

temperature
number
default:0

The temperature for AI evaluation (0-2).

Required range: 0 <= x <= 2
passingThreshold
integer
default:4

The threshold for determining pass/fail from integer scores (1-5).

Required range: 1 <= x <= 5

Response

Metric created successfully

A Metric defines how to evaluate system outputs against expected results.

id
string
required

The ID of the Metric.

name
string
required

The name of the Metric.

description
string | null
required

The description of the Metric.

evalType
string
required

AI-based evaluation type.

Allowed value: "ai"
guidelines
string
required

Guidelines for AI evaluation on how to score the metric.

promptTemplate
string
required

The complete prompt template for AI evaluation. Should include placeholders for dynamic content.

evalModelName
string
default:gpt-4o
required

The AI model to use for evaluation.

temperature
number
default:0
required

The temperature for AI evaluation (0-2).

Required range: 0 <= x <= 2
outputType
string
required

Integer output type.

Allowed value: "int"
passingThreshold
integer
default:4
required

The threshold for determining pass/fail from integer scores (1-5).

Required range: 1 <= x <= 5