curl --request PATCH \
--url https://dev.api.galtea.ai/v2/metrics/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Accuracy",
"description": "Measures the accuracy of responses",
"tags": [
"accuracy",
"quality"
]
}
'import requests
url = "https://dev.api.galtea.ai/v2/metrics/{id}"
payload = {
"name": "Accuracy",
"description": "Measures the accuracy of responses",
"tags": ["accuracy", "quality"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Accuracy',
description: 'Measures the accuracy of responses',
tags: ['accuracy', 'quality']
})
};
fetch('https://dev.api.galtea.ai/v2/metrics/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Accuracy',
'description' => 'Measures the accuracy of responses',
'tags' => [
'accuracy',
'quality'
]
]),
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/{id}"
payload := strings.NewReader("{\n \"name\": \"Accuracy\",\n \"description\": \"Measures the accuracy of responses\",\n \"tags\": [\n \"accuracy\",\n \"quality\"\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://dev.api.galtea.ai/v2/metrics/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Accuracy\",\n \"description\": \"Measures the accuracy of responses\",\n \"tags\": [\n \"accuracy\",\n \"quality\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.api.galtea.ai/v2/metrics/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Accuracy\",\n \"description\": \"Measures the accuracy of responses\",\n \"tags\": [\n \"accuracy\",\n \"quality\"\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"
}Update metric
Change the name, description or tags of a metric. Every revision shows the change. Any other field answers 400: a change to a judge setting is a new revision. The id is a metric id. A revision id answers 404. See Metrics.
curl --request PATCH \
--url https://dev.api.galtea.ai/v2/metrics/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Accuracy",
"description": "Measures the accuracy of responses",
"tags": [
"accuracy",
"quality"
]
}
'import requests
url = "https://dev.api.galtea.ai/v2/metrics/{id}"
payload = {
"name": "Accuracy",
"description": "Measures the accuracy of responses",
"tags": ["accuracy", "quality"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Accuracy',
description: 'Measures the accuracy of responses',
tags: ['accuracy', 'quality']
})
};
fetch('https://dev.api.galtea.ai/v2/metrics/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Accuracy',
'description' => 'Measures the accuracy of responses',
'tags' => [
'accuracy',
'quality'
]
]),
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/{id}"
payload := strings.NewReader("{\n \"name\": \"Accuracy\",\n \"description\": \"Measures the accuracy of responses\",\n \"tags\": [\n \"accuracy\",\n \"quality\"\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://dev.api.galtea.ai/v2/metrics/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Accuracy\",\n \"description\": \"Measures the accuracy of responses\",\n \"tags\": [\n \"accuracy\",\n \"quality\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.api.galtea.ai/v2/metrics/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Accuracy\",\n \"description\": \"Measures the accuracy of responses\",\n \"tags\": [\n \"accuracy\",\n \"quality\"\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"
Path Parameters
Metric ID. A revision ID answers 404; read a revision under /v2/revisions.
1"metric_123"
Body
Response
Metric updated successfully. The body is the resource as its GET answers it.
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.