Upload a pre-prepared benchmark file with questions and answers.
This endpoint allows you to upload a JSON file containing benchmark questions and answers, associating it with a specific document for evaluation purposes.
Request Body (multipart/form-data):
file: JSON file containing benchmark questions and answers (required)name: Display name for the benchmark (required)document_id: Document ID that this benchmark is based on (required)description (optional): Description of the benchmarkFile Format:
The uploaded JSON file should contain an array of question objects. Each question should have:
[
{
"question_num": 1,
"question": "What is...",
"answer": "The answer is..."
}
]
Returns:
id: Unique identifier for the uploaded benchmarkname: Name of the benchmarkstatus: Upload status (pending, completed, failed)questions: List of benchmark question objects, each containing:
question_num: Question numberquestion: Question textanswer: Expected answer textnum_questions: Total number of questions in the benchmarkRaises:
400: If file format is invalid, JSON structure is incorrect, or document_id is not found413: If file size exceeds limitExample Request:
POST /api/v3/benchmark/upload
Headers: {"Authorization": "Bearer <api_key>"}
Content-Type: multipart/form-data
Form Data:
file: benchmark_questions.json
name: "Customer Support Q&A"
document_id: "doc-abc123"
description: "Benchmark for customer support documentation"
Example Response:
{
"id": "benchmark-xyz789",
"name": "Customer Support Q&A",
"status": "completed",
"questions": [
{
"question_num": 1,
"question": "How do I reset my password?",
"answer": "You can reset your password by clicking the 'Forgot Password' link on the login page."
},
{
"question_num": 2,
"question": "What are the system requirements?",
"answer": "The system requires a modern web browser with JavaScript enabled."
}
],
"num_questions": 2
}
Notes:
question_num, question, and answer fieldsBearer authentication header of the form Bearer <token>, where <token> is your auth token.
Returns the details of the uploaded benchmark including its unique identifier, name, status, and the list of questions with expected answers
Unique identifier for the benchmark
"benchmark-abc123"
Name of the benchmark
"My Benchmark"
Status of the benchmark
pending, completed, deploying, evaluating, undeployed, evaluated, failed "pending"
Number of questions in the benchmark
10
List of uploaded benchmark questions