> ## 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.

# List predictions by model

> Returns all predictions run using a given model, paginated.



## OpenAPI

````yaml GET /api/v1/predictions/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/predictions/models/{modelKey}:
    get:
      tags:
        - Predictions
      summary: List predictions by model
      description: Returns all predictions run using a given model, paginated.
      operationId: listPredictionsByModel
      parameters:
        - name: modelKey
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: offset
          in: query
          required: true
          schema:
            type: integer
            format: int64
            minimum: 0
            example: 0
        - name: limit
          in: query
          required: true
          schema:
            type: integer
            format: int64
            minimum: 1
            example: 10
      responses:
        '200':
          description: Predictions listed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PredictionList'
        '400':
          description: Invalid parameters
        '500':
          description: Internal server error
components:
  schemas:
    PredictionList:
      required:
        - predictions
        - offset
        - limit
        - total
      type: object
      properties:
        predictions:
          type: array
          items:
            $ref: '#/components/schemas/PredictionListItem'
        offset:
          type: integer
          format: int64
        nextOffset:
          type: integer
          format: int64
        limit:
          type: integer
          format: int64
        total:
          type: integer
          format: int64
    PredictionListItem:
      required:
        - predictionKey
        - modelKey
        - datasetKey
      type: object
      properties:
        predictionKey:
          type: string
          format: uuid
        modelKey:
          type: string
          format: uuid
        datasetKey:
          type: string
          format: uuid
        datasetName:
          type: string
        status:
          $ref: '#/components/schemas/PredictionStatus'
        modelPerformance:
          type: number
          format: double
        predictionResultDownloadUrl:
          type: string
        createdOn:
          type: string
          format: date-time
    PredictionStatus:
      type: string
      description: |
        Status of a prediction job:

        | Status | Description |
        |---|---|
        | `PENDING` | Created, queued for processing |
        | `RUNNING` | Inference in progress |
        | `COMPLETED` | Finished. Result CSV available for download. |
        | `FAILED` | Failed due to an error |
        | `TIMEOUT` | Exceeded the processing time limit |
      enum:
        - PENDING
        - RUNNING
        - COMPLETED
        - FAILED
        - TIMEOUT
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Obtain a token from `POST /api/login`. Valid for 1 hour.

````