curl --request POST \
--url https://api.mixpeek.com/v1/retrievers/evaluations/datasets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Namespace: <api-key>' \
--data '
{
"dataset_name": "<string>",
"description": "<string>",
"queries": [
{
"query_id": "<string>",
"query_input": {},
"relevant_documents": [
"<string>"
],
"relevance_scores": {}
}
],
"from_annotations": {
"as_of": "2023-11-07T05:31:56Z",
"retriever_id": "<string>",
"relevant_labels": [
"<string>"
],
"entity": "document"
},
"metadata": {},
"relevance_field": "metadata.frame_key"
}
'import requests
url = "https://api.mixpeek.com/v1/retrievers/evaluations/datasets"
payload = {
"dataset_name": "<string>",
"description": "<string>",
"queries": [
{
"query_id": "<string>",
"query_input": {},
"relevant_documents": ["<string>"],
"relevance_scores": {}
}
],
"from_annotations": {
"as_of": "2023-11-07T05:31:56Z",
"retriever_id": "<string>",
"relevant_labels": ["<string>"],
"entity": "document"
},
"metadata": {},
"relevance_field": "metadata.frame_key"
}
headers = {
"Authorization": "Bearer <token>",
"X-Namespace": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Namespace': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
dataset_name: '<string>',
description: '<string>',
queries: [
{
query_id: '<string>',
query_input: {},
relevant_documents: ['<string>'],
relevance_scores: {}
}
],
from_annotations: {
as_of: '2023-11-07T05:31:56Z',
retriever_id: '<string>',
relevant_labels: ['<string>'],
entity: 'document'
},
metadata: {},
relevance_field: 'metadata.frame_key'
})
};
fetch('https://api.mixpeek.com/v1/retrievers/evaluations/datasets', 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.mixpeek.com/v1/retrievers/evaluations/datasets",
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([
'dataset_name' => '<string>',
'description' => '<string>',
'queries' => [
[
'query_id' => '<string>',
'query_input' => [
],
'relevant_documents' => [
'<string>'
],
'relevance_scores' => [
]
]
],
'from_annotations' => [
'as_of' => '2023-11-07T05:31:56Z',
'retriever_id' => '<string>',
'relevant_labels' => [
'<string>'
],
'entity' => 'document'
],
'metadata' => [
],
'relevance_field' => 'metadata.frame_key'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Namespace: <api-key>"
],
]);
$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.mixpeek.com/v1/retrievers/evaluations/datasets"
payload := strings.NewReader("{\n \"dataset_name\": \"<string>\",\n \"description\": \"<string>\",\n \"queries\": [\n {\n \"query_id\": \"<string>\",\n \"query_input\": {},\n \"relevant_documents\": [\n \"<string>\"\n ],\n \"relevance_scores\": {}\n }\n ],\n \"from_annotations\": {\n \"as_of\": \"2023-11-07T05:31:56Z\",\n \"retriever_id\": \"<string>\",\n \"relevant_labels\": [\n \"<string>\"\n ],\n \"entity\": \"document\"\n },\n \"metadata\": {},\n \"relevance_field\": \"metadata.frame_key\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-Namespace", "<api-key>")
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.mixpeek.com/v1/retrievers/evaluations/datasets")
.header("Authorization", "Bearer <token>")
.header("X-Namespace", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"dataset_name\": \"<string>\",\n \"description\": \"<string>\",\n \"queries\": [\n {\n \"query_id\": \"<string>\",\n \"query_input\": {},\n \"relevant_documents\": [\n \"<string>\"\n ],\n \"relevance_scores\": {}\n }\n ],\n \"from_annotations\": {\n \"as_of\": \"2023-11-07T05:31:56Z\",\n \"retriever_id\": \"<string>\",\n \"relevant_labels\": [\n \"<string>\"\n ],\n \"entity\": \"document\"\n },\n \"metadata\": {},\n \"relevance_field\": \"metadata.frame_key\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixpeek.com/v1/retrievers/evaluations/datasets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-Namespace"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dataset_name\": \"<string>\",\n \"description\": \"<string>\",\n \"queries\": [\n {\n \"query_id\": \"<string>\",\n \"query_input\": {},\n \"relevant_documents\": [\n \"<string>\"\n ],\n \"relevance_scores\": {}\n }\n ],\n \"from_annotations\": {\n \"as_of\": \"2023-11-07T05:31:56Z\",\n \"retriever_id\": \"<string>\",\n \"relevant_labels\": [\n \"<string>\"\n ],\n \"entity\": \"document\"\n },\n \"metadata\": {},\n \"relevance_field\": \"metadata.frame_key\"\n}"
response = http.request(request)
puts response.read_body{
"dataset_id": "<string>",
"dataset_name": "<string>",
"queries": [
{
"query_id": "<string>",
"query_input": {},
"relevant_documents": [
"<string>"
],
"relevance_scores": {}
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"namespace_id": "<string>",
"internal_id": "<string>",
"query_count": 123,
"description": "<string>",
"metadata": {},
"relevance_field": "metadata.frame_key"
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}Create evaluation dataset
Creates an evaluation dataset in the namespace in the request: a named set of test queries, each listing the documents a good retriever should return. Each entry in queries has a query_id, a query_input in the same shape as a retriever execution’s inputs, relevant_documents, and optional relevance_scores (0 to 5) for graded NDCG. Set relevance_field to grade by a result field instead of document ID. Answers 409 when dataset_name is taken. To build a dataset from real user clicks instead, use POST /v1/retrievers/{retriever_id}/evaluations/generate-from-interactions.
Retriever Evaluations: A retriever evaluation scores a retriever against an evaluation dataset, which is a set of test queries with the documents each query should return. It reports metrics such as precision, recall, NDCG and MRR per cutoff. Use it to measure retrieval quality offline and to compare retriever versions. Read the guide.
curl --request POST \
--url https://api.mixpeek.com/v1/retrievers/evaluations/datasets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Namespace: <api-key>' \
--data '
{
"dataset_name": "<string>",
"description": "<string>",
"queries": [
{
"query_id": "<string>",
"query_input": {},
"relevant_documents": [
"<string>"
],
"relevance_scores": {}
}
],
"from_annotations": {
"as_of": "2023-11-07T05:31:56Z",
"retriever_id": "<string>",
"relevant_labels": [
"<string>"
],
"entity": "document"
},
"metadata": {},
"relevance_field": "metadata.frame_key"
}
'import requests
url = "https://api.mixpeek.com/v1/retrievers/evaluations/datasets"
payload = {
"dataset_name": "<string>",
"description": "<string>",
"queries": [
{
"query_id": "<string>",
"query_input": {},
"relevant_documents": ["<string>"],
"relevance_scores": {}
}
],
"from_annotations": {
"as_of": "2023-11-07T05:31:56Z",
"retriever_id": "<string>",
"relevant_labels": ["<string>"],
"entity": "document"
},
"metadata": {},
"relevance_field": "metadata.frame_key"
}
headers = {
"Authorization": "Bearer <token>",
"X-Namespace": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Namespace': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
dataset_name: '<string>',
description: '<string>',
queries: [
{
query_id: '<string>',
query_input: {},
relevant_documents: ['<string>'],
relevance_scores: {}
}
],
from_annotations: {
as_of: '2023-11-07T05:31:56Z',
retriever_id: '<string>',
relevant_labels: ['<string>'],
entity: 'document'
},
metadata: {},
relevance_field: 'metadata.frame_key'
})
};
fetch('https://api.mixpeek.com/v1/retrievers/evaluations/datasets', 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.mixpeek.com/v1/retrievers/evaluations/datasets",
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([
'dataset_name' => '<string>',
'description' => '<string>',
'queries' => [
[
'query_id' => '<string>',
'query_input' => [
],
'relevant_documents' => [
'<string>'
],
'relevance_scores' => [
]
]
],
'from_annotations' => [
'as_of' => '2023-11-07T05:31:56Z',
'retriever_id' => '<string>',
'relevant_labels' => [
'<string>'
],
'entity' => 'document'
],
'metadata' => [
],
'relevance_field' => 'metadata.frame_key'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Namespace: <api-key>"
],
]);
$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.mixpeek.com/v1/retrievers/evaluations/datasets"
payload := strings.NewReader("{\n \"dataset_name\": \"<string>\",\n \"description\": \"<string>\",\n \"queries\": [\n {\n \"query_id\": \"<string>\",\n \"query_input\": {},\n \"relevant_documents\": [\n \"<string>\"\n ],\n \"relevance_scores\": {}\n }\n ],\n \"from_annotations\": {\n \"as_of\": \"2023-11-07T05:31:56Z\",\n \"retriever_id\": \"<string>\",\n \"relevant_labels\": [\n \"<string>\"\n ],\n \"entity\": \"document\"\n },\n \"metadata\": {},\n \"relevance_field\": \"metadata.frame_key\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-Namespace", "<api-key>")
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.mixpeek.com/v1/retrievers/evaluations/datasets")
.header("Authorization", "Bearer <token>")
.header("X-Namespace", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"dataset_name\": \"<string>\",\n \"description\": \"<string>\",\n \"queries\": [\n {\n \"query_id\": \"<string>\",\n \"query_input\": {},\n \"relevant_documents\": [\n \"<string>\"\n ],\n \"relevance_scores\": {}\n }\n ],\n \"from_annotations\": {\n \"as_of\": \"2023-11-07T05:31:56Z\",\n \"retriever_id\": \"<string>\",\n \"relevant_labels\": [\n \"<string>\"\n ],\n \"entity\": \"document\"\n },\n \"metadata\": {},\n \"relevance_field\": \"metadata.frame_key\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixpeek.com/v1/retrievers/evaluations/datasets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-Namespace"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dataset_name\": \"<string>\",\n \"description\": \"<string>\",\n \"queries\": [\n {\n \"query_id\": \"<string>\",\n \"query_input\": {},\n \"relevant_documents\": [\n \"<string>\"\n ],\n \"relevance_scores\": {}\n }\n ],\n \"from_annotations\": {\n \"as_of\": \"2023-11-07T05:31:56Z\",\n \"retriever_id\": \"<string>\",\n \"relevant_labels\": [\n \"<string>\"\n ],\n \"entity\": \"document\"\n },\n \"metadata\": {},\n \"relevance_field\": \"metadata.frame_key\"\n}"
response = http.request(request)
puts response.read_body{
"dataset_id": "<string>",
"dataset_name": "<string>",
"queries": [
{
"query_id": "<string>",
"query_input": {},
"relevant_documents": [
"<string>"
],
"relevance_scores": {}
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"namespace_id": "<string>",
"internal_id": "<string>",
"query_count": 123,
"description": "<string>",
"metadata": {},
"relevance_field": "metadata.frame_key"
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}Authorizations
Mixpeek API key, sent as Authorization: Bearer mxp_sk_.... Create one in Studio under Settings → API Keys, or with an admin key via POST /v1/organizations/users/{user_email}/api-keys. A missing, malformed, unknown, revoked, inactive or expired key returns 401; a key without the permission, scope or plan an operation needs returns 403.
Body
Keys this body does not declare are refused with 422 extra_forbidden naming the accepted keys (since 2026-11-02).
Request model for creating a new evaluation dataset.
Grade by this field of each result instead of its document id, for a retriever that groups documents (reduce or group_by). relevant_documents then lists values of the field, and results that share a value count once. Dotted paths reach nested fields, e.g. 'metadata.frame_key'.
"metadata.frame_key"
Response
Successful Response
Complete evaluation dataset with metadata.
An evaluation dataset is a collection of queries with ground truth relevance labels, used to measure retriever quality.
Grade by this field of each result instead of its document id, for a retriever that groups documents (reduce or group_by). relevant_documents then lists values of the field, and results that share a value count once. Dotted paths reach nested fields, e.g. 'metadata.frame_key'.
"metadata.frame_key"
Was this page helpful?

