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

> Returns a paginated list of all datasets for the authenticated user.



## OpenAPI

````yaml GET /api/v1/datasets
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/datasets:
    get:
      tags:
        - Datasets
      summary: List datasets
      description: Returns a paginated list of all datasets for the authenticated user.
      operationId: listDatasets
      parameters:
        - name: offset
          in: query
          description: Number of items to skip
          required: true
          schema:
            type: integer
            format: int64
            minimum: 0
            example: 0
        - name: limit
          in: query
          description: Maximum number of items to return
          required: true
          schema:
            type: integer
            format: int64
            minimum: 1
            example: 10
        - name: state
          in: query
          description: Filter by dataset status
          required: false
          schema:
            $ref: '#/components/schemas/DatasetCreationStatus'
        - name: withModelOnly
          in: query
          description: When true, only returns datasets that have a trained model
          required: false
          schema:
            type: boolean
      responses:
        '200':
          description: Datasets listed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatasetList'
        '400':
          description: Invalid pagination parameters
        '500':
          description: Internal server error
components:
  schemas:
    DatasetCreationStatus:
      type: string
      description: |
        Processing status of a dataset:

        | Status | Description |
        |---|---|
        | `PENDING` | Created, awaiting data upload |
        | `PROCESSING` | Data uploaded, preparation in progress |
        | `COMPLETED` | Ready for training |
        | `FAILED` | Processing failed |
      enum:
        - PENDING
        - PROCESSING
        - COMPLETED
        - FAILED
    DatasetList:
      required:
        - datasets
        - offset
        - limit
        - total
      type: object
      properties:
        datasets:
          type: array
          items:
            $ref: '#/components/schemas/DatasetListItem'
        offset:
          type: integer
          format: int64
        nextOffset:
          type: integer
          format: int64
        limit:
          type: integer
          format: int64
        total:
          type: integer
          format: int64
    DatasetListItem:
      required:
        - datasetKey
        - datasetName
        - status
      type: object
      properties:
        datasetKey:
          type: string
          format: uuid
        datasetName:
          type: string
        numberOfBuckets:
          type: integer
          format: int64
        modelKey:
          type: string
          format: uuid
          description: Key of the current champion model, if one exists
        status:
          $ref: '#/components/schemas/DatasetCreationStatus'
        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.

````