Upload Benchmark
General
Upload Benchmark
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)benchmark_name: Display name for the benchmark (required)document_id: Document ID that this benchmark is based on (required)description(optional): Description of the benchmark
File 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:
benchmark_id: Unique identifier for the uploaded benchmarkbenchmark_name: Name of the benchmarkstatus: Upload status (PROCESSING,READY,FAILED)questions: List of benchmark question objects, each containing:question_num: Question numberquestion: Question textanswer: Expected answer text
num_questions: Total number of questions in the benchmark
Raises:
400: If file format is invalid, JSON structure is incorrect, or document_id is not found413: If file size exceeds limit
Example 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:
{
"benchmark_id": "benchmark-abc123",
"benchmark_name": "My Benchmark",
"status": "READY",
"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:
- File must be in valid JSON format with proper question structure
- Each question must include
question_num,question, andanswerfields - The benchmark is immediately available for use in evaluations after upload
- The
document_idprovided in the request is stored internally and will appear as a single-elementdocumentsarray (e.g.,["doc-abc123"]) when retrieving the benchmark via/benchmark/listor/benchmark/{id}/dataendpoints
POST
Upload Benchmark
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
multipart/form-data
Response
Successful Response