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

# Create Fine-Tuning Job

> Launch a fine-tuning job from a snapshot and experiment plan.



## OpenAPI

````yaml POST /api/v1/public/finetuning/create
openapi: 3.1.0
info:
  version: 0.0.1
  title: Prem Studio API
  description: Studio autofinetuning agent API
servers:
  - url: http://studio.premai.io
    description: Current environment
  - url: https://studio.premai.io
    description: Production server
security:
  - bearerAuth: []
paths:
  /api/v1/public/finetuning/create:
    post:
      tags:
        - Public Fine-tuning
      description: Create and start fine-tuning job
      operationId: finetuning.create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateFinetuningRequest'
      responses:
        '200':
          description: Fine-tuning job created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FinetuningResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: Insufficient credits
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Snapshot not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Quota exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CreateFinetuningRequest:
      type: object
      properties:
        snapshot_id:
          type: string
          format: uuid
        name:
          type: string
          minLength: 1
        experiments:
          type: array
          items:
            type: object
            properties:
              base_model_id:
                type: string
              batch_size:
                type: integer
                minimum: 1
              learning_rate_multiplier:
                type: number
                minimum: 0
                exclusiveMinimum: true
              n_epochs:
                type: integer
                minimum: 1
              training_type:
                type: string
                enum:
                  - full
                  - lora
                  - qlora
              refinetune_from_experiment_id:
                type: string
                format: uuid
            required:
              - base_model_id
              - batch_size
              - learning_rate_multiplier
              - n_epochs
              - training_type
          minItems: 1
      required:
        - snapshot_id
        - name
        - experiments
    FinetuningResponse:
      type: object
      properties:
        job_id:
          type: string
          format: uuid
      required:
        - job_id
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````