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

# Create a fine-tuned model



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/user/model
openapi: 3.1.0
info:
  title: 4MINDS API
  version: v1
  description: >-
    OpenAPI spec for the 4MINDS-native API (`/api/v1`), generated from the
    Python client's request/response definitions. Successful responses use the
    envelope `{"status":"success","data": ...}`; errors use
    `{"status":"error","message": ...}`.
servers:
  - url: https://api.4minds.ai
security:
  - bearerAuth: []
tags:
  - name: Models
  - name: Conversations
  - name: Datasets
  - name: Evaluations
  - name: Inference
paths:
  /api/v1/user/model:
    post:
      tags:
        - Models
      summary: Create a fine-tuned model
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModelCreate'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - data
                properties:
                  status:
                    type: string
                    enum:
                      - success
                  data:
                    $ref: '#/components/schemas/Model'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
components:
  schemas:
    ModelCreate:
      type: object
      required:
        - model_name
        - dataset_id
      properties:
        model_name:
          type: string
        dataset_id:
          type: string
        description:
          type: string
        base_model_id:
          type: integer
        training_type_id:
          type: string
        use_case_id:
          type: integer
        persona_id:
          type: integer
    Model:
      additionalProperties: true
      properties:
        id:
          title: Id
          type: integer
        name:
          title: Name
          type: string
        description:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Description
        category:
          anyOf:
            - type: string
            - type: 'null'
          default: General
          title: Category
        size_numeric:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          title: Size Numeric
        base_model_name:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Base Model Name
        trained_model_id:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          title: Trained Model Id
        training_type_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Training Type Id
        dataset_id:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          title: Dataset Id
        file_path:
          anyOf:
            - type: string
            - type: 'null'
          default: ''
          title: File Path
        base_model_id:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          title: Base Model Id
        personaId:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          title: Personaid
        use_case_id:
          anyOf:
            - {}
            - type: 'null'
          default: null
          title: Use Case Id
        use_case_name:
          anyOf:
            - {}
            - type: 'null'
          default: null
          title: Use Case Name
        use_case_label:
          anyOf:
            - {}
            - type: 'null'
          default: null
          title: Use Case Label
        use_case_description:
          anyOf:
            - {}
            - type: 'null'
          default: null
          title: Use Case Description
        use_case_custom:
          anyOf:
            - {}
            - type: 'null'
          default: null
          title: Use Case Custom
        onboarding_goal:
          anyOf:
            - {}
            - type: 'null'
          default: null
          title: Onboarding Goal
        onboarding_role:
          anyOf:
            - {}
            - type: 'null'
          default: null
          title: Onboarding Role
        has_image:
          anyOf:
            - type: boolean
            - type: 'null'
          default: false
          title: Has Image
        trained_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          default: null
          title: Trained At
        status:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Status
        graph_status:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Graph Status
        graph_build_progress:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          title: Graph Build Progress
        fine_tuning_status:
          anyOf:
            - type: boolean
            - type: 'null'
          default: false
          title: Fine Tuning Status
        metrics:
          anyOf:
            - $ref: '#/components/schemas/Metrics'
            - type: 'null'
          default: null
        dataset_info:
          anyOf:
            - $ref: '#/components/schemas/DatasetInfo'
            - type: 'null'
          default: null
        external_model_id:
          anyOf:
            - {}
            - type: 'null'
          default: null
          title: External Model Id
        external_provider_type:
          anyOf:
            - {}
            - type: 'null'
          default: null
          title: External Provider Type
        external_model_capabilities:
          anyOf:
            - {}
            - type: 'null'
          default: null
          title: External Model Capabilities
        fine_tune:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Fine Tune
        token_speed:
          anyOf:
            - type: number
            - type: 'null'
          default: 0
          title: Token Speed
        response_time:
          anyOf:
            - type: number
            - type: 'null'
          default: 0
          title: Response Time
        success_rate:
          anyOf:
            - type: number
            - type: 'null'
          default: 100
          title: Success Rate
        is_private:
          anyOf:
            - type: boolean
            - type: 'null'
          default: null
          title: Is Private
        shared_with_organization:
          anyOf:
            - type: boolean
            - type: 'null'
          default: null
          title: Shared With Organization
        team_ids:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          default: null
          title: Team Ids
        team_names:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          default: null
          title: Team Names
        owner_email:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Owner Email
        is_shared:
          anyOf:
            - type: boolean
            - type: 'null'
          default: false
          title: Is Shared
        organization_name:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Organization Name
        shared_user_count:
          anyOf:
            - type: integer
            - type: 'null'
          default: 0
          title: Shared User Count
        dataset_sharing_status:
          anyOf:
            - {}
            - type: 'null'
          default: null
          title: Dataset Sharing Status
        pending_dataset_access_requests:
          anyOf:
            - type: integer
            - type: 'null'
          default: 0
          title: Pending Dataset Access Requests
        created_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          default: null
          title: Created At
        updated_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          default: null
          title: Updated At
      required:
        - id
        - name
      title: Model
      type: object
    ErrorEnvelope:
      type: object
      required:
        - status
        - message
      properties:
        status:
          type: string
          enum:
            - error
        message:
          type: string
    Metrics:
      additionalProperties: true
      properties:
        accuracy:
          title: Accuracy
          type: number
        loss:
          title: Loss
          type: number
        validationAccuracy:
          title: Validationaccuracy
          type: number
        trainingTime:
          title: Trainingtime
          type: string
        epochsCompleted:
          title: Epochscompleted
          type: integer
        parametersOptimized:
          title: Parametersoptimized
          type: string
      required:
        - accuracy
        - loss
        - validationAccuracy
        - trainingTime
        - epochsCompleted
        - parametersOptimized
      title: Metrics
      type: object
    DatasetInfo:
      additionalProperties: true
      properties:
        name:
          title: Name
          type: string
        size:
          title: Size
          type: integer
        samples:
          title: Samples
          type: integer
        data_type:
          title: Data Type
          type: string
        updated_at:
          format: date-time
          title: Updated At
          type: string
      required:
        - name
        - size
        - samples
        - data_type
        - updated_at
      title: DatasetInfo
      type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Static, non-expiring API key: `Authorization: Bearer
        <FOURMINDS_API_KEY>`.

````