---
title: "CreateFineTuningJobRequest"
url: "https://kongair.terwilligar.com/apis/openai-api-2-3-0/versions/ea92d048-c746-4ead-a6a8-da28d93137d1/schemas/CreateFineTuningJobRequest"
---

> Full API specification: https://kongair.terwilligar.com/apis/openai-api-2-3-0/versions/ea92d048-c746-4ead-a6a8-da28d93137d1.md

# CreateFineTuningJobRequest

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: OpenAI API
  version: 2.3.0
servers:
  - url: https://api.openai.com/v1
components:
  schemas:
    FineTuneMethod:
      type: object
      description: The method used for fine-tuning.
      properties:
        type:
          type: string
          description: The type of method. Is either `supervised` or `dpo`.
          enum:
            - supervised
            - dpo
        supervised:
          $ref: "#/components/schemas/FineTuneSupervisedMethod"
        dpo:
          $ref: "#/components/schemas/FineTuneDPOMethod"
    FineTuneSupervisedMethod:
      type: object
      description: Configuration for the supervised fine-tuning method.
      properties:
        hyperparameters:
          type: object
          description: The hyperparameters used for the fine-tuning job.
          properties:
            batch_size:
              description: >
                Number of examples in each batch. A larger batch size means that
                model parameters are updated less frequently, but with lower
                variance.
              oneOf:
                - type: string
                  enum:
                    - auto
                  x-stainless-const: true
                - type: integer
                  minimum: 1
                  maximum: 256
              default: auto
            learning_rate_multiplier:
              description: >
                Scaling factor for the learning rate. A smaller learning rate
                may be useful to avoid overfitting.
              oneOf:
                - type: string
                  enum:
                    - auto
                  x-stainless-const: true
                - type: number
                  minimum: 0
                  exclusiveMinimum: true
              default: auto
            n_epochs:
              description: >
                The number of epochs to train the model for. An epoch refers to
                one full cycle through the training dataset.
              oneOf:
                - type: string
                  enum:
                    - auto
                  x-stainless-const: true
                - type: integer
                  minimum: 1
                  maximum: 50
              default: auto
    FineTuneDPOMethod:
      type: object
      description: Configuration for the DPO fine-tuning method.
      properties:
        hyperparameters:
          type: object
          description: The hyperparameters used for the fine-tuning job.
          properties:
            beta:
              description: >
                The beta value for the DPO method. A higher beta value will
                increase the weight of the penalty between the policy and
                reference model.
              oneOf:
                - type: string
                  enum:
                    - auto
                  x-stainless-const: true
                - type: number
                  minimum: 0
                  maximum: 2
                  exclusiveMinimum: true
              default: auto
            batch_size:
              description: >
                Number of examples in each batch. A larger batch size means that
                model parameters are updated less frequently, but with lower
                variance.
              oneOf:
                - type: string
                  enum:
                    - auto
                  x-stainless-const: true
                - type: integer
                  minimum: 1
                  maximum: 256
              default: auto
            learning_rate_multiplier:
              description: >
                Scaling factor for the learning rate. A smaller learning rate
                may be useful to avoid overfitting.
              oneOf:
                - type: string
                  enum:
                    - auto
                  x-stainless-const: true
                - type: number
                  minimum: 0
                  exclusiveMinimum: true
              default: auto
            n_epochs:
              description: >
                The number of epochs to train the model for. An epoch refers to
                one full cycle through the training dataset.
              oneOf:
                - type: string
                  enum:
                    - auto
                  x-stainless-const: true
                - type: integer
                  minimum: 1
                  maximum: 50
              default: auto
    CreateFineTuningJobRequest:
      type: object
      properties:
        model:
          description: >
            The name of the model to fine-tune. You can select one of the

            [supported
            models](/docs/guides/fine-tuning#which-models-can-be-fine-tuned).
          example: gpt-4o-mini
          anyOf:
            - type: string
            - type: string
              enum:
                - babbage-002
                - davinci-002
                - gpt-3.5-turbo
                - gpt-4o-mini
          x-oaiTypeLabel: string
        training_file:
          description: >
            The ID of an uploaded file that contains training data.


            See [upload file](/docs/api-reference/files/create) for how to
            upload a file.


            Your dataset must be formatted as a JSONL file. Additionally, you
            must upload your file with the purpose `fine-tune`.


            The contents of the file should differ depending on if the model
            uses the [chat](/docs/api-reference/fine-tuning/chat-input),
            [completions](/docs/api-reference/fine-tuning/completions-input)
            format, or if the fine-tuning method uses the
            [preference](/docs/api-reference/fine-tuning/preference-input)
            format.


            See the [fine-tuning guide](/docs/guides/fine-tuning) for more
            details.
          type: string
          example: file-abc123
        hyperparameters:
          type: object
          description: >
            The hyperparameters used for the fine-tuning job.

            This value is now deprecated in favor of `method`, and should be
            passed in under the `method` parameter.
          properties:
            batch_size:
              description: >
                Number of examples in each batch. A larger batch size means that
                model parameters

                are updated less frequently, but with lower variance.
              oneOf:
                - type: string
                  enum:
                    - auto
                  x-stainless-const: true
                - type: integer
                  minimum: 1
                  maximum: 256
              default: auto
            learning_rate_multiplier:
              description: >
                Scaling factor for the learning rate. A smaller learning rate
                may be useful to avoid

                overfitting.
              oneOf:
                - type: string
                  enum:
                    - auto
                  x-stainless-const: true
                - type: number
                  minimum: 0
                  exclusiveMinimum: true
              default: auto
            n_epochs:
              description: >
                The number of epochs to train the model for. An epoch refers to
                one full cycle

                through the training dataset.
              oneOf:
                - type: string
                  enum:
                    - auto
                  x-stainless-const: true
                - type: integer
                  minimum: 1
                  maximum: 50
              default: auto
          deprecated: true
        suffix:
          description: >
            A string of up to 64 characters that will be added to your
            fine-tuned model name.


            For example, a `suffix` of "custom-model-name" would produce a model
            name like `ft:gpt-4o-mini:openai:custom-model-name:7p4lURel`.
          type: string
          minLength: 1
          maxLength: 64
          default: null
          nullable: true
        validation_file:
          description: >
            The ID of an uploaded file that contains validation data.


            If you provide this file, the data is used to generate validation

            metrics periodically during fine-tuning. These metrics can be viewed
            in

            the fine-tuning results file.

            The same data should not be present in both train and validation
            files.


            Your dataset must be formatted as a JSONL file. You must upload your
            file with the purpose `fine-tune`.


            See the [fine-tuning guide](/docs/guides/fine-tuning) for more
            details.
          type: string
          nullable: true
          example: file-abc123
        integrations:
          type: array
          description: A list of integrations to enable for your fine-tuning job.
          nullable: true
          items:
            type: object
            required:
              - type
              - wandb
            properties:
              type:
                description: >
                  The type of integration to enable. Currently, only "wandb"
                  (Weights and Biases) is supported.
                oneOf:
                  - type: string
                    enum:
                      - wandb
                    x-stainless-const: true
              wandb:
                type: object
                description: >
                  The settings for your integration with Weights and Biases.
                  This payload specifies the project that

                  metrics will be sent to. Optionally, you can set an explicit
                  display name for your run, add tags

                  to your run, and set a default entity (team, username, etc) to
                  be associated with your run.
                required:
                  - project
                properties:
                  project:
                    description: >
                      The name of the project that the new run will be created
                      under.
                    type: string
                    example: my-wandb-project
                  name:
                    description: >
                      A display name to set for the run. If not set, we will use
                      the Job ID as the name.
                    nullable: true
                    type: string
                  entity:
                    description: >
                      The entity to use for the run. This allows you to set the
                      team or username of the WandB user that you would

                      like associated with the run. If not set, the default
                      entity for the registered WandB API key is used.
                    nullable: true
                    type: string
                  tags:
                    description: >
                      A list of tags to be attached to the newly created run.
                      These tags are passed through directly to WandB. Some

                      default tags are generated by OpenAI: "openai/finetune",
                      "openai/{base-model}", "openai/{ftjob-abcdef}".
                    type: array
                    items:
                      type: string
                      example: custom-tag
        seed:
          description: >
            The seed controls the reproducibility of the job. Passing in the
            same seed and job parameters should produce the same results, but
            may differ in rare cases.

            If a seed is not specified, one will be generated for you.
          type: integer
          nullable: true
          minimum: 0
          maximum: 2147483647
          example: 42
        method:
          $ref: "#/components/schemas/FineTuneMethod"
      required:
        - model
        - training_file
```
