Update an existing metric (deprecated)
curl --request PUT \
--url https://api.honeyhive.ai/v1/metrics \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"name": "<string>",
"criteria": "<string>",
"description": "<string>",
"enabled_in_prod": true,
"needs_ground_truth": true,
"sampling_percentage": 50,
"model_provider": "<string>",
"model_name": "<string>",
"scale": 123,
"threshold": {
"min": 123,
"max": 123,
"pass_when": true,
"passing_categories": [
"<string>"
]
},
"categories": [
{
"category": "<string>",
"score": 123
}
],
"child_metrics": [
{
"name": "<string>",
"weight": 123,
"id": "<string>",
"scale": 123
}
]
}
'import requests
url = "https://api.honeyhive.ai/v1/metrics"
payload = {
"id": "<string>",
"name": "<string>",
"criteria": "<string>",
"description": "<string>",
"enabled_in_prod": True,
"needs_ground_truth": True,
"sampling_percentage": 50,
"model_provider": "<string>",
"model_name": "<string>",
"scale": 123,
"threshold": {
"min": 123,
"max": 123,
"pass_when": True,
"passing_categories": ["<string>"]
},
"categories": [
{
"category": "<string>",
"score": 123
}
],
"child_metrics": [
{
"name": "<string>",
"weight": 123,
"id": "<string>",
"scale": 123
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '<string>',
name: '<string>',
criteria: '<string>',
description: '<string>',
enabled_in_prod: true,
needs_ground_truth: true,
sampling_percentage: 50,
model_provider: '<string>',
model_name: '<string>',
scale: 123,
threshold: {min: 123, max: 123, pass_when: true, passing_categories: ['<string>']},
categories: [{category: '<string>', score: 123}],
child_metrics: [{name: '<string>', weight: 123, id: '<string>', scale: 123}]
})
};
fetch('https://api.honeyhive.ai/v1/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.honeyhive.ai/v1/metrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'id' => '<string>',
'name' => '<string>',
'criteria' => '<string>',
'description' => '<string>',
'enabled_in_prod' => true,
'needs_ground_truth' => true,
'sampling_percentage' => 50,
'model_provider' => '<string>',
'model_name' => '<string>',
'scale' => 123,
'threshold' => [
'min' => 123,
'max' => 123,
'pass_when' => true,
'passing_categories' => [
'<string>'
]
],
'categories' => [
[
'category' => '<string>',
'score' => 123
]
],
'child_metrics' => [
[
'name' => '<string>',
'weight' => 123,
'id' => '<string>',
'scale' => 123
]
]
]),
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.honeyhive.ai/v1/metrics"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"criteria\": \"<string>\",\n \"description\": \"<string>\",\n \"enabled_in_prod\": true,\n \"needs_ground_truth\": true,\n \"sampling_percentage\": 50,\n \"model_provider\": \"<string>\",\n \"model_name\": \"<string>\",\n \"scale\": 123,\n \"threshold\": {\n \"min\": 123,\n \"max\": 123,\n \"pass_when\": true,\n \"passing_categories\": [\n \"<string>\"\n ]\n },\n \"categories\": [\n {\n \"category\": \"<string>\",\n \"score\": 123\n }\n ],\n \"child_metrics\": [\n {\n \"name\": \"<string>\",\n \"weight\": 123,\n \"id\": \"<string>\",\n \"scale\": 123\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.honeyhive.ai/v1/metrics")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"criteria\": \"<string>\",\n \"description\": \"<string>\",\n \"enabled_in_prod\": true,\n \"needs_ground_truth\": true,\n \"sampling_percentage\": 50,\n \"model_provider\": \"<string>\",\n \"model_name\": \"<string>\",\n \"scale\": 123,\n \"threshold\": {\n \"min\": 123,\n \"max\": 123,\n \"pass_when\": true,\n \"passing_categories\": [\n \"<string>\"\n ]\n },\n \"categories\": [\n {\n \"category\": \"<string>\",\n \"score\": 123\n }\n ],\n \"child_metrics\": [\n {\n \"name\": \"<string>\",\n \"weight\": 123,\n \"id\": \"<string>\",\n \"scale\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.honeyhive.ai/v1/metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"criteria\": \"<string>\",\n \"description\": \"<string>\",\n \"enabled_in_prod\": true,\n \"needs_ground_truth\": true,\n \"sampling_percentage\": 50,\n \"model_provider\": \"<string>\",\n \"model_name\": \"<string>\",\n \"scale\": 123,\n \"threshold\": {\n \"min\": 123,\n \"max\": 123,\n \"pass_when\": true,\n \"passing_categories\": [\n \"<string>\"\n ]\n },\n \"categories\": [\n {\n \"category\": \"<string>\",\n \"score\": 123\n }\n ],\n \"child_metrics\": [\n {\n \"name\": \"<string>\",\n \"weight\": 123,\n \"id\": \"<string>\",\n \"scale\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"updated": true
}Metrics
Update an existing metric (deprecated)
deprecated
Deprecated. Use PUT /v1/metrics/{metric_id} instead.
PUT
/
v1
/
metrics
Update an existing metric (deprecated)
curl --request PUT \
--url https://api.honeyhive.ai/v1/metrics \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"name": "<string>",
"criteria": "<string>",
"description": "<string>",
"enabled_in_prod": true,
"needs_ground_truth": true,
"sampling_percentage": 50,
"model_provider": "<string>",
"model_name": "<string>",
"scale": 123,
"threshold": {
"min": 123,
"max": 123,
"pass_when": true,
"passing_categories": [
"<string>"
]
},
"categories": [
{
"category": "<string>",
"score": 123
}
],
"child_metrics": [
{
"name": "<string>",
"weight": 123,
"id": "<string>",
"scale": 123
}
]
}
'import requests
url = "https://api.honeyhive.ai/v1/metrics"
payload = {
"id": "<string>",
"name": "<string>",
"criteria": "<string>",
"description": "<string>",
"enabled_in_prod": True,
"needs_ground_truth": True,
"sampling_percentage": 50,
"model_provider": "<string>",
"model_name": "<string>",
"scale": 123,
"threshold": {
"min": 123,
"max": 123,
"pass_when": True,
"passing_categories": ["<string>"]
},
"categories": [
{
"category": "<string>",
"score": 123
}
],
"child_metrics": [
{
"name": "<string>",
"weight": 123,
"id": "<string>",
"scale": 123
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '<string>',
name: '<string>',
criteria: '<string>',
description: '<string>',
enabled_in_prod: true,
needs_ground_truth: true,
sampling_percentage: 50,
model_provider: '<string>',
model_name: '<string>',
scale: 123,
threshold: {min: 123, max: 123, pass_when: true, passing_categories: ['<string>']},
categories: [{category: '<string>', score: 123}],
child_metrics: [{name: '<string>', weight: 123, id: '<string>', scale: 123}]
})
};
fetch('https://api.honeyhive.ai/v1/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.honeyhive.ai/v1/metrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'id' => '<string>',
'name' => '<string>',
'criteria' => '<string>',
'description' => '<string>',
'enabled_in_prod' => true,
'needs_ground_truth' => true,
'sampling_percentage' => 50,
'model_provider' => '<string>',
'model_name' => '<string>',
'scale' => 123,
'threshold' => [
'min' => 123,
'max' => 123,
'pass_when' => true,
'passing_categories' => [
'<string>'
]
],
'categories' => [
[
'category' => '<string>',
'score' => 123
]
],
'child_metrics' => [
[
'name' => '<string>',
'weight' => 123,
'id' => '<string>',
'scale' => 123
]
]
]),
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.honeyhive.ai/v1/metrics"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"criteria\": \"<string>\",\n \"description\": \"<string>\",\n \"enabled_in_prod\": true,\n \"needs_ground_truth\": true,\n \"sampling_percentage\": 50,\n \"model_provider\": \"<string>\",\n \"model_name\": \"<string>\",\n \"scale\": 123,\n \"threshold\": {\n \"min\": 123,\n \"max\": 123,\n \"pass_when\": true,\n \"passing_categories\": [\n \"<string>\"\n ]\n },\n \"categories\": [\n {\n \"category\": \"<string>\",\n \"score\": 123\n }\n ],\n \"child_metrics\": [\n {\n \"name\": \"<string>\",\n \"weight\": 123,\n \"id\": \"<string>\",\n \"scale\": 123\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.honeyhive.ai/v1/metrics")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"criteria\": \"<string>\",\n \"description\": \"<string>\",\n \"enabled_in_prod\": true,\n \"needs_ground_truth\": true,\n \"sampling_percentage\": 50,\n \"model_provider\": \"<string>\",\n \"model_name\": \"<string>\",\n \"scale\": 123,\n \"threshold\": {\n \"min\": 123,\n \"max\": 123,\n \"pass_when\": true,\n \"passing_categories\": [\n \"<string>\"\n ]\n },\n \"categories\": [\n {\n \"category\": \"<string>\",\n \"score\": 123\n }\n ],\n \"child_metrics\": [\n {\n \"name\": \"<string>\",\n \"weight\": 123,\n \"id\": \"<string>\",\n \"scale\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.honeyhive.ai/v1/metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"criteria\": \"<string>\",\n \"description\": \"<string>\",\n \"enabled_in_prod\": true,\n \"needs_ground_truth\": true,\n \"sampling_percentage\": 50,\n \"model_provider\": \"<string>\",\n \"model_name\": \"<string>\",\n \"scale\": 123,\n \"threshold\": {\n \"min\": 123,\n \"max\": 123,\n \"pass_when\": true,\n \"passing_categories\": [\n \"<string>\"\n ]\n },\n \"categories\": [\n {\n \"category\": \"<string>\",\n \"score\": 123\n }\n ],\n \"child_metrics\": [\n {\n \"name\": \"<string>\",\n \"weight\": 123,\n \"id\": \"<string>\",\n \"scale\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"updated": true
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Request body for PUT /metrics (deprecated — use PUT /metrics/{metric_id})
Minimum string length:
1Maximum string length:
200Available options:
PYTHON, LLM, HUMAN, COMPOSITE Minimum string length:
1Available options:
float, boolean, string, categorical Required range:
0 <= x <= 100Show child attributes
Show child attributes
Minimum array length:
1Show child attributes
Show child attributes
Minimum array length:
1Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
200 - application/json
Metric updated successfully
Response for PUT /metrics
Was this page helpful?
⌘I

