Create Benchmark
curl --request POST \
--url https://api.nugen.in/api/v3/benchmarks/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document_ids": [
"document_01k4x9m2p7q3r5s8",
"document_01k4x9m2p7q3r5s9"
],
"benchmark_name": "Customer Support Q&A",
"num_questions": 10
}
'import requests
url = "https://api.nugen.in/api/v3/benchmarks/create"
payload = {
"document_ids": ["document_01k4x9m2p7q3r5s8", "document_01k4x9m2p7q3r5s9"],
"benchmark_name": "Customer Support Q&A",
"num_questions": 10
}
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({
document_ids: ['document_01k4x9m2p7q3r5s8', 'document_01k4x9m2p7q3r5s9'],
benchmark_name: 'Customer Support Q&A',
num_questions: 10
})
};
fetch('https://api.nugen.in/api/v3/benchmarks/create', 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.nugen.in/api/v3/benchmarks/create",
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([
'document_ids' => [
'document_01k4x9m2p7q3r5s8',
'document_01k4x9m2p7q3r5s9'
],
'benchmark_name' => 'Customer Support Q&A',
'num_questions' => 10
]),
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.nugen.in/api/v3/benchmarks/create"
payload := strings.NewReader("{\n \"document_ids\": [\n \"document_01k4x9m2p7q3r5s8\",\n \"document_01k4x9m2p7q3r5s9\"\n ],\n \"benchmark_name\": \"Customer Support Q&A\",\n \"num_questions\": 10\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.nugen.in/api/v3/benchmarks/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document_ids\": [\n \"document_01k4x9m2p7q3r5s8\",\n \"document_01k4x9m2p7q3r5s9\"\n ],\n \"benchmark_name\": \"Customer Support Q&A\",\n \"num_questions\": 10\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nugen.in/api/v3/benchmarks/create")
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 \"document_ids\": [\n \"document_01k4x9m2p7q3r5s8\",\n \"document_01k4x9m2p7q3r5s9\"\n ],\n \"benchmark_name\": \"Customer Support Q&A\",\n \"num_questions\": 10\n}"
response = http.request(request)
puts response.read_body{
"benchmark_id": "benchmark_01k4x9m2p7q3r6a1",
"benchmark_name": "Customer Support Q&A",
"status": "PROCESSING"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Benchmarks
Create Benchmark
Create a new benchmark generation run from documents.
This endpoint starts a process to automatically generate benchmark questions from specified documents using AI. The generated questions can be used for model evaluation and testing.
Request Body:
document_ids: List of document IDs to generate benchmarks from (required)num_questions: Number of benchmark questions to generate (required)benchmark_name(optional): Display name. Defaults to the benchmark id if omitted
Returns:
benchmark_id: Unique identifier for tracking generation progressstatus: Initial status (alwaysPROCESSING)
Raises:
400: If no documents provided400: If document validation fails (missing documents or unauthorized access)
Example Request:
POST /api/v3/benchmarks/create
Headers: {"Authorization": "Bearer <api_key>"}
{
"document_ids": ["document_01k4x9m2p7q3r5s8", "document_01k4x9m2p7q3r5sc", "document_01k4x9m2p7q3r5sd"],
"num_questions": 10
}
Example Response:
{
"benchmark_id": "benchmark_01k4x9m2p7q3r6a1",
"status": "PROCESSING"
}
Notes:
- All document IDs are validated before creation to ensure they exist and belong to the user
- Use the returned benchmark_id with
/benchmarks/{id}/statusendpoint to track generation progress - Once completed, the benchmark will be available for use in model evaluations
POST
/
api
/
v3
/
benchmarks
/
create
Create Benchmark
curl --request POST \
--url https://api.nugen.in/api/v3/benchmarks/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document_ids": [
"document_01k4x9m2p7q3r5s8",
"document_01k4x9m2p7q3r5s9"
],
"benchmark_name": "Customer Support Q&A",
"num_questions": 10
}
'import requests
url = "https://api.nugen.in/api/v3/benchmarks/create"
payload = {
"document_ids": ["document_01k4x9m2p7q3r5s8", "document_01k4x9m2p7q3r5s9"],
"benchmark_name": "Customer Support Q&A",
"num_questions": 10
}
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({
document_ids: ['document_01k4x9m2p7q3r5s8', 'document_01k4x9m2p7q3r5s9'],
benchmark_name: 'Customer Support Q&A',
num_questions: 10
})
};
fetch('https://api.nugen.in/api/v3/benchmarks/create', 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.nugen.in/api/v3/benchmarks/create",
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([
'document_ids' => [
'document_01k4x9m2p7q3r5s8',
'document_01k4x9m2p7q3r5s9'
],
'benchmark_name' => 'Customer Support Q&A',
'num_questions' => 10
]),
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.nugen.in/api/v3/benchmarks/create"
payload := strings.NewReader("{\n \"document_ids\": [\n \"document_01k4x9m2p7q3r5s8\",\n \"document_01k4x9m2p7q3r5s9\"\n ],\n \"benchmark_name\": \"Customer Support Q&A\",\n \"num_questions\": 10\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.nugen.in/api/v3/benchmarks/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document_ids\": [\n \"document_01k4x9m2p7q3r5s8\",\n \"document_01k4x9m2p7q3r5s9\"\n ],\n \"benchmark_name\": \"Customer Support Q&A\",\n \"num_questions\": 10\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nugen.in/api/v3/benchmarks/create")
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 \"document_ids\": [\n \"document_01k4x9m2p7q3r5s8\",\n \"document_01k4x9m2p7q3r5s9\"\n ],\n \"benchmark_name\": \"Customer Support Q&A\",\n \"num_questions\": 10\n}"
response = http.request(request)
puts response.read_body{
"benchmark_id": "benchmark_01k4x9m2p7q3r6a1",
"benchmark_name": "Customer Support Q&A",
"status": "PROCESSING"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
List of document IDs to generate benchmark from
Example:
[
"document_01k4x9m2p7q3r5s8",
"document_01k4x9m2p7q3r5s9"
]
Display name for the benchmark. Defaults to the benchmark id if omitted.
Example:
"Customer Support Q&A"
Number of questions to generate (if None, DeepEval decides based on content)
Required range:
1 <= x <= 100Example:
10
Response
Returns a unique identifier and initial status for the benchmark generation initiated from specified documents
Was this page helpful?