> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nugen.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Download Evaluation Results

> Download evaluation results as a JSON file.


This endpoint returns the complete evaluation results as a downloadable JSON file. The file includes all metrics, scores, and detailed evaluation data.


**Path Parameters:**

- `evaluation_id`: Unique evaluation identifier


**Returns:**

JSON file download containing:

- Single model evaluation: All metrics, scores, and detailed results
- Comparison mode: Both models' metrics, scores, and comparison data


**Response Headers:**

- `Content-Type`: `application/json`
- `Content-Disposition`: `attachment; filename=evaluation_results_{evaluation_id}.json` or `evaluation_comparison_{evaluation_id}.json`


**Raises:**

- `404`: If evaluation not found or doesn't belong to the authenticated user
- `400`: If evaluation is not yet completed


**Example Request:**

```json
GET /api/v3/evaluations/eval-xyz789/download
Headers: {"Authorization": "Bearer <api_key>"}
```


**Example Downloaded File (Single Model):**

```json
{
  "evaluation_id": "eval-xyz789",
  "status": "READY",
  "model_id": "aligned-model-01kmqm4nrn9fw6r",
  "benchmark_id": "task-abc123",
  "metrics": {
    "accuracy": 0.92,
    "relevance": 0.88,
    "average_score": 0.90
  },
  "detailed_results": [
    {
      "question": "What is the main purpose?",
      "expected_answer": "To provide...",
      "model_answer": "The main purpose is to provide...",
      "score": 0.95
    }
  ],
  "created_at": "2024-01-15T10:30:00Z",
  "completed_at": "2024-01-15T10:45:00Z"
}
```


**Notes:**

- Returns formatted JSON with proper indentation
- Only available for completed evaluations



## OpenAPI

````yaml https://api.nugen.in/openapi-public.json get /api/v3/evaluations/{evaluation_id}/download
openapi: 3.1.0
info:
  title: Nugen Intelligence API
  description: 'Nugen Intelligence : Powering Specialized Intelligence At Scale'
  version: 25.4.20
servers: []
security: []
paths:
  /api/v3/evaluations/{evaluation_id}/download:
    get:
      tags:
        - Evaluations
      summary: Download Evaluation Results
      description: >-
        Download evaluation results as a JSON file.



        This endpoint returns the complete evaluation results as a downloadable
        JSON file. The file includes all metrics, scores, and detailed
        evaluation data.



        **Path Parameters:**


        - `evaluation_id`: Unique evaluation identifier



        **Returns:**


        JSON file download containing:


        - Single model evaluation: All metrics, scores, and detailed results

        - Comparison mode: Both models' metrics, scores, and comparison data



        **Response Headers:**


        - `Content-Type`: `application/json`

        - `Content-Disposition`: `attachment;
        filename=evaluation_results_{evaluation_id}.json` or
        `evaluation_comparison_{evaluation_id}.json`



        **Raises:**


        - `404`: If evaluation not found or doesn't belong to the authenticated
        user

        - `400`: If evaluation is not yet completed



        **Example Request:**


        ```json

        GET /api/v3/evaluations/eval-xyz789/download

        Headers: {"Authorization": "Bearer <api_key>"}

        ```



        **Example Downloaded File (Single Model):**


        ```json

        {
          "evaluation_id": "eval-xyz789",
          "status": "READY",
          "model_id": "aligned-model-01kmqm4nrn9fw6r",
          "benchmark_id": "task-abc123",
          "metrics": {
            "accuracy": 0.92,
            "relevance": 0.88,
            "average_score": 0.90
          },
          "detailed_results": [
            {
              "question": "What is the main purpose?",
              "expected_answer": "To provide...",
              "model_answer": "The main purpose is to provide...",
              "score": 0.95
            }
          ],
          "created_at": "2024-01-15T10:30:00Z",
          "completed_at": "2024-01-15T10:45:00Z"
        }

        ```



        **Notes:**


        - Returns formatted JSON with proper indentation

        - Only available for completed evaluations
      operationId: download_evaluation_results
      parameters:
        - name: evaluation_id
          in: path
          required: true
          schema:
            type: string
            title: Evaluation Id
      responses:
        '200':
          description: Successfully returns evaluation results as a downloadable JSON file
          content:
            application/json:
              schema: {}
              examples:
                single_model:
                  summary: Single Model Evaluation
                  value:
                    evaluation_id: eval-xyz789
                    status: READY
                    model_id: alignment-abc123-deployed
                    benchmark_id: task-def456
                    method: eval
                    metrics:
                      accuracy: 0.92
                      relevance: 0.88
                      overall_score: 0.9
                      uncertainty: 0.15
                      domain_violations: 2
                    raw_answers_count: 50
                    detailed_results:
                      - question_id: q1
                        question: What is the main purpose of the product?
                        expected_answer: To provide customer support automation
                        model_answer: >-
                          The main purpose is to provide automated customer
                          support solutions
                        score: 0.95
                        relevance: 0.92
                      - question_id: q2
                        question: How does the pricing work?
                        expected_answer: Monthly subscription based on usage
                        model_answer: Pricing is based on a monthly subscription model
                        score: 0.88
                        relevance: 0.85
                    created_at: '2024-01-15T10:30:00Z'
                    completed_at: '2024-01-15T10:45:00Z'
                comparison:
                  summary: Model Comparison Evaluation
                  value:
                    evaluation_id: eval-compare-123
                    status: READY
                    model_id: alignment-abc123-deployed
                    model_id_2: alignment-xyz789-deployed
                    benchmark_id: task-def456
                    method: eval-compare
                    base_model:
                      model_id: alignment-abc123-deployed
                      metrics:
                        accuracy: 0.85
                        relevance: 0.82
                        overall_score: 0.83
                    eval_model:
                      model_id: alignment-xyz789-deployed
                      metrics:
                        accuracy: 0.92
                        relevance: 0.88
                        overall_score: 0.9
                    comparison:
                      accuracy_improvement: 0.07
                      relevance_improvement: 0.06
                      overall_improvement: 0.07
                      better_model: alignment-xyz789-deployed
                    created_at: '2024-01-16T09:00:00Z'
                    completed_at: '2024-01-16T09:20:00Z'
          headers:
            Content-Disposition:
              description: Attachment header with filename
              schema:
                type: string
                example: attachment; filename=evaluation_results_eval-xyz789.json
        '404':
          description: Evaluation not found or doesn't belong to user
          content:
            application/json:
              example:
                detail: Evaluation not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````