curl --request POST \
--url https://api.benchgen.com/api/competitions/create_from_spec/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Unit Conversion Basics",
"items": [
{
"question": "<string>",
"answer": "<string>",
"choices": [
"<string>"
],
"context": "<string>",
"group": "<string>"
}
],
"description": "<string>"
}
'import requests
url = "https://api.benchgen.com/api/competitions/create_from_spec/"
payload = {
"title": "Unit Conversion Basics",
"items": [
{
"question": "<string>",
"answer": "<string>",
"choices": ["<string>"],
"context": "<string>",
"group": "<string>"
}
],
"description": "<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({
title: 'Unit Conversion Basics',
items: [
{
question: '<string>',
answer: '<string>',
choices: ['<string>'],
context: '<string>',
group: '<string>'
}
],
description: '<string>'
})
};
fetch('https://api.benchgen.com/api/competitions/create_from_spec/', 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.benchgen.com/api/competitions/create_from_spec/",
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([
'title' => 'Unit Conversion Basics',
'items' => [
[
'question' => '<string>',
'answer' => '<string>',
'choices' => [
'<string>'
],
'context' => '<string>',
'group' => '<string>'
]
],
'description' => '<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.benchgen.com/api/competitions/create_from_spec/"
payload := strings.NewReader("{\n \"title\": \"Unit Conversion Basics\",\n \"items\": [\n {\n \"question\": \"<string>\",\n \"answer\": \"<string>\",\n \"choices\": [\n \"<string>\"\n ],\n \"context\": \"<string>\",\n \"group\": \"<string>\"\n }\n ],\n \"description\": \"<string>\"\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.benchgen.com/api/competitions/create_from_spec/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Unit Conversion Basics\",\n \"items\": [\n {\n \"question\": \"<string>\",\n \"answer\": \"<string>\",\n \"choices\": [\n \"<string>\"\n ],\n \"context\": \"<string>\",\n \"group\": \"<string>\"\n }\n ],\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.benchgen.com/api/competitions/create_from_spec/")
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 \"title\": \"Unit Conversion Basics\",\n \"items\": [\n {\n \"question\": \"<string>\",\n \"answer\": \"<string>\",\n \"choices\": [\n \"<string>\"\n ],\n \"context\": \"<string>\",\n \"group\": \"<string>\"\n }\n ],\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"valid": true,
"kind": "<string>",
"title": "<string>",
"status_id": 123
}{
"valid": false,
"errors": [
"items[2].answer is empty"
]
}{
"code": "quota_exceeded",
"detail": "<string>",
"limit": 123,
"used": 123,
"resets_at": "2023-11-07T05:31:56Z",
"window_seconds": 123
}Create a benchmark
One request, no files to build: send a title, a description and 5-2000 items. The platform validates them, builds the benchmark with its question-answer or multiple-choice importer (which generates the ingestion, scoring and LLM-judge programs) and queues creation. Items with choices make a multiple-choice benchmark; otherwise it is question-answer. The benchmark is created unpublished. Requires the benchmark:create scope. For API tokens and agents, creation is limited per user across every creation path (default 10 per rolling 24 hours and 3 per minute); a dry run does not count, and the web app and platform admins are not limited.
curl --request POST \
--url https://api.benchgen.com/api/competitions/create_from_spec/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Unit Conversion Basics",
"items": [
{
"question": "<string>",
"answer": "<string>",
"choices": [
"<string>"
],
"context": "<string>",
"group": "<string>"
}
],
"description": "<string>"
}
'import requests
url = "https://api.benchgen.com/api/competitions/create_from_spec/"
payload = {
"title": "Unit Conversion Basics",
"items": [
{
"question": "<string>",
"answer": "<string>",
"choices": ["<string>"],
"context": "<string>",
"group": "<string>"
}
],
"description": "<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({
title: 'Unit Conversion Basics',
items: [
{
question: '<string>',
answer: '<string>',
choices: ['<string>'],
context: '<string>',
group: '<string>'
}
],
description: '<string>'
})
};
fetch('https://api.benchgen.com/api/competitions/create_from_spec/', 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.benchgen.com/api/competitions/create_from_spec/",
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([
'title' => 'Unit Conversion Basics',
'items' => [
[
'question' => '<string>',
'answer' => '<string>',
'choices' => [
'<string>'
],
'context' => '<string>',
'group' => '<string>'
]
],
'description' => '<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.benchgen.com/api/competitions/create_from_spec/"
payload := strings.NewReader("{\n \"title\": \"Unit Conversion Basics\",\n \"items\": [\n {\n \"question\": \"<string>\",\n \"answer\": \"<string>\",\n \"choices\": [\n \"<string>\"\n ],\n \"context\": \"<string>\",\n \"group\": \"<string>\"\n }\n ],\n \"description\": \"<string>\"\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.benchgen.com/api/competitions/create_from_spec/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Unit Conversion Basics\",\n \"items\": [\n {\n \"question\": \"<string>\",\n \"answer\": \"<string>\",\n \"choices\": [\n \"<string>\"\n ],\n \"context\": \"<string>\",\n \"group\": \"<string>\"\n }\n ],\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.benchgen.com/api/competitions/create_from_spec/")
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 \"title\": \"Unit Conversion Basics\",\n \"items\": [\n {\n \"question\": \"<string>\",\n \"answer\": \"<string>\",\n \"choices\": [\n \"<string>\"\n ],\n \"context\": \"<string>\",\n \"group\": \"<string>\"\n }\n ],\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"valid": true,
"kind": "<string>",
"title": "<string>",
"status_id": 123
}{
"valid": false,
"errors": [
"items[2].answer is empty"
]
}{
"code": "quota_exceeded",
"detail": "<string>",
"limit": 123,
"used": 123,
"resets_at": "2023-11-07T05:31:56Z",
"window_seconds": 123
}Authorizations
Platform API token created under Profile Settings > Platform API tokens. Scopes are fixed at creation.
Query Parameters
Validate only: answers 200 with a summary and creates nothing
Body
Response
dry_run: the spec is valid; nothing was created