curl --request GET \
--url https://api.galtea.ai/metrics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.galtea.ai/metrics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.galtea.ai/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://api.galtea.ai/metrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.galtea.ai/metrics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.galtea.ai/metrics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "metric_123",
"metricGroupId": "metric_123",
"parentMetricId": "metric_122",
"organizationId": "org_123",
"userId": "user_123",
"name": "Accuracy",
"evaluationParams": [
"input",
"actual_output",
"expected_output"
],
"source": "PARTIAL_PROMPT",
"judgePrompt": "Evaluate the accuracy of the response",
"tags": [
"accuracy",
"quality"
],
"description": "Measures the accuracy of responses",
"documentationUrl": "https://docs.example.com/metrics/accuracy",
"evaluatorModelName": "GPT-4",
"areEvalParamsTop": true,
"isBeingOptimized": true,
"optimizationStatus": "READY_FOR_REVIEW",
"judgeGenerationSettings": {
"temperature": 0.3,
"topP": 0.9,
"maxOutputTokens": 512,
"reasoningEffort": "low"
},
"optimizationValidation": {
"used": true,
"heldOutEvaluationIds": [
"evaluation_123"
],
"results": {
"optimization": {
"rowsScored": 25,
"rowsTotal": 25,
"source": {
"correct": 20,
"alignment": 0.71
},
"candidate": {
"correct": 20,
"alignment": 0.71
}
},
"validation": {
"rowsScored": 25,
"rowsTotal": 25,
"source": {
"correct": 20,
"alignment": 0.71
},
"candidate": {
"correct": 20,
"alignment": 0.71
}
}
},
"rows": [
{
"evaluationId": "evaluation_123",
"humanScore": 1,
"sourceScore": 0,
"candidateScore": 1
}
]
},
"optimizationRun": {
"strategies": [
"ADD_RUBRIC",
"SIMPLIFY"
],
"maxSteps": 6,
"stepsUsed": 4
},
"specificationIds": [
"spec_123"
],
"userGroupIds": [
"ug_123"
],
"createdAt": "2023-11-07T05:31:56Z",
"legacyAt": "2023-11-07T05:31:56Z",
"disabledAt": "2023-11-07T05:31:56Z",
"excludedFromAnalyticsAt": "2023-11-07T05:31:56Z",
"excludedByUserId": "<string>"
}
]{
"error": "Error type",
"message": "Error message description"
}Get metrics
Get list of metrics with pagination and filtering. See Metrics.
curl --request GET \
--url https://api.galtea.ai/metrics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.galtea.ai/metrics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.galtea.ai/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://api.galtea.ai/metrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.galtea.ai/metrics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.galtea.ai/metrics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "metric_123",
"metricGroupId": "metric_123",
"parentMetricId": "metric_122",
"organizationId": "org_123",
"userId": "user_123",
"name": "Accuracy",
"evaluationParams": [
"input",
"actual_output",
"expected_output"
],
"source": "PARTIAL_PROMPT",
"judgePrompt": "Evaluate the accuracy of the response",
"tags": [
"accuracy",
"quality"
],
"description": "Measures the accuracy of responses",
"documentationUrl": "https://docs.example.com/metrics/accuracy",
"evaluatorModelName": "GPT-4",
"areEvalParamsTop": true,
"isBeingOptimized": true,
"optimizationStatus": "READY_FOR_REVIEW",
"judgeGenerationSettings": {
"temperature": 0.3,
"topP": 0.9,
"maxOutputTokens": 512,
"reasoningEffort": "low"
},
"optimizationValidation": {
"used": true,
"heldOutEvaluationIds": [
"evaluation_123"
],
"results": {
"optimization": {
"rowsScored": 25,
"rowsTotal": 25,
"source": {
"correct": 20,
"alignment": 0.71
},
"candidate": {
"correct": 20,
"alignment": 0.71
}
},
"validation": {
"rowsScored": 25,
"rowsTotal": 25,
"source": {
"correct": 20,
"alignment": 0.71
},
"candidate": {
"correct": 20,
"alignment": 0.71
}
}
},
"rows": [
{
"evaluationId": "evaluation_123",
"humanScore": 1,
"sourceScore": 0,
"candidateScore": 1
}
]
},
"optimizationRun": {
"strategies": [
"ADD_RUBRIC",
"SIMPLIFY"
],
"maxSteps": 6,
"stepsUsed": 4
},
"specificationIds": [
"spec_123"
],
"userGroupIds": [
"ug_123"
],
"createdAt": "2023-11-07T05:31:56Z",
"legacyAt": "2023-11-07T05:31:56Z",
"disabledAt": "2023-11-07T05:31:56Z",
"excludedFromAnalyticsAt": "2023-11-07T05:31:56Z",
"excludedByUserId": "<string>"
}
]{
"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-....
Query Parameters
Filter by metric IDs
Filter by metric family IDs (Metric.metricGroupId). Returns every revision of the family, legacy ones included.
Filter by organization IDs
Filter by product IDs
Filter by metric names (exact match, multiple)
Filter by metric name (partial match)
Filter by metric description (partial match)
Filter by tags
Filter by metric sources
SELF_HOSTED, FULL_PROMPT, PARTIAL_PROMPT, HUMAN_EVALUATION, GEVAL, DEEPEVAL, DETERMINISTIC Filter by specification IDs
Filter by user group IDs
Filter metrics created at or after this timestamp (ISO 8601 format)
Filter metrics created at or before this timestamp (ISO 8601 format)
Include default/predefined metrics
Include metrics owned by the user's organization
Include legacy/deprecated metrics. Also includes an optimization candidate waiting for review, which is legacy until it is activated.
Include metric revisions that are excluded from analytics
Filter metrics suitable for monitoring
Sort instructions (field and direction pairs)
Maximum number of results
Number of results to skip
Response
Metrics retrieved successfully
"metric_123"
Identifier shared by every metric in the same revision family. Server-managed — derived from parentMetricId on create (or generated for roots). Cannot be set by the caller.
"metric_123"
Id of the direct parent metric. On create, providing this value turns the new metric into a revision: it joins the parent's family and (if the parent is active) flips the parent to legacy. Omit or null to create a root metric in a fresh group. On responses, this is the recorded parent edge (null for roots).
"metric_122"
"org_123"
"user_123"
"Accuracy"
Ordered list of trace fields the evaluator needs, written in snake_case (e.g. input, actual_output, expected_output, retrieval_context). Determines which data the evaluation engine extracts from each trace. Full list of accepted values: https://docs.galtea.ai/concepts/metric/evaluation-parameters
["input", "actual_output", "expected_output"]
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.
SELF_HOSTED, FULL_PROMPT, PARTIAL_PROMPT, HUMAN_EVALUATION, GEVAL, DEEPEVAL, DETERMINISTIC "PARTIAL_PROMPT"
"Evaluate the accuracy of the response"
["accuracy", "quality"]
"Measures the accuracy of responses"
"https://docs.example.com/metrics/accuracy"
"GPT-4"
When true, evaluationParams are injected at the top level of the evaluator prompt instead of nested inside the conversation context.
Whether the metric is currently being optimized.
Where an optimization attempt stands. Null for a metric that did not come from an optimization. A candidate waiting for review is legacy until it is activated.
OPTIMIZING, READY_FOR_REVIEW, FAILED, NO_IMPROVEMENT, DECLINED, ACTIVATED "READY_FOR_REVIEW"
The generation settings this metric's judge runs with. Null runs the platform defaults. Immutable: changing one creates a revision.
Show child attributes
Show child attributes
How an optimization attempt was validated: the held-out evaluations and, once the optimizer reported, both prompts scored on the search rows and on the held-out rows. Set on an optimization attempt only, and null for any other metric, for an attempt that predates it, and for an attempt copied from another organization.
Show child attributes
Show child attributes
What an optimization attempt ran: the strategies, the step budget and the steps used. Null while the attempt runs, and when it was not reported: an attempt from before the report existed, one run by an older optimizer, a failed run, an attempt copied from another organization, or a metric that is not an optimization attempt. Null never means a run of 0 steps.
Show child attributes
Show child attributes
["spec_123"]
["ug_123"]
Earliest non-null of this metric's own legacy date and its evaluator model's unselectableAt, so a model no longer selectable makes every metric linked to it report as legacy even though the metric row itself is untouched. Present only once that date has passed: a scheduled future cutoff reports null, because the metric is still active until then. Unlike disabledAt, this field never carries a future date.
Earliest non-null of this metric's own disabled date and its evaluator model's disabledAt — a disabled model makes every metric linked to it report as disabled even though the metric row itself is untouched.
When set, results produced by this metric revision do not feed analytics.
User who last excluded this metric revision from analytics.