Upload Benchmark File
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 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:
id: Unique identifier for the uploaded benchmarkname: 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:
{
"id": "benchmark-xyz789",
"name": "Customer Support Q&A",
"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
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Response
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
PROCESSING, READY, FAILED, DEPLOYING, EVALUATING, UNDEPLOYED, EVALUATED, STOPPED "PROCESSING"
Number of questions in the benchmark
10
List of uploaded benchmark questions