curl --request POST \
--url https://dev.api.galtea.ai/v2/metrics \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Accuracy",
"source": "PARTIAL_PROMPT",
"evaluationParams": [
"input",
"actual_output"
],
"judgePrompt": "<string>",
"evaluatorModelName": "gpt-4.1",
"definition": "<string>",
"description": "<string>",
"documentationUrl": "<string>",
"tags": [
"<string>"
],
"areEvalParamsTop": true,
"organizationId": "org_123",
"userGroupIds": [
"ug_123"
],
"specificationIds": [
"spec_123"
],
"judgeGenerationSettings": {
"temperature": 0.3,
"topP": 0.9,
"maxOutputTokens": 512,
"reasoningEffort": "low"
},
"passThreshold": 0.7,
"applicabilityScope": "PRODUCTION",
"applicabilityThreshold": 0.7,
"decisionQuestion": {
"instructions": "<string>",
"criteria": {
"yes": "<string>",
"no": "<string>"
},
"levels": [
{
"description": "<string>",
"score": 123
}
],
"doesNotApply": "<string>"
},
"classifierQuestion": {
"instructions": "<string>",
"criteria": {
"yes": "<string>",
"no": "<string>"
},
"levels": [
{
"description": "<string>",
"score": 123
}
],
"doesNotApply": "<string>"
}
}
'import requests
url = "https://dev.api.galtea.ai/v2/metrics"
payload = {
"name": "Accuracy",
"source": "PARTIAL_PROMPT",
"evaluationParams": ["input", "actual_output"],
"judgePrompt": "<string>",
"evaluatorModelName": "gpt-4.1",
"definition": "<string>",
"description": "<string>",
"documentationUrl": "<string>",
"tags": ["<string>"],
"areEvalParamsTop": True,
"organizationId": "org_123",
"userGroupIds": ["ug_123"],
"specificationIds": ["spec_123"],
"judgeGenerationSettings": {
"temperature": 0.3,
"topP": 0.9,
"maxOutputTokens": 512,
"reasoningEffort": "low"
},
"passThreshold": 0.7,
"applicabilityScope": "PRODUCTION",
"applicabilityThreshold": 0.7,
"decisionQuestion": {
"instructions": "<string>",
"criteria": {
"yes": "<string>",
"no": "<string>"
},
"levels": [
{
"description": "<string>",
"score": 123
}
],
"doesNotApply": "<string>"
},
"classifierQuestion": {
"instructions": "<string>",
"criteria": {
"yes": "<string>",
"no": "<string>"
},
"levels": [
{
"description": "<string>",
"score": 123
}
],
"doesNotApply": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Accuracy',
source: 'PARTIAL_PROMPT',
evaluationParams: ['input', 'actual_output'],
judgePrompt: '<string>',
evaluatorModelName: 'gpt-4.1',
definition: '<string>',
description: '<string>',
documentationUrl: '<string>',
tags: ['<string>'],
areEvalParamsTop: true,
organizationId: 'org_123',
userGroupIds: ['ug_123'],
specificationIds: ['spec_123'],
judgeGenerationSettings: {temperature: 0.3, topP: 0.9, maxOutputTokens: 512, reasoningEffort: 'low'},
passThreshold: 0.7,
applicabilityScope: 'PRODUCTION',
applicabilityThreshold: 0.7,
decisionQuestion: {
instructions: '<string>',
criteria: {yes: '<string>', no: '<string>'},
levels: [{description: '<string>', score: 123}],
doesNotApply: '<string>'
},
classifierQuestion: {
instructions: '<string>',
criteria: {yes: '<string>', no: '<string>'},
levels: [{description: '<string>', score: 123}],
doesNotApply: '<string>'
}
})
};
fetch('https://dev.api.galtea.ai/v2/metrics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://dev.api.galtea.ai/v2/metrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Accuracy',
'source' => 'PARTIAL_PROMPT',
'evaluationParams' => [
'input',
'actual_output'
],
'judgePrompt' => '<string>',
'evaluatorModelName' => 'gpt-4.1',
'definition' => '<string>',
'description' => '<string>',
'documentationUrl' => '<string>',
'tags' => [
'<string>'
],
'areEvalParamsTop' => true,
'organizationId' => 'org_123',
'userGroupIds' => [
'ug_123'
],
'specificationIds' => [
'spec_123'
],
'judgeGenerationSettings' => [
'temperature' => 0.3,
'topP' => 0.9,
'maxOutputTokens' => 512,
'reasoningEffort' => 'low'
],
'passThreshold' => 0.7,
'applicabilityScope' => 'PRODUCTION',
'applicabilityThreshold' => 0.7,
'decisionQuestion' => [
'instructions' => '<string>',
'criteria' => [
'yes' => '<string>',
'no' => '<string>'
],
'levels' => [
[
'description' => '<string>',
'score' => 123
]
],
'doesNotApply' => '<string>'
],
'classifierQuestion' => [
'instructions' => '<string>',
'criteria' => [
'yes' => '<string>',
'no' => '<string>'
],
'levels' => [
[
'description' => '<string>',
'score' => 123
]
],
'doesNotApply' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://dev.api.galtea.ai/v2/metrics"
payload := strings.NewReader("{\n \"name\": \"Accuracy\",\n \"source\": \"PARTIAL_PROMPT\",\n \"evaluationParams\": [\n \"input\",\n \"actual_output\"\n ],\n \"judgePrompt\": \"<string>\",\n \"evaluatorModelName\": \"gpt-4.1\",\n \"definition\": \"<string>\",\n \"description\": \"<string>\",\n \"documentationUrl\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"areEvalParamsTop\": true,\n \"organizationId\": \"org_123\",\n \"userGroupIds\": [\n \"ug_123\"\n ],\n \"specificationIds\": [\n \"spec_123\"\n ],\n \"judgeGenerationSettings\": {\n \"temperature\": 0.3,\n \"topP\": 0.9,\n \"maxOutputTokens\": 512,\n \"reasoningEffort\": \"low\"\n },\n \"passThreshold\": 0.7,\n \"applicabilityScope\": \"PRODUCTION\",\n \"applicabilityThreshold\": 0.7,\n \"decisionQuestion\": {\n \"instructions\": \"<string>\",\n \"criteria\": {\n \"yes\": \"<string>\",\n \"no\": \"<string>\"\n },\n \"levels\": [\n {\n \"description\": \"<string>\",\n \"score\": 123\n }\n ],\n \"doesNotApply\": \"<string>\"\n },\n \"classifierQuestion\": {\n \"instructions\": \"<string>\",\n \"criteria\": {\n \"yes\": \"<string>\",\n \"no\": \"<string>\"\n },\n \"levels\": [\n {\n \"description\": \"<string>\",\n \"score\": 123\n }\n ],\n \"doesNotApply\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://dev.api.galtea.ai/v2/metrics")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Accuracy\",\n \"source\": \"PARTIAL_PROMPT\",\n \"evaluationParams\": [\n \"input\",\n \"actual_output\"\n ],\n \"judgePrompt\": \"<string>\",\n \"evaluatorModelName\": \"gpt-4.1\",\n \"definition\": \"<string>\",\n \"description\": \"<string>\",\n \"documentationUrl\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"areEvalParamsTop\": true,\n \"organizationId\": \"org_123\",\n \"userGroupIds\": [\n \"ug_123\"\n ],\n \"specificationIds\": [\n \"spec_123\"\n ],\n \"judgeGenerationSettings\": {\n \"temperature\": 0.3,\n \"topP\": 0.9,\n \"maxOutputTokens\": 512,\n \"reasoningEffort\": \"low\"\n },\n \"passThreshold\": 0.7,\n \"applicabilityScope\": \"PRODUCTION\",\n \"applicabilityThreshold\": 0.7,\n \"decisionQuestion\": {\n \"instructions\": \"<string>\",\n \"criteria\": {\n \"yes\": \"<string>\",\n \"no\": \"<string>\"\n },\n \"levels\": [\n {\n \"description\": \"<string>\",\n \"score\": 123\n }\n ],\n \"doesNotApply\": \"<string>\"\n },\n \"classifierQuestion\": {\n \"instructions\": \"<string>\",\n \"criteria\": {\n \"yes\": \"<string>\",\n \"no\": \"<string>\"\n },\n \"levels\": [\n {\n \"description\": \"<string>\",\n \"score\": 123\n }\n ],\n \"doesNotApply\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.api.galtea.ai/v2/metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Accuracy\",\n \"source\": \"PARTIAL_PROMPT\",\n \"evaluationParams\": [\n \"input\",\n \"actual_output\"\n ],\n \"judgePrompt\": \"<string>\",\n \"evaluatorModelName\": \"gpt-4.1\",\n \"definition\": \"<string>\",\n \"description\": \"<string>\",\n \"documentationUrl\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"areEvalParamsTop\": true,\n \"organizationId\": \"org_123\",\n \"userGroupIds\": [\n \"ug_123\"\n ],\n \"specificationIds\": [\n \"spec_123\"\n ],\n \"judgeGenerationSettings\": {\n \"temperature\": 0.3,\n \"topP\": 0.9,\n \"maxOutputTokens\": 512,\n \"reasoningEffort\": \"low\"\n },\n \"passThreshold\": 0.7,\n \"applicabilityScope\": \"PRODUCTION\",\n \"applicabilityThreshold\": 0.7,\n \"decisionQuestion\": {\n \"instructions\": \"<string>\",\n \"criteria\": {\n \"yes\": \"<string>\",\n \"no\": \"<string>\"\n },\n \"levels\": [\n {\n \"description\": \"<string>\",\n \"score\": 123\n }\n ],\n \"doesNotApply\": \"<string>\"\n },\n \"classifierQuestion\": {\n \"instructions\": \"<string>\",\n \"criteria\": {\n \"yes\": \"<string>\",\n \"no\": \"<string>\"\n },\n \"levels\": [\n {\n \"description\": \"<string>\",\n \"score\": 123\n }\n ],\n \"doesNotApply\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "metric_123",
"organizationId": "org_123",
"userId": "user_123",
"name": "Accuracy",
"description": "Measures the accuracy of responses",
"tags": [
"accuracy",
"quality"
],
"documentationUrl": "https://docs.example.com/metrics/accuracy",
"source": "PARTIAL_PROMPT",
"activeRevisionId": "revision_123",
"activeRevision": {
"id": "revision_123",
"number": 3,
"name": "Stricter rubric",
"evaluatorModelName": "gpt-4",
"evaluationParams": [
"input",
"actual_output",
"expected_output"
],
"availability": {
"state": "AVAILABLE",
"at": "2023-11-07T05:31:56Z",
"cause": null,
"reason": null
},
"optimizationStatus": "READY_FOR_REVIEW",
"excludedFromAnalyticsAt": "2023-11-07T05:31:56Z",
"agreement": 87.5,
"annotationCount": 24,
"evaluationCount": 310,
"minAnnotationsForAgreement": 10
},
"createdAt": "2023-11-07T05:31:56Z",
"disabledAt": "2023-11-07T05:31:56Z"
}{
"error": "NotFound",
"message": "Product not found"
}{
"error": "NotFound",
"message": "Product not found"
}{
"error": "NotFound",
"message": "Product not found"
}{
"error": "NotFound",
"message": "Product not found"
}Create metric
Create a metric with its first revision. To revise a metric, create a revision under /v2/revisions: this body refuses parentMetricId. source takes the values that POST /metrics takes. See Metrics.
curl --request POST \
--url https://dev.api.galtea.ai/v2/metrics \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Accuracy",
"source": "PARTIAL_PROMPT",
"evaluationParams": [
"input",
"actual_output"
],
"judgePrompt": "<string>",
"evaluatorModelName": "gpt-4.1",
"definition": "<string>",
"description": "<string>",
"documentationUrl": "<string>",
"tags": [
"<string>"
],
"areEvalParamsTop": true,
"organizationId": "org_123",
"userGroupIds": [
"ug_123"
],
"specificationIds": [
"spec_123"
],
"judgeGenerationSettings": {
"temperature": 0.3,
"topP": 0.9,
"maxOutputTokens": 512,
"reasoningEffort": "low"
},
"passThreshold": 0.7,
"applicabilityScope": "PRODUCTION",
"applicabilityThreshold": 0.7,
"decisionQuestion": {
"instructions": "<string>",
"criteria": {
"yes": "<string>",
"no": "<string>"
},
"levels": [
{
"description": "<string>",
"score": 123
}
],
"doesNotApply": "<string>"
},
"classifierQuestion": {
"instructions": "<string>",
"criteria": {
"yes": "<string>",
"no": "<string>"
},
"levels": [
{
"description": "<string>",
"score": 123
}
],
"doesNotApply": "<string>"
}
}
'import requests
url = "https://dev.api.galtea.ai/v2/metrics"
payload = {
"name": "Accuracy",
"source": "PARTIAL_PROMPT",
"evaluationParams": ["input", "actual_output"],
"judgePrompt": "<string>",
"evaluatorModelName": "gpt-4.1",
"definition": "<string>",
"description": "<string>",
"documentationUrl": "<string>",
"tags": ["<string>"],
"areEvalParamsTop": True,
"organizationId": "org_123",
"userGroupIds": ["ug_123"],
"specificationIds": ["spec_123"],
"judgeGenerationSettings": {
"temperature": 0.3,
"topP": 0.9,
"maxOutputTokens": 512,
"reasoningEffort": "low"
},
"passThreshold": 0.7,
"applicabilityScope": "PRODUCTION",
"applicabilityThreshold": 0.7,
"decisionQuestion": {
"instructions": "<string>",
"criteria": {
"yes": "<string>",
"no": "<string>"
},
"levels": [
{
"description": "<string>",
"score": 123
}
],
"doesNotApply": "<string>"
},
"classifierQuestion": {
"instructions": "<string>",
"criteria": {
"yes": "<string>",
"no": "<string>"
},
"levels": [
{
"description": "<string>",
"score": 123
}
],
"doesNotApply": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Accuracy',
source: 'PARTIAL_PROMPT',
evaluationParams: ['input', 'actual_output'],
judgePrompt: '<string>',
evaluatorModelName: 'gpt-4.1',
definition: '<string>',
description: '<string>',
documentationUrl: '<string>',
tags: ['<string>'],
areEvalParamsTop: true,
organizationId: 'org_123',
userGroupIds: ['ug_123'],
specificationIds: ['spec_123'],
judgeGenerationSettings: {temperature: 0.3, topP: 0.9, maxOutputTokens: 512, reasoningEffort: 'low'},
passThreshold: 0.7,
applicabilityScope: 'PRODUCTION',
applicabilityThreshold: 0.7,
decisionQuestion: {
instructions: '<string>',
criteria: {yes: '<string>', no: '<string>'},
levels: [{description: '<string>', score: 123}],
doesNotApply: '<string>'
},
classifierQuestion: {
instructions: '<string>',
criteria: {yes: '<string>', no: '<string>'},
levels: [{description: '<string>', score: 123}],
doesNotApply: '<string>'
}
})
};
fetch('https://dev.api.galtea.ai/v2/metrics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://dev.api.galtea.ai/v2/metrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Accuracy',
'source' => 'PARTIAL_PROMPT',
'evaluationParams' => [
'input',
'actual_output'
],
'judgePrompt' => '<string>',
'evaluatorModelName' => 'gpt-4.1',
'definition' => '<string>',
'description' => '<string>',
'documentationUrl' => '<string>',
'tags' => [
'<string>'
],
'areEvalParamsTop' => true,
'organizationId' => 'org_123',
'userGroupIds' => [
'ug_123'
],
'specificationIds' => [
'spec_123'
],
'judgeGenerationSettings' => [
'temperature' => 0.3,
'topP' => 0.9,
'maxOutputTokens' => 512,
'reasoningEffort' => 'low'
],
'passThreshold' => 0.7,
'applicabilityScope' => 'PRODUCTION',
'applicabilityThreshold' => 0.7,
'decisionQuestion' => [
'instructions' => '<string>',
'criteria' => [
'yes' => '<string>',
'no' => '<string>'
],
'levels' => [
[
'description' => '<string>',
'score' => 123
]
],
'doesNotApply' => '<string>'
],
'classifierQuestion' => [
'instructions' => '<string>',
'criteria' => [
'yes' => '<string>',
'no' => '<string>'
],
'levels' => [
[
'description' => '<string>',
'score' => 123
]
],
'doesNotApply' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://dev.api.galtea.ai/v2/metrics"
payload := strings.NewReader("{\n \"name\": \"Accuracy\",\n \"source\": \"PARTIAL_PROMPT\",\n \"evaluationParams\": [\n \"input\",\n \"actual_output\"\n ],\n \"judgePrompt\": \"<string>\",\n \"evaluatorModelName\": \"gpt-4.1\",\n \"definition\": \"<string>\",\n \"description\": \"<string>\",\n \"documentationUrl\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"areEvalParamsTop\": true,\n \"organizationId\": \"org_123\",\n \"userGroupIds\": [\n \"ug_123\"\n ],\n \"specificationIds\": [\n \"spec_123\"\n ],\n \"judgeGenerationSettings\": {\n \"temperature\": 0.3,\n \"topP\": 0.9,\n \"maxOutputTokens\": 512,\n \"reasoningEffort\": \"low\"\n },\n \"passThreshold\": 0.7,\n \"applicabilityScope\": \"PRODUCTION\",\n \"applicabilityThreshold\": 0.7,\n \"decisionQuestion\": {\n \"instructions\": \"<string>\",\n \"criteria\": {\n \"yes\": \"<string>\",\n \"no\": \"<string>\"\n },\n \"levels\": [\n {\n \"description\": \"<string>\",\n \"score\": 123\n }\n ],\n \"doesNotApply\": \"<string>\"\n },\n \"classifierQuestion\": {\n \"instructions\": \"<string>\",\n \"criteria\": {\n \"yes\": \"<string>\",\n \"no\": \"<string>\"\n },\n \"levels\": [\n {\n \"description\": \"<string>\",\n \"score\": 123\n }\n ],\n \"doesNotApply\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://dev.api.galtea.ai/v2/metrics")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Accuracy\",\n \"source\": \"PARTIAL_PROMPT\",\n \"evaluationParams\": [\n \"input\",\n \"actual_output\"\n ],\n \"judgePrompt\": \"<string>\",\n \"evaluatorModelName\": \"gpt-4.1\",\n \"definition\": \"<string>\",\n \"description\": \"<string>\",\n \"documentationUrl\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"areEvalParamsTop\": true,\n \"organizationId\": \"org_123\",\n \"userGroupIds\": [\n \"ug_123\"\n ],\n \"specificationIds\": [\n \"spec_123\"\n ],\n \"judgeGenerationSettings\": {\n \"temperature\": 0.3,\n \"topP\": 0.9,\n \"maxOutputTokens\": 512,\n \"reasoningEffort\": \"low\"\n },\n \"passThreshold\": 0.7,\n \"applicabilityScope\": \"PRODUCTION\",\n \"applicabilityThreshold\": 0.7,\n \"decisionQuestion\": {\n \"instructions\": \"<string>\",\n \"criteria\": {\n \"yes\": \"<string>\",\n \"no\": \"<string>\"\n },\n \"levels\": [\n {\n \"description\": \"<string>\",\n \"score\": 123\n }\n ],\n \"doesNotApply\": \"<string>\"\n },\n \"classifierQuestion\": {\n \"instructions\": \"<string>\",\n \"criteria\": {\n \"yes\": \"<string>\",\n \"no\": \"<string>\"\n },\n \"levels\": [\n {\n \"description\": \"<string>\",\n \"score\": 123\n }\n ],\n \"doesNotApply\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.api.galtea.ai/v2/metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Accuracy\",\n \"source\": \"PARTIAL_PROMPT\",\n \"evaluationParams\": [\n \"input\",\n \"actual_output\"\n ],\n \"judgePrompt\": \"<string>\",\n \"evaluatorModelName\": \"gpt-4.1\",\n \"definition\": \"<string>\",\n \"description\": \"<string>\",\n \"documentationUrl\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"areEvalParamsTop\": true,\n \"organizationId\": \"org_123\",\n \"userGroupIds\": [\n \"ug_123\"\n ],\n \"specificationIds\": [\n \"spec_123\"\n ],\n \"judgeGenerationSettings\": {\n \"temperature\": 0.3,\n \"topP\": 0.9,\n \"maxOutputTokens\": 512,\n \"reasoningEffort\": \"low\"\n },\n \"passThreshold\": 0.7,\n \"applicabilityScope\": \"PRODUCTION\",\n \"applicabilityThreshold\": 0.7,\n \"decisionQuestion\": {\n \"instructions\": \"<string>\",\n \"criteria\": {\n \"yes\": \"<string>\",\n \"no\": \"<string>\"\n },\n \"levels\": [\n {\n \"description\": \"<string>\",\n \"score\": 123\n }\n ],\n \"doesNotApply\": \"<string>\"\n },\n \"classifierQuestion\": {\n \"instructions\": \"<string>\",\n \"criteria\": {\n \"yes\": \"<string>\",\n \"no\": \"<string>\"\n },\n \"levels\": [\n {\n \"description\": \"<string>\",\n \"score\": 123\n }\n ],\n \"doesNotApply\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "metric_123",
"organizationId": "org_123",
"userId": "user_123",
"name": "Accuracy",
"description": "Measures the accuracy of responses",
"tags": [
"accuracy",
"quality"
],
"documentationUrl": "https://docs.example.com/metrics/accuracy",
"source": "PARTIAL_PROMPT",
"activeRevisionId": "revision_123",
"activeRevision": {
"id": "revision_123",
"number": 3,
"name": "Stricter rubric",
"evaluatorModelName": "gpt-4",
"evaluationParams": [
"input",
"actual_output",
"expected_output"
],
"availability": {
"state": "AVAILABLE",
"at": "2023-11-07T05:31:56Z",
"cause": null,
"reason": null
},
"optimizationStatus": "READY_FOR_REVIEW",
"excludedFromAnalyticsAt": "2023-11-07T05:31:56Z",
"agreement": 87.5,
"annotationCount": 24,
"evaluationCount": 310,
"minAnnotationsForAgreement": 10
},
"createdAt": "2023-11-07T05:31:56Z",
"disabledAt": "2023-11-07T05:31:56Z"
}{
"error": "NotFound",
"message": "Product not found"
}{
"error": "NotFound",
"message": "Product not found"
}{
"error": "NotFound",
"message": "Product not found"
}{
"error": "NotFound",
"message": "Product not found"
}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-....
Headers
Send return=minimal to get no body back from a write and skip reading the resource: a create answers 201 with only Location, and an update answers 204.
"return=minimal"
Body
1 - 200"Accuracy"
CLASSIFIER is the deprecated name of DECISION, accepted until 2028-01-17.
SELF_HOSTED, FULL_PROMPT, PARTIAL_PROMPT, HUMAN_EVALUATION, GEVAL, DEEPEVAL, DETERMINISTIC, DECISION, CLASSIFIER "PARTIAL_PROMPT"
A PARTIAL_PROMPT (AI Evaluation) metric must include input and actual_output.
201 - 64["input", "actual_output"]
20000Required for PARTIAL_PROMPT. For DECISION: The selectable decision model to run the question under, as listed by GET /evaluatorModels with kind=DECISION and selectable=true. Omitted or null, the one selectable decision model is used. When several are selectable, the request is refused with 400 and this field must be sent.
"gpt-4.1"
5000201 - 64"org_123"
1["ug_123"]
1["spec_123"]
The generation settings this metric's judge runs with. Immutable: changing one creates a revision. Only the settings GET /evaluatorModels reports as configurable for the chosen model take effect; a value the provider rejects ends that evaluation as SKIPPED carrying the provider's own message.
Show child attributes
Show child attributes
Score from 0 to 1 at or above which an evaluation of this metric passes. Omitted or null, it defaults to 0.5, or to the parent metric's threshold for a revision.
0 <= x <= 10.7
Which sessions get the applicability check before this metric is judged: PRODUCTION, DEVELOPMENT, ALL or NONE (no check). A session the check finds the metric does not apply to is skipped and no judge call is made. Omitted or null, it defaults to PRODUCTION for a metric the platform scores and NONE for any other. A revision keeps the parent metric's value when the check runs for both. Fixed at create: a change creates a revision. Any value but NONE is refused with a 400 for a metric the platform does not score. A metric that scores only traces is never checked, so it takes NONE and refuses any other value. A metric that also scores another field is checked without traces: on each turn's input and actual output and its other fields. A FULL_PROMPT metric with empty evaluationParams whose judge prompt reads only traces is stored as checked, yet the evaluator judges it without the check. A FULL_PROMPT metric whose evaluationParams list only traces takes NONE even when its judge prompt reads another field: list that field in evaluationParams to get the check. The check runs only where the deployment enables it.
NONE, DEVELOPMENT, PRODUCTION, ALL "PRODUCTION"
The lowest probability, from 0 to 1, that the metric applies to a session at which it is judged. Below it, the session is skipped. Omitted or null, it defaults to 0.5, or to the parent metric's value for a revision when the check runs for both. Fixed at create: a change creates a revision. Refused with a 400 for a metric the platform does not score, and for a metric that scores only traces. The check runs only where the deployment enables it.
0 <= x <= 10.7
DECISION only, and required there: the one question the decision model answers. evaluationParams is derived from its {{ param }} placeholders.
Show child attributes
Show child attributes
Deprecated, send decisionQuestion. Read as decisionQuestion; sending both answers 400 unless they are equal.
Show child attributes
Show child attributes
Response
Metric created successfully. On Prefer: return=minimal, or when the read after the write fails, the answer has no body.
Metric ID.
"metric_123"
The organization of the metric. Null for a Galtea metric.
"org_123"
"user_123"
Metric name, unique in its organization.
"Accuracy"
"Measures the accuracy of responses"
["accuracy", "quality"]
"https://docs.example.com/metrics/accuracy"
Evaluation method for the metric. FULL_PROMPT is deprecated for creation — POST /metrics rejects it with a 400. Use PARTIAL_PROMPT for new AI Evaluation metrics. The value remains in the enum because existing FULL_PROMPT metrics are still returned by reads and filters. DECISION is the decision model, accepted only where the deployment enables it.
SELF_HOSTED, FULL_PROMPT, PARTIAL_PROMPT, HUMAN_EVALUATION, GEVAL, DEEPEVAL, DETERMINISTIC, DECISION, CODE "PARTIAL_PROMPT"
The revision that evaluations of this metric run. Null when no revision is active.
"revision_123"
The label, judge settings, dates and judge figures of the active revision, so a list shows them without reading each revision. Null when no revision is active.
Show child attributes
Show child attributes
The metric's own disabled date. It ignores the evaluator model of each revision: read a revision for that.