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

# Get model

> Retrieve details and performance metrics for a trained model.

`achievedPerformance` is the balanced-class accuracy on the held-out test set (10% of training data).




## OpenAPI

````yaml GET /api/v1/models/{modelKey}
openapi: 3.0.1
info:
  title: MathFi.ai API
  description: >
    The MathFi.ai REST API lets you build predictive AI applications
    programmatically.


    Upload labelled CSV data, train a model, and run predictions — all in
    minutes.

    The API supports binary and multi-class classification on tabular data using

    Cellular Balanced Learning (CBL), running entirely on commodity CPUs.


    ## Base URL


    ```

    https://api.mathfi.ai

    ```


    ## Authentication


    All `/api/v1/*` endpoints require a Bearer token obtained from `POST
    /api/login`.

    Tokens are valid for **1 hour**. Re-authenticate when you receive a `401`.


    ```

    Authorization: Bearer <token>

    ```
  contact:
    name: MathFi.ai
    url: https://mathfi.ai
    email: support@mathfi.ai
  license:
    name: Mathficast Limited
    url: https://mathfi.ai
  version: 1.0.0
servers:
  - url: https://api.mathfi.ai
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Authentication
    description: Obtain a Bearer token to authenticate API requests
  - name: Datasets
    description: Create and manage labelled training data in CSV format
  - name: Training
    description: Train models from datasets using a small set of hyperparameters
  - name: Models
    description: Inspect trained models and their performance metrics
  - name: Predictions
    description: Run inference on unseen data using trained models
paths:
  /api/v1/models/{modelKey}:
    get:
      tags:
        - Models
      summary: Get model
      description: >
        Retrieve details and performance metrics for a trained model.


        `achievedPerformance` is the balanced-class accuracy on the held-out
        test set (10% of training data).
      operationId: getModel
      parameters:
        - name: modelKey
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Model retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelOutput'
              examples:
                Model detail:
                  value:
                    modelKey: 3a1a9a83-d549-4f25-b7ed-8174e0c955de
                    datasetKey: 2b0a9a83-d549-4f25-b7ed-8174e0c955cd
                    trainingJobKey: 2b0a9a83-d549-4f25-b7ed-8174e0c955cd
                    version: 1
                    achievedPerformance: 0.92
                    createdOn: '2024-08-07T06:38:20Z'
        '400':
          description: Invalid model key
        '500':
          description: Internal server error
components:
  schemas:
    ModelOutput:
      required:
        - modelKey
        - datasetKey
        - version
        - achievedPerformance
        - createdOn
      type: object
      properties:
        modelKey:
          type: string
          format: uuid
        datasetKey:
          type: string
          format: uuid
        trainingJobKey:
          type: string
          format: uuid
        version:
          type: integer
          format: int32
          description: >-
            Version number. Increments each time training produces a better
            model for the same dataset.
        achievedPerformance:
          type: number
          format: double
          description: >-
            Balanced-class accuracy on the held-out test set (10% of training
            data)
        trainingPerformance:
          type: number
          format: double
        testPerformance:
          type: number
          format: double
        createdOn:
          type: string
          format: date-time
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Obtain a token from `POST /api/login`. Valid for 1 hour.

````