curl --request POST \
--url https://api.galtea.ai/metrics/update-config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Refusal Quality",
"currentJudgePrompt": "<string>",
"feedback": "it should not penalise a short answer",
"description": "<string>",
"currentEvaluationParams": [
"<string>"
],
"tags": [
"<string>"
],
"productId": "prod_123",
"specificationIds": [
"<string>"
]
}
'import requests
url = "https://api.galtea.ai/metrics/update-config"
payload = {
"name": "Refusal Quality",
"currentJudgePrompt": "<string>",
"feedback": "it should not penalise a short answer",
"description": "<string>",
"currentEvaluationParams": ["<string>"],
"tags": ["<string>"],
"productId": "prod_123",
"specificationIds": ["<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: 'Refusal Quality',
currentJudgePrompt: '<string>',
feedback: 'it should not penalise a short answer',
description: '<string>',
currentEvaluationParams: ['<string>'],
tags: ['<string>'],
productId: 'prod_123',
specificationIds: ['<string>']
})
};
fetch('https://api.galtea.ai/metrics/update-config', 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://api.galtea.ai/metrics/update-config",
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' => 'Refusal Quality',
'currentJudgePrompt' => '<string>',
'feedback' => 'it should not penalise a short answer',
'description' => '<string>',
'currentEvaluationParams' => [
'<string>'
],
'tags' => [
'<string>'
],
'productId' => 'prod_123',
'specificationIds' => [
'<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://api.galtea.ai/metrics/update-config"
payload := strings.NewReader("{\n \"name\": \"Refusal Quality\",\n \"currentJudgePrompt\": \"<string>\",\n \"feedback\": \"it should not penalise a short answer\",\n \"description\": \"<string>\",\n \"currentEvaluationParams\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"productId\": \"prod_123\",\n \"specificationIds\": [\n \"<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://api.galtea.ai/metrics/update-config")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Refusal Quality\",\n \"currentJudgePrompt\": \"<string>\",\n \"feedback\": \"it should not penalise a short answer\",\n \"description\": \"<string>\",\n \"currentEvaluationParams\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"productId\": \"prod_123\",\n \"specificationIds\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/metrics/update-config")
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\": \"Refusal Quality\",\n \"currentJudgePrompt\": \"<string>\",\n \"feedback\": \"it should not penalise a short answer\",\n \"description\": \"<string>\",\n \"currentEvaluationParams\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"productId\": \"prod_123\",\n \"specificationIds\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"judgePrompt": "<string>",
"evaluationParams": [
"<string>"
],
"description": "<string>"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}Revise metric configuration with AI ("Update With AI")
Given a metric config the caller already has (name, description, judge prompt, evaluation params, evaluation type) plus one line of feedback, returns a revised judge prompt, evaluation parameters, and description. Persists nothing — the caller decides whether to apply the result.
curl --request POST \
--url https://api.galtea.ai/metrics/update-config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Refusal Quality",
"currentJudgePrompt": "<string>",
"feedback": "it should not penalise a short answer",
"description": "<string>",
"currentEvaluationParams": [
"<string>"
],
"tags": [
"<string>"
],
"productId": "prod_123",
"specificationIds": [
"<string>"
]
}
'import requests
url = "https://api.galtea.ai/metrics/update-config"
payload = {
"name": "Refusal Quality",
"currentJudgePrompt": "<string>",
"feedback": "it should not penalise a short answer",
"description": "<string>",
"currentEvaluationParams": ["<string>"],
"tags": ["<string>"],
"productId": "prod_123",
"specificationIds": ["<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: 'Refusal Quality',
currentJudgePrompt: '<string>',
feedback: 'it should not penalise a short answer',
description: '<string>',
currentEvaluationParams: ['<string>'],
tags: ['<string>'],
productId: 'prod_123',
specificationIds: ['<string>']
})
};
fetch('https://api.galtea.ai/metrics/update-config', 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://api.galtea.ai/metrics/update-config",
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' => 'Refusal Quality',
'currentJudgePrompt' => '<string>',
'feedback' => 'it should not penalise a short answer',
'description' => '<string>',
'currentEvaluationParams' => [
'<string>'
],
'tags' => [
'<string>'
],
'productId' => 'prod_123',
'specificationIds' => [
'<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://api.galtea.ai/metrics/update-config"
payload := strings.NewReader("{\n \"name\": \"Refusal Quality\",\n \"currentJudgePrompt\": \"<string>\",\n \"feedback\": \"it should not penalise a short answer\",\n \"description\": \"<string>\",\n \"currentEvaluationParams\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"productId\": \"prod_123\",\n \"specificationIds\": [\n \"<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://api.galtea.ai/metrics/update-config")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Refusal Quality\",\n \"currentJudgePrompt\": \"<string>\",\n \"feedback\": \"it should not penalise a short answer\",\n \"description\": \"<string>\",\n \"currentEvaluationParams\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"productId\": \"prod_123\",\n \"specificationIds\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/metrics/update-config")
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\": \"Refusal Quality\",\n \"currentJudgePrompt\": \"<string>\",\n \"feedback\": \"it should not penalise a short answer\",\n \"description\": \"<string>\",\n \"currentEvaluationParams\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"productId\": \"prod_123\",\n \"specificationIds\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"judgePrompt": "<string>",
"evaluationParams": [
"<string>"
],
"description": "<string>"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}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
The metric's user-authored name — context for the revision, not returned in the response.
1 - 200"Refusal Quality"
PARTIAL_PROMPT (binary LLM judge) or HUMAN_EVALUATION (0-100 annotator guidelines).
PARTIAL_PROMPT, HUMAN_EVALUATION The metric's current judge prompt — the starting point the revision builds on.
1 - 20000Free-text instruction describing what to change about the current judge prompt.
1 - 2000"it should not penalise a short answer"
The metric's user-authored description — the criteria the judge prompt must evaluate.
1 - 5000The metric's current evaluation parameters, changed only if the feedback requires it. Always send them when the metric has any; omitting them can produce a revision whose declared parameters do not match its prompt.
201 - 64The metric's user-provided tags — context for the revision, not returned in the response.
201 - 64Optional product ID for additional context
1"prod_123"
At most one specification id, forwarded as optional context.
1